Using odesolver when one function is non ode

조회 수: 7 (최근 30일)
Jonathan
Jonathan 2014년 2월 28일
답변: Walter Roberson 2017년 1월 20일
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
herney12
herney12 2017년 1월 20일
Hi jonathan
Can you solve the problem? The same happens to me

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2017년 1월 20일
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.

카테고리

Help CenterFile Exchange에서 Equation Solving에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by