How do i reach the parametrized solutions of a system of nonlinear equations?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi to all,
I have to deal with a system of 4 nonlinear equations of the following form:
v1 = (b1*b2)/(b2+b3);
v2 = -(b1^2*b2*b3)/(b2 + b3)^3;
v3 = (b1^3)*b2*b3*(2*b3-b2)/(b2+b3)^5;
v4 = (b1*b2)/(a1*(b2+b3));
Using the solve command i tried to solve the system with a1, b1, b2 and b3 being the unknowns. What i expected (probably due to my insufficient knowledge regarding the Symbolic toolbox) was the solutions to be expressed as functions of v1, v2, v3 and v4. For example, a1 = v1/v4, or something like that. Instead, i get the following warning:
Warning: The solutions are parametrized by the symbols:
u7 = R_
u8 = R_
x = R_
y21 = R_
y22 = R_
y23 = R_
y24 = R_
y25 = R_
y26 = R_
ans =
a1: [5x1 sym]
b1: [5x1 sym]
b2: [5x1 sym]
b3: [5x1 sym]
How can someone evaluate such an answer? How could i use it? If there is any interpretation of this kind of results, it would me much appreciated.
Thank you all in advance!
0 Kommentare
Akzeptierte Antwort
Roger Stafford
am 2 Jun. 2013
It is strange that you had trouble on those particular four equations using 'solve'. On my very ancient Symbolic Toolbox it immediately coughed up the solution without any hesitation:
b1 = v1*(v3*v1-3*v2^2)/(v3*v1-2*v2^2);
b2 = v1^2*v2/(v3*v1-3*v2^2);
b3 = -v1^2*v2^3/(v3*v1-3*v2^2)/(v3*v1-2*v2^2);
a1 = v1/v4; % <-- You had that one right!
Are you sure you informed 'solve' properly as to which were to be regarded as the four unknowns? It is important to do that. How did you determine that a1 is equal to v1/v4?
3 Kommentare
Roger Stafford
am 2 Jun. 2013
Bearbeitet: Roger Stafford
am 2 Jun. 2013
Yes, that code is in error. The entities that appear in 'solve' should be those you want to set to zero! You were unknowingly trying to set the v's to zero and that is not what you want to accompllish. Try this:
syms b1 b2 b3 a1,v1,v2,v3,v4 real
f1 = (b1*b2)/(b2+b3)-v1;
f2 = -(b1^2*b2*b3)/(b2 + b3)^3-v2;
f3 = (b1^3)*b2*b3*(2*b3-b2)/(b2+b3)^5-v3;
f4 = (b1*b2)/(a1*(b2+b3))-v4;
Solution=solve([f1,f2,f3,f4], b1, b2, b3, a1);
Note: The expression "by hand" is correct usage here. I also did this by hand before I realized to my chagrin that my old Symbolic Toolbox could actually solve it.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!