dsolve Warning: Unable to find explicit solution.

Hello all,
I hope you can help me.
I solve this ODE (till now without delay)
Conclusion: Warning: Unable to find explicit solution.
solution =
[ empty sym ]
My code:
a = 1000;
b = 0.5;
c = 0.8;
d = 10;
e = 0.5;
f = 0.17;
g = 0.1;
r = 0.17;
C0 = 1;
equation1 = 'DV = b*V-c*F*V';
equation2 = 'DC = a*F*V-e*(C - C0)';
equation3 = 'DF = r*C - f*F-n*c*V*F';
equation4 = 'Dm = r*V-g*m';
solution = dsolve(equation1, equation2, equation3, equation4,'V(0)=-0.0255/83','C(0)=81.8/132.8','F(0)=0.625','m(0)=-0.255/16.6','t'); %reseni.y1
%solution.V
%solution.C
%solution.F
%solution.m
hold on
fplot(@(equation1)equation1,[0,30],'r');
fplot(@(equation2)equation2,[0,30],'b');
fplot(@(equation3)equation3,[0,30],'g');
fplot(@(equation4)equation4,[0,30],'y');
%axis([0,30,0,10]);
legend('Antigen dynamics','Plasma cell dynamics', 'Antibody dynamics', 'Relative damage');
title('Simulation of the sub clinical disease');
xlabel('Time [days]');
ylabel('Concentration')
hold off
THANKS IN ADVANCE FOR ANY HELP!

Risposte (2)

Any time you use a character vector as an equation, any variables you assigned to (such as b) will not be substituted in -- not unless you use a sufficiently old version and you use subs() . [Current versions cannot subs() into character vectors.]
a = 1000;
b = 0.5;
c = 0.8;
d = 10;
e = 0.5;
f = 0.17;
g = 0.1;
r = 0.17;
C0 = 1;
syms V(t) C(t) F(t) m(t)
DV = diff(V); DC = diff(C); DF = diff(F); Dm = diff(m);
equation1 = DV == b*V-c*F*V;
equation2 = DC == a*F*V-e*(C - C0);
equation3 = DF == r*C - f*F-n*c*V*F;
equation4 = Dm == r*V-g*m;
ic1 = V(0) == -0.0255/83;
ic2 = C(0) == 81.8/132.8;
ic3 = F(0) == 0.625;
ic4 = m(0) == -0.255/16.6;
solution = dsolve([equation1, equation2, equation3, equation4, ic1, ic2, ic3, ic4]); %reseni.y1
However MATLAB is not able to find a solution to this.
When you examine the equations, the ones for V C F do not involve m, so you can isolate those ones and try to solve them. However MATLAB is still not able to solve that set. When I use a different package (Maple) I find that Maple is able to solve those equations with those boundary conditions if you remove the condition for V(0) -- because it turns out that the only closed-form solution that it can find for those equations is the case where V(t) = 0 identically.
I cannot say for sure there are no equations when V(0) is non-zero, but neither MATLAB nor Maple are able to find such equations. This means to to proceed you would need to switch to numeric form.

1 Commento

Hi Walter,
thank you very much for your response and your advice. You have right, I have to adjust parameters and then it may work.
However, thank you very much for your help once again. I appreciate any answer.
Marie

Accedi per commentare.

Star Strider
Star Strider il 28 Ago 2019
Modificato: Star Strider il 28 Ago 2019
@Marie — I was working on the numeric solution to your system when you deleted your earlier Question. Until now, I didn’t see that you had re-posted it.
Try this:
syms C(t) F(t) m(t) V(t) t Y
DC = diff(C);
DF = diff(F);
Dm = diff(m);
DV = diff(V);
a = 1000;
b = 0.5;
c = 0.8;
d = 10;
e = 0.5;
f = 0.17;
g = 0.1;
n = 0.42; % <— PROVIDE CORRECT VALUE
r = 0.17;
C0 = 1;
equation1 = DV == b*V-c*F*V;
equation2 = DC == a*F*V-e*(C - C0);
equation3 = DF == r*C - f*F-n*c*V*F;
equation4 = Dm == r*V-g*m;
[VF,Sbs] = odeToVectorField(equation1, equation2, equation3, equation4)
odefcn = matlabFunction(VF, 'Vars',{t,Y})
tv = linspace(0,30, 31);
ics = [81.8/132.8, -0.0255/83, 0.625, -0.255/16.6];
[T,Y] = ode45(odefcn, tv, ics);
figure
plot(T, Y)
grid
lgdstr = sprintfc('%s', Sbs);
legend(lgdstr, 'Location','W')
title('Simulation of the sub clinical disease');
xlabel('Time [days]');
ylabel('Concentration')
dsolve Warning - Unable to find explicit solution.png

5 Commenti

Hi Star Strider,
sorry for that. I noticed mistakes, so I needed to upload my question again.
Thank you for your answer, that is awesome! I just adjusted parameters and it works perfectly.
I hope it is not daring, but are you able to add stochastic part with Brownian motion to that system (as on the picture below)?
Výstřižek2.PNG
Thank you once again.
Marie
The ode*() solvers are only able to handle systems that are differentiable twice beyond the equations you pass. The routines might not notice a problem in the second differentiation (Hessian) but they do tend to notice a problem in the first order gradient estimate.
Because of this, it is necessary to stop the ode*() routine every time there is a discontinuity (because Stochastic changes) and restart with the new values.
My pleasure.
I have not done anything with stochastic differential equations in a very long time, and never with MATLAB. I looked on Answers and did an Interweb search, and I was able to find the SDE Toolbox although I have never used it and know nothing about it (note that it was written in 2007, so I do not know how well it would work with current MATLAB reseases). The Financial Toolbox has some SDE functions, however I do not have it so have no experience with it or its functions.
Sorry. I cannot help you with the SDE.
Never mind. I will try to ask others because I get only errors (I am able to get stochastic motion but not in connection with this system)
Anyway, thank you so much for all.
My pleasure.
The reference I found (‘Lecture 21: Stochastic Differential Equations’) that discusses numerical integration states with respect to numerical integration techniques ‘This method cannot be directly applied to solve SDEs. This is because in SDEs, the equation corresponding to (2.1) involves random variables.’ So apparently, SDEs are not an option with numerical techniques, at least the solvers MATLAB uses. Walter’s Comment appears to agree.

Accedi per commentare.

Categorie

Scopri di più su Programming in Centro assistenza e File Exchange

Prodotti

Release

R2018a

Tag

Richiesto:

il 28 Ago 2019

Commentato:

il 29 Ago 2019

Community Treasure Hunt

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

Start Hunting!

Translated by