Problem with dsolve: Unable to find explicit solution

3 visualizzazioni (ultimi 30 giorni)
Hi everyone,
I am trying to solve the following ODE:
consider that [3] = a, [4] = b and [5] = c
I am using the following code to solve this:
answer = dsolve('Da=-k1*a + km1*b - k3*a*b','Db=k1*a - km1*b - k3*a*b','Dc=k3*a*b','a(0)=0.26','b(0)=0','c(0)=0')
However when I run this code I get the following:
Warning: Unable to find explicit solution.
> In dsolve (line 201)
In Paper2_Figure4 (line 13)
answer =
[ empty sym ]
I don't understand what I'm doing wrong, any help would be greatly appreciated! Thanks :)

Risposta accettata

Walter Roberson
Walter Roberson il 9 Nov 2020
I found a way to do this, but I will need to wait until I get to my desktop to write through all of the steps as simplify() gave some unexpected results that are not understandable as-is.
The approach is to notice that the last sub-expression of the first two equations is the same as the expression for Dc. The first two are like Da=P+Dc , Db=-P+Dc in form. Select down to those two with the sub-expression replaced by Dc and dsolve. You will get solutions for a and c.
Take the expression for c and substitute t=0 to get c(0). You will get an expression in C1, C2, and some other terms and you know that c(0)=0 so solve() the expression for C2. The result will involve b(0) but we know that b(0)=0 so subs() that to get C2.
Now subs that C2 into the solution for a. subs t=0, solve() that equal 0.26 for C1, subs b(0)=0 and you get out C1
Now go back to the solutions for a and c and substitute in C1 and C2 and b(0)=0 to get the final a and c. Do not simplify() c!!! -- you will get weird results if you do!
Those in hand, go back to the second equation giving the expression for Db and substitute a and c and derivative of c to get Db.
At this point I simplify() and the dB term disappeared, and it was then that I noticed unexpected functions in the output, which I traced back to my having simplify() after I subs C1 into c. So at the moment I do not have the final production for b, but it should be down to a single equation and b(0)=0 will clearly be important. This resolution will have to wait until I get to my desktop.
  6 Commenti
BobbyJoe
BobbyJoe il 9 Nov 2020
Thank you so much Walter!! Really appreciate it!! I am fairly new to MATLAB so when I run this code, it comes with an error:
Error using solve>getEqns (line 404)
Input argument contains an empty equation or variable.
Error in solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});
Error in test (line 34)
C1sol = solve(a0 == ic0_a, C1);
I'm not sure what I should do at this point :( But I really am grateful for all your help!
Walter Roberson
Walter Roberson il 9 Nov 2020
Ah, I assumed here that MATLAB would name the constants of integration C1 and C2, and although I can fetch the actual names using symvar, it would take me a bit more work to distinguish between them.
If I recall correctly, one of the two partials involves only the second constant (C2 here) and the other one involves both of them, so
C2var = setdiff(symvar(c_partial), [k1 km1 k3]);
C1var = setdiff(symvar(a_partial), [k1 km1 k3 C2var]);
However, I worry that your system might be returning empty from the dsolve() . Could you remind us which MATLAB release you are using?

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by