3 sequential equations doesn't solve.. some help plz

the three equations are on the image
for this I wrote the following code:
>> syms vth vs id
>> eq1=-vth+0.5+0.4*((0.6+vs)^0.5-0.6^0.5);
>> eq2=-id+0.5*9*10^-4*(2.5-vs-vth)^2;
>> eq3=-vs+2*1000*id;
>> S=solve(eq1,eq2,eq3,vth,vs,id)
but there comes the error:
*??? Error using ==> mupadmex Error in MuPAD command: symbolic parameters not allowed in non-polynomial equations [numeric::solve]
Error in ==> sym.sym>sym.mupadmexnout at 2003 out = mupadmex(fcn,args{:});
Error in ==> solve at 76 [symvars,R] = mupadmexnout('mllib::solvefull',eqns,vars);*
--> i don't know what i've done wrong. my MATLAB version is 7.10.0(R2010a)
p.s. as for the code, I was trying to get a matrix S which contains the solutions of the three equations and I would've obtained the individual solutions by S.vth, S.id, S.vs
anyway... whats the problem here???

 采纳的回答

There are two solutions,
id = 0.173281035908099e-2, vs = 3.46562071816199, vth = .996696709643063
id = 0.426827703050411e-3, vs = .853655406100821, vth = .672431863201621
As to the problem: it appears to me you might have hit a limitation in your version of MuPAD. The square roots seem to be throwing it off. I do not have MuPAD to test with, so I do not know if there is a symbolic work-around.

1 个评论

thanks for doing the calculation for me ^^ i think you're right there's something wrong with my mupad or something..
but i eventually found out a way to solve this by directly using the mupad toolbox. Still don't understand why my MATLAB's Mupad properly doesn't work though

请先登录,再进行评论。

更多回答(1 个)

chul hyun kwag
chul hyun kwag 2012-10-24
编辑:chul hyun kwag 2012-10-24
For anyone who is stuck with a similar problem with me, here's how I eventually got over this error. As Roberson answered, I guess there is something wrong with my license or MATLAB program but here's my way of doing it anyway:
1. Click the 'Start' button on the bottom left corner
2. Start-Toolboxes-Symbolic Math-MuPAD
3. Click 'New Notebook' in order to type in code
4. you'll get a blank notebook
5. then I typed in a "solve()" function. the code is as follows: >>solve([-x+0.5+0.4*((0.6+y)^0.5-0.6^0.5)=0,-z+0.5*9*10^-4*(2.5-y-x)^2=0,-y+2*1000*z=0],[x,y,z])
**the codes appear in red. make sure to write in the line with the grey colored '['.
I'm not that good with this MuPAD so i typed in every equation by hand. In MuPAD, it seems that you can't use solve() like solve(eq1,eq2,eq3,var1,var2,var3). Instead do it like: solve([eq1=0,eq2=0,eq3=0],[x,y,z]) . Just like a matrix. that's what I've done.

1 个评论

>> syms x y z
eq1 = -x+0.5+0.4*((0.6+y)^0.5-0.6^0.5);
eq2 = -z+0.5*9*10^-4*(2.5-y-x)^2;
eq3 = -y+2*1000*z;
roots1 = solve(eq1,eq2,eq3,x, y, z)
roots1 =
x: [4x1 sym]
y: [4x1 sym]
z: [4x1 sym]

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by