system of equations fails to solve
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Matlab refuses to solve this system of equations despite certain other programs finding a single valid solution.
The original script:
syms x r C
eqn1 = 22.6==(x*((r^2+(1/(2*pi*5000*C)^2))^(1/2)))/(x+((r^2+(1/(2*pi*5000*C)^2))^(1/2)))
eqn2 = 19.1==(x*((r^2+(1/(2*pi*50000*C)^2))^(1/2)))/(x+((r^2+(1/(2*pi*50000*C)^2))^(1/2)))
eqn3 = 14.4==(x*((r^2+(1/(2*pi*500000*C)^2))^(1/2)))/(x+((r^2+(1/(2*pi*500000*C)^2))^(1/2)))
assume(C>0)
assume(x>0)
assume(r>0)
sol = solve(eqn1,eqn2,eqn3,x,r,C,'IgnoreAnalyticConstraints',1)
The errors:
Warning: Solutions are parameterized by the symbols: z, z1, z2. To include parameters and conditions in the solution,
specify the 'ReturnConditions' value as 'true'.
> In solve>warnIfParams (line 475)
In solve (line 357)
In failedscript (line 11)
Warning: Solutions are valid under the following conditions: 191/10 - (z*(z1^2 + 1/(10000000000*z2^2*pi^2))^(1/2))/(z
+ (z1^2 + 1/(10000000000*z2^2*pi^2))^(1/2)) == 0 & 0 < z & 0 < z1 & 0 < z2 & 72/5 - (z*(z1^2 +
4611686018427387904/(45515516623913202182151461698081*z2^2))^(1/2))/(z + (z1^2 +
4611686018427387904/(45515516623913202182151461698081*z2^2))^(1/2)) == 0 & 113/5 - (z*(z1^2 +
1/(100000000*z2^2*pi^2))^(1/2))/(z + (z1^2 + 1/(100000000*z2^2*pi^2))^(1/2)) == 0. To include parameters and
conditions in the solution, specify the 'ReturnConditions' value as 'true'.
> In solve>warnIfParams (line 482)
In solve (line 357)
In failedscript (line 11)
sol =
struct with fields:
x: [1×1 sym]
r: [1×1 sym]
C: [1×1 sym]
For simplicity the original equations are here:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275422/image.png)
0 comentarios
Respuestas (2)
Sindhu Karri
el 18 de Mzo. de 2020
Hii,
It seems like the mathematical equations you code doesn't match with the original set of equations you provided. I urge you to recheck the equation once more. Although I wrote the code with the original equation and it seems to be working for me. You can refer to the following code. Also I recommend you to use vpasolve instead of solve function.
Code:
syms x r C
eq1=x+(1/(((1/r)^2+(2*3.14159*500*C)^2))^1/2)==22.6
eq2=x+(1/(((1/r)^2+(2*3.14159*50000*C)^2))^1/2)==19.1
eq3=x+(1/(((1/r)^2+(2*3.14159*500000*C)^2))^1/2)==14.4
assume(x>0)
assume(r>0)
assume(C>0)
sol=vpasolve(eq1,eq2,eq3,r,x,C)
1 comentario
Sindhu Karri
el 19 de Mzo. de 2020
This seems to work
syms x r C
eq1=(x*(((1/r)^2+(2*3.14159*5000*C)^2))^1/2)/(x+((((1/r)^2+(2*3.14159*5000*C)^2))^1/2))==22.6
eq2=(x*((((1/r)^2+(2*3.14159*50000*C)^2))^1/2))/(x+((((1/r)^2+(2*3.14159*5000*C)^2))^1/2))==19.1
eq3=(x*((((1/r)^2+(2*3.14159*500000*C)^2))^1/2))/(x+((((1/r)^2+(2*3.14159*5000*C)^2))^1/2))==14.4
sol=vpasolve(eq1,eq2,eq3,r,x,C)
Ver también
Categorías
Más información sobre Special Values en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!