system of equations fails to solve

1 visualización (últimos 30 días)
Ben J Eells
Ben J Eells el 5 de Mzo. de 2020
Comentada: Ben J Eells el 8 de Abr. de 2020
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:

Respuestas (2)

Sindhu Karri
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
Ben J Eells
Ben J Eells el 18 de Mzo. de 2020
Editada: Ben J Eells el 18 de Mzo. de 2020
My appologies. I've been working with 2 different circuit topologies and I posted a screen clipping of the incorrect equation. I need to solve the equations that were in the original code. Here is a screen clipping of what they should look like.
I should mention I've tried vpasolve and it returns this:
struct with fields:
x: [0×1 sym]
r: [0×1 sym]
C: [0×1 sym]
Where all three components are:
Empty sym: 0-by-1

Iniciar sesión para comentar.


Sindhu Karri
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)
  1 comentario
Ben J Eells
Ben J Eells el 8 de Abr. de 2020
I'm not sure where you're getting the 1/r term. Either that's an algebraic manipulation I'm just not seeing or a typo.
I've revised the equation a bit further after realizing Matlab may not be interpreting my input the way I had expected. Seen here:
Again there is a 1/r term in both the numerator and denominator so I suspect this is an algebraic manipulation I've forgotten over the years.
My current system of equations script looks like this:
syms x r C
eq1=(x*(sqrt((r^2)+(1/(2i*pi*5000*C))^2)))/(sqrt((x+r)^2+(1/(2i*pi*5000*C))^2))==325.3
eq2=(x*(sqrt((r^2)+(1/(2i*pi*50000*C))^2)))/(sqrt((x+r)^2+(1/(2i*pi*50000*C))^2))==282.3
eq3=(x*(sqrt((r^2)+(1/(2i*pi*500000*C))^2)))/(sqrt((x+r)^2+(1/(2i*pi*500000*C))^2))==231.8
assume(x>0)
assume(r>0)
assume(C>0)
sol=vpasolve([eq1,eq2,eq3],[r,x,C])
Again I'm getting the error:
sol =
struct with fields:
r: [0×1 sym]
x: [0×1 sym]
C: [0×1 sym]

Iniciar sesión para comentar.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by