solving system of equaitons

I need to solve three equations and three unknowns (three forces, F_)so I can plot the forces.
d=[0:50];
P=40,000;
syms F_ab F_cd F_fg
solve(F_ab+F_cd+F_fg==-P) %equation 1
solve(10*F_ab+28*F_cd+40*F_fg==-d*P) %equation 2
solve(144*F_ab-240*F_cd+180*F_fg==0) %equation 3
plot(d,F_ab,'k',d,F_cd,'r',d,F_fg,'b')
The code is not solving anything... please help.

 Accepted Answer

for d=0:50
P=40,000;
syms F_ab F_cd F_fg
sol=solve(F_ab+F_cd+F_fg+P,10*F_ab+28*F_cd+40*F_fg+d*P,144*F_ab-240*F_cd+180*F_fg);
s1(d+1)=double(subs(sol.F_ab));
s2(d+1)=double(subs(sol.F_cd));
s3(d+1)=double(subs(sol.F_fg));
end
d=0:50
plot(d,s1,'k',d,s2,'r',d,s3,'b')

1 Comment

Juhui Thorn
Juhui Thorn on 1 Feb 2013
Edited: Juhui Thorn on 1 Feb 2013
Thank you! It works!!! But why do you need a (d+1)?

Sign in to comment.

More Answers (0)

Categories

Find more on Linear Algebra 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!