problem using solve

2 views (last 30 days)
michael golinski
michael golinski on 17 Sep 2011
Trying to find equilibrium solutions for a simple ODE system using matlab 7.10. The following commands were entered (commands based on earlier versions of matlab) with errors messages included:
dn1 = 'r*n1*(k-n1)/k-c*(1-exp(-a*n1/c))*n2'
dn2 = 'b*c*(1-exp(-a*n1/c))*n2-d*n2'
[n1hat,n2hat] = solve(dn1,dn2,'n1,n2') ??? Error using ==> mupadmex Error in MuPAD command: Division by zero [_power]; during evaluation of 'ff'
Error in ==> sym.sym>sym.mupadmexnout at 2003 out = mupadmex(fcn,args{:});
Error in ==> solve at 76 [symvars,R] = mupadmexnout('mllib::solvefull',eqns,vars);
Any suggestions?

Answers (1)

Walter Roberson
Walter Roberson on 17 Sep 2011
Try
[n1hat,n2hat] = solve(dn1,dn2,'n1', 'n2')
with the two variables to solve for separated.
  2 Comments
michael golinski
michael golinski on 17 Sep 2011
nope, still get the same error message:
Error using ==> mupadmex
Error in MuPAD command: Division by zero [_power];
during evaluation of 'ff'
Error in ==> sym.sym>sym.mupadmexnout at 2003
out = mupadmex(fcn,args{:});
Error in ==> solve at 76
[symvars,R] = mupadmexnout('mllib::solvefull',eqns,vars);
Walter Roberson
Walter Roberson on 19 Sep 2011
I don't know. This appears to be something specific to MuPAD, and possibly even to the MuPAD version. The solution set is:
n1 = 0, n2 = 0
n1 = k, n2 = 0
n1 = -ln((b*c-d)/(b*c))*c/a, n2 = -r*ln((b*c-d)/(b*c))*c*b*(k*a+ln((b*c-d)/(b*c))*c)/(k*d*a^2)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!