the solution given is not correct
Ältere Kommentare anzeigen
syms PG1 PG2 PG3 PG4 PG5 PG6 PG7 PG8 PG9 PG10 L1 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 S1 S2 S3 S4 S5 S6 S7 S8 S9 S10
eq1 = 17+L1+T1-S1==0;
eq2 = 16+L1+T2-S2==0;
eq3 = 15+L1+T3-S3==0;
eq4 = 30+L1+T4-S4==0;
eq5 = 32.5+L1+T5-S5==0;
eq6 = 34+L1+T6-S6==0;
eq7 = 36+L1+T7-S7==0;
eq8 = 37.5+L1+T8-S8==0;
eq9 = 39+L1+T9-S9==0;
eq10 = 40+L1+T10-S10==0;
eq11 = PG1+PG2+PG3+PG4+PG5+PG6+PG7+PG8+PG9+PG10==1000;
eq12 = T1*(PG1-120)==0;
eq13 = T2*(PG2-50)==0;
eq14 = T3*(PG3-200)==0;
eq15 = T4*(PG4-400)==0;
eq16 = T5*(PG5-60)==0;
eq17 = T6*(PG6-50)==0;
eq18 = T7*(PG7-60)==0;
eq19 = T8*(PG8-100)==0;
eq20 = T9*(PG9-70)==0;
eq21 = T10*(PG10-50)==0;
eq22 = S1*PG1==0;
eq23 = S2*PG2==0;
eq24 = S3*PG3==0;
eq25 = S4*PG4==0;
eq26 = S5*PG5==0;
eq27 = S6*PG6==0;
eq28 = S7*PG7==0;
eq29 = S8*PG8==0;
eq30 = S9*PG9==0;
eq31 = S10*PG10==0;
sol = solve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18,eq19,eq20,eq21,eq22,eq23,eq24,eq25,eq26,eq27,eq28,eq29,eq30,eq31], [PG1, PG2, PG3,PG4, T1, T2, T3, T4,T5,T6,T7,T8,T9,T10,]);
PG1Sol = sol.PG1
PG2Sol = sol.PG2
PG3Sol = sol.PG3
PG4Sol = sol.PG4
PG5Sol = sol.PG5
PG6Sol = sol.PG6
PG7Sol = sol.PG7
PG8Sol = sol.PG8
PG9Sol = sol.PG9
PG10Sol = sol.PG10
L1Sol = sol.L1
T1Sol = sol.T1
T2Sol = sol.T2
T3Sol = sol.T3
T45Sol = sol.T4
T5Sol = sol.T5
T62Sol = sol.T6
T7Sol = sol.T7
T8Sol = sol.T8
T9Sol = sol.T9
T10Sol = sol.T10
S1Sol = sol.S1
S2Sol = sol.S2
S3Sol = sol.S3
S45Sol = sol.S4
S5Sol = sol.S5
S62Sol = sol.S6
S7Sol = sol.S7
S8Sol = sol.S8
S9Sol = sol.S9
S10Sol = sol.S10
3 Kommentare
Geoff Hayes
am 18 Mär. 2020
mahes85 - what solution does the above give and what is the solution that you are expecting to see? What is the above code based on? Please provide more details.
mahes85
am 23 Mär. 2020
Walter Roberson
am 23 Mär. 2020
Do not solve 31 equations for 14 variables: solve for all 31 variables.
It appears there are 100 solutions.
Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!