how can i solve this system on matlab?
1 view (last 30 days)
Show older comments
v+L =1
0.25=x1*L + y1*v
0.45 = x2*L +y2*v
0.30 = x3*L +y3*v
y1 = 2.7406*x1
y2 = 1.019*x2
y3 = 0.384*x3
x1+x2+x3=1
0 Comments
Accepted Answer
Star Strider
on 2 Oct 2021
A different approach —
syms L v x1 x2 x3 y1 y2 y3
sys = [(v+L ==1)
(0.25==x1*L + y1*v)
(0.45 == x2*L +y2*v)
(0.30 == x3*L +y3*v)
(y1 == 2.7406*x1)
(y2 == 1.019*x2)
(y3 == 0.384*x3)
(x1+x2+x3==1)];
S = solve(sys)
T = struct2table(S)
T = varfun(@double, T)
.
0 Comments
More Answers (1)
David Hill
on 2 Oct 2021
syms v L x1 x2 x3 y1 y2 y3
eq1=v+L==1;
eq2=x1*L+y1*v==.25;
eq3=x2*L+y2*v==.45;
eq4=x3*L+y3*v==.30;
eq5=y1==2.7406*x1;
eq6=y2==1.019*x2;
eq7=y3==0.384*x3;
eq8=x1+x2+x3==1;
eqs=[eq1;eq2;eq3;eq4;eq5;eq6;eq7;eq8];
Sol=solve(eqs,[x1,x2,x3,y1,y2,y3,v,L]);
2 Comments
See Also
Categories
Find more on Symbolic Math Toolbox 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!