Solver doesn't find a solution for nonlinear problem

25 views
Skip to first unread message

cidex

unread,
May 22, 2013, 5:24:52 PM5/22/13
to sage-s...@googlegroups.com
Hi,

I use the following code in sage, which internally calls Maxima to solve the problem.
The solver never returns with a solution, even if i change the values randomly.
I tried to enter the same code into MATLAB and it also doesn't return with a solution.
What is the Problem?

L1=8;
L2=6;
L3=4;
C5=2;
C6=1;
C3=2;
C1=10-i*80;
C2=30;
s=i*2*pi*24;
def Par(Za,Zb):
    return (Za*Zb/(Za+Zb));
x=var("x");
y=var("y");
z=var("z");
Z1=s*L1;
Z2=s*L2;
Z3=1/(s*C3);
Z4=s*L3+1/(s*C5);
Z6=1/(s*C6);
Z2_=Par(Z2,x);
Zin_A=Par(Par(Par(Z1,z)+Z2_,y)+Z3+Z4,Z6);
Zin_B=Par(Par(Par(Z6,C2)+Z3+Z4,y)+Z2_,Z1);
solutions = solve([Zin_A==C2.conjugate(), Zin_B==C1.conjugate(), Par(z,x+y)==C1],x,y,z);
for solution in solutions: 
    print solution[x].n(digits=3), ",", solution[y].n(digits=3);

Harald Schilly

unread,
May 23, 2013, 4:40:06 PM5/23/13
to sage-s...@googlegroups.com
Hi

You are using a symbolic solver for a rather large system of equations. Maybe it's not really possible to solve this in a sane way and therefore you don't get an answer. I suggest you to look into solving this numerically, especially because in the end you seem to be only interested in a numerical approximation.


and similar, there are even more solvers in numpy/scipy too.

Harald

cidex

unread,
May 23, 2013, 5:45:41 PM5/23/13
to sage-s...@googlegroups.com
I kind of assumed that this was numerical, thanks!
Reply all
Reply to author
Forward
0 new messages