How can I solve the equations for some variables which could exclude some specific variables?
Show older comments
expr1=('v0*(y2+y6+y5)- v2*y6-v5*y5 -v3*y9-v2*y7=0');
expr2=('v0*(y6)+v3*y8-v2*(y6+y8+y1+y7)= 0');
expr3=('v3*(y8+y9+y10)+v2*y8-v4*y10=0');
expr4=('v2*gm-v4*(y10+y11+y3) + v3*y10+v5*y11= 0');
expr5=('v0*(y5-gm)-v5*(y5+y4+y11)+ v4*y11=0');
above are the 5 equations that i want to solve to find the expression of v0 in the terms of y1, y2, y3---- y11 and gm excluding the terms like v2, v3, v4 and v5.
i created the expression as shown above and used symvar to generate the variables to be solved in the matlab equation solver using first with this -
S= solve(expr1, expr2, expr3, expr4, expr5, 'y2', 'y1', 'y3', 'y4', 'y5', 'y6', 'y7', 'y8', 'y9', 'y10', 'y11', 'v0')
and then with this
v0= solve(expr1, expr2, expr3, expr4, expr5, 'v2', 'v3', 'v4', 'v5', 'v0');
I don't know how to assign y1, y2-- y11 and gm so that matlab takes them as constants.
all i get is the warning saying: -
" Warning: 5 equations in 12 variables. New variables might be introduced".
"Explicit solution could not be found".
or a result something like this
s =
v0: [1x1 sym]
v2: [1x1 sym]
v3: [1x1 sym]
v4: [1x1 sym]
v5: [1x1 sym]
Is there any way to find the solution of v0 in the terms of y1, y2--- y11 and gm which are all constant and exclude the terms like v2, v3, v4, v5.
any help in this matter will be appreciated.
Answers (1)
Walter Roberson
on 8 Mar 2013
The solution to the equations is
v0 = 0
v2 = 0
v3 = 0
v4 = 0
v5 = 0
2 Comments
Yogesh Kumar
on 8 Mar 2013
Walter Roberson
on 8 Mar 2013
Sorry, I should have written:
v0 = 0*y1 + 0*y2 + 0*y3 + 0*y4 + 0*y5 + 0*y6 + 0*y7 + 0*y8 + 0*y9 + 0*y10 + 0*y11 + 0*gm;
Categories
Find more on Symbolic Variables, Expressions, Functions, and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!