Trying to solve 4 equations in matlab!
Trying to solve 4 equations in matlab!
(OP)
Hi I am trying to solve the following equations using Matlab for C1, C2, C3 and C4. In real fact I only require C1.
C1-C2-C3-1=0
n*C2+C3/n+(d-1)*C4=0
C1+b*C2-b*C3-1=0
b*n*C2-b*C3/n-C4(1+d)=0
This is what I have input in Matlab but it seems its getting stuck because of the symbolic expresssion??
Any help please?
syms C1 C2 C3 C4 g L g_0 dL
n=exp(-g*L)
d=exp(-2*g_0*dL)
solve(C1-C2-C3-1, n*C2+C3/n+(d-1)*C4, C1+b*C2-b*C3-1, b*n*C2-b*C3/n-C4(1+d), C1)
C1-C2-C3-1=0
n*C2+C3/n+(d-1)*C4=0
C1+b*C2-b*C3-1=0
b*n*C2-b*C3/n-C4(1+d)=0
This is what I have input in Matlab but it seems its getting stuck because of the symbolic expresssion??
Any help please?
syms C1 C2 C3 C4 g L g_0 dL
n=exp(-g*L)
d=exp(-2*g_0*dL)
solve(C1-C2-C3-1, n*C2+C3/n+(d-1)*C4, C1+b*C2-b*C3-1, b*n*C2-b*C3/n-C4(1+d), C1)





RE: Trying to solve 4 equations in matlab!
Cheers
Greg Locock
New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?
RE: Trying to solve 4 equations in matlab!
"Simplicity is the ultimate sophistication." L. da Vinci
- Gian
RE: Trying to solve 4 equations in matlab!
"Simplicity is the ultimate sophistication." L. da Vinci
- Gian
RE: Trying to solve 4 equations in matlab!
RE: Trying to solve 4 equations in matlab!
"Simplicity is the ultimate sophistication." L. da Vinci
- Gian
RE: Trying to solve 4 equations in matlab!
CODE -->
> B := solve({n*C2+C3/n+(d-1)*C4 = 0, b*n*C2-C3/n-(1+d)*C4 = 0, C1-C2-C3-1 = 0, C1+b*C2-b*C3-1 = 0}); print(`output redirected...`); # input placeholder / | 2 b C3 + 1 + b C3 (-1 + b) < C1 = --------------, C2 = -----------, C3 = C3, | 1 + b 1 + b \ 1 1 C4 = - n C3 b - - n C3, b = b, 2 2 2 2 2 2 \ -2 b + b n - 2 b n - 2 + n | d = ------------------------------, n = n >, 2 | n (-1 + b) (1 + b) / {C1 = 1, C2 = 0, C3 = 0, C4 = 0, b = b, d = d, n = n} >"Simplicity is the ultimate sophistication." L. da Vinci
- Gian
RE: Trying to solve 4 equations in matlab!
"Simplicity is the ultimate sophistication." L. da Vinci
- Gian
RE: Trying to solve 4 equations in matlab!
RE: Trying to solve 4 equations in matlab!
"Simplicity is the ultimate sophistication." L. da Vinci
- Gian
RE: Trying to solve 4 equations in matlab!
RE: Trying to solve 4 equations in matlab!
All you need to do it tell it which ones are vars. ...
CODE -->
Q= solve('C1-C2-C3-1','n*C2+C3/n+(d-1)*C4','C1+b*C2-b*C3-1','b*n*C2-b*C3/n-C4(1+d)','C1','C2','C3','C4'); Q.C1"Simplicity is the ultimate sophistication." L. da Vinci
- Gian