Using odesolver when one function is non ode
3 views (last 30 days)
Show older comments
Hi All,
First time posting here. I have the code pasted below to solve a system of 3 ordinary differential equations that depend on a 4th function which is not differential. When I plug it into dsolve I get the error pasted below. I tried to find the diff() of D and then use the dsolve but that still did not work. Can anyone provide a suggestion? Thanks for any help.
syms T(t) N(t) L(t) D(t) a b c d f g h o k m p q r alph sig lamb
d = dsolve(diff(T) == a*T*(1-b*T)-c*N*T - D,...
diff(N) == sig - f*N + ((g*T^2)/(h + T^2))*N - p*N*T,...
diff(L) == -m*L + ((o*D^2)/(k+D^2))*L + q*L*T + r*N*T,...
D == d*(((L/T)^lamb)/(s+(L/T)^lamb))*T);
>> Untitled
Warning: The number of equations exceeds the number of indeterminates. Trying
heuristics to reduce to square system. [ode::solve_intern]
Error using mupadengine/feval (line 157)
MuPAD error: Error: Cannot reduce to the square system because the number of
equations differs from the number of indeterminates. [ode::solve_intern]
Error in dsolve>mupadDsolve (line 328)
T = feval(symengine,'symobj::dsolve',sys,x,options);
Error in dsolve (line 189)
sol = mupadDsolve(args, options);
Error in Untitled (line 4)
d = dsolve(diff(T) == a*T*(1-b*T)-c*N*T - D,...
1 Comment
Answers (1)
Walter Roberson
on 20 Jan 2017
If you have differential equations that depend upon a non-differential equation, then you need to substitute the meaning of the non-differential equation in before you do the dsolve(), using only the differential equations in the dsolve(). For example,
syms T(t) N(t) L(t) D(t) a b c d f g h o k m p q r s alph sig lamb
D(t) = d*(((L/T)^lamb)/(s+(L/T)^lamb))*T
dsolve(diff(T) == a*T*(1-b*T)-c*N*T - D,...
diff(N) == sig - f*N + ((g*T^2)/(h + T^2))*N - p*N*T,...
diff(L) == -m*L + ((o*D^2)/(k+D^2))*L + q*L*T + r*N*T)
This particular expression has no solution as far as MATLAB is concerned. Note, though, that you have d = dsolve() but your expression of D involves d, so you sort of look like you are defining to be simultaneously a set of three equations and what appears to be a simple variable.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!