Facing Problem while solving Linear Equations simultaneously
1 view (last 30 days)
Show older comments
inzamam shoukat
on 21 Mar 2024
Commented: Star Strider
on 21 Mar 2024
These are my Five Equations
syms a2 a3 a4 a5 a6
EQ_01=a2 +9*a3 + 72*a4 + 540*a5 + 3888*a6 == -121/36000
EQ_02=a3+ a2/12 +9*a4 +72*a5 +540*a6 == -1049/7776000
EQ_03=a4 + (5*a2)/648 + (5*a3)/48 + (25*a5)/3 + (450*a6)/7 == -2987/419904000
EQ_04 =a5 + (7*a2)/8640 + (7*a3)/600 + (7*a4)/60 + (63*a6)/8 == -19789/41990400000
EQ_05 =a6 + a2/10800 + a3/720 + a4/70 + a5/8 == -24163/661348800000
i am trying to solve for the variables a2 , a3, a4 , a5 & a6
here is my code
sol = solve([EQ_01, EQ_02, EQ_03, EQ_04, EQ_05],[a2,a3,a4,a5,a6])
and i got fallowing error
1---Second argument must be a vector of symbolic variables.
2----[eqns, vars] = sym.getEqnsVars(argv{:});
3----[eqns,vars,options] = getEqns(varargin{:});
4----Error in Rayleigh_Ritz_Method (line 104)
sol = solve([EQ_01, EQ_02, EQ_03, EQ_04, EQ_05],[a2,a3,a4,a5,a6]);
0 Comments
Accepted Answer
Star Strider
on 21 Mar 2024
syms a2 a3 a4 a5 a6
EQ_01=a2 +9*a3 + 72*a4 + 540*a5 + 3888*a6 == -121/36000
EQ_02=a3+ a2/12 +9*a4 +72*a5 +540*a6 == -1049/7776000
EQ_03=a4 + (5*a2)/648 + (5*a3)/48 + (25*a5)/3 + (450*a6)/7 == -2987/419904000
EQ_04 =a5 + (7*a2)/8640 + (7*a3)/600 + (7*a4)/60 + (63*a6)/8 == -19789/41990400000
EQ_05 =a6 + a2/10800 + a3/720 + a4/70 + a5/8 == -24163/661348800000
sol = solve([EQ_01, EQ_02, EQ_03, EQ_04, EQ_05],[a2,a3,a4,a5,a6])
Note that the error message flagged exactly that problem (that the symbolic variables had not been declared first).
.
6 Comments
Star Strider
on 21 Mar 2024
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
More Answers (0)
See Also
Categories
Find more on Assumptions 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!