Unable to find explicit solution to differential eq
이전 댓글 표시
Hi there!
Pardon me, I'm new to differential equations and particularly in MATLAB, and I have stumbled upon an error that I don't understand the reasoning behind.
I'm getting the error "Warning: Unable to find explicit solution."
kp = 2*10^7;
km = 0.27*10^-4;
syms x(t) x2(t);
ode1 = diff(x,t) == 2*km*x2(t) - 2*kp*x(t)^2;
ode2 = diff(x2,t) == -km*x2(t) + kp*x(t)^2;
odes = [ode1, ode2];
cond1 = x(0) == 10^-9;
cond2 = x2(0) == 0;
conds = [cond1, cond2];
S = dsolve(odes,conds)
It works fine whenever i remove the squaring of x(t) in both differential equations.
Is this caused by some inner workings of the dsolve function?
댓글 수: 6
John D'Errico
2019년 2월 27일
편집: John D'Errico
2019년 2월 27일
And you know that an analytical solution exists? When you remove the squares, the system is now linear, so a solution is trivial.
Torsten
2019년 2월 27일
Note that
diff(x,t)+2*diff(x2,t)=0,
thus
x(t)+2*x2(t)=x(0)+2*x2(0)=1e-9
and so
x2(t)=5e-10-0.5*x(t).
Insert this expression in one of the differential equation and solve by separation of variables.
Ditlev Bornebusch
2019년 3월 1일
편집: Ditlev Bornebusch
2019년 3월 1일
Mathematica for instance has no issues with this.
I'm willing to bet that you haven't entered the same ODE in both Matlab and Mathematica. As a test, you could take the solution returned by Mathematica and plug it into the ODE as implemented in Matlab to see if the equations (as implemented in Matlab) are satisfied.
Walter Roberson
2019년 3월 1일
Remember that Mathematics converts floating point constants a different way that MATLAB does.
Walter Roberson
2019년 3월 2일
If you switch the numeric values into symbolic constants then it turns out there is a series of four analytic solutions.... that are quite long. Roots of a quartic are involved, multiple times. One of the shorter ways to write the expressions involve tanh(); it is also possible to rewrite the tanh() in terms of log() of a complex (and complicated) expression. Or you can rewrite in terms of exponentials, but that gets rather long. I gave up trying to simplfy the expressions.
I suspect that if you were processing the same expressions that Mathematica would probably be willing to produce an answer, but that the answer would not be simple at all.
These kinds of systems are beyond the abilities of MATLAB.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!