Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm solving simple but coupled ODEs recently. I use both MATLAB symbolic computation and Mathematica.

For example, my coupled ODE is the following \begin{align*} &\dot{x}(t)=y(t)-\rho b\frac{x(t)}{1-\rho(1-e^{-t})}\\ &\dot{y}(t)=-y(t)+\rho b\frac{x(t)}{1-\rho(1-e^{-t})}\\ \end{align*} where $\rho\in(0,1)$ and $b\in(0,1)$ are given constants and the initial value of this set of ODEs are $x(0)=a$, there $a\in(0,1)$ and $y(0)=0$.

This expression looks simple but these 2 equations are coupled.

First, I tried MATLAB, it generate "Warning: Explicit solution could not be found." explicitly.

Then I tried Mathematica,

system = {x'[t] == y[t] - c1*c2*x[t]/(1 - c1*(1 - Exp[-t])), 
   y'[t] == -y[t] + c1*c2*x[t]/(1 - c1*(1 - Exp[-t]))};

Then I try to solve it via sol = DSolve[system, {x, y}, t].

The thing that I don't understand is that after I press Shift+Enter, Mathematica only makes my input look nicer, but didn't produce any result or generating any warning message like MATLAB. So I couldn't tell whether it is because Mathematica also couldn't find the analytical solution like MATLAB, or it just does not even try to solve the problem since I input something wrong?

This simple coupled ODE drives me crazy these days. Any suggestion, input is deeply appreciated.

If math software couldn't find analytical solution, then is it still possible to analyze the monotonicity of the solution? For example, in this case, it's easy to analyze the case when $t=\infty$ by setting $\dot{x}=0=\dot{y}$ and solve the equations. I can also numerically plot the solution to see the trend, e.g., $x(t)$ is decreasing. But without the explicit functional form of $x(t)$, how can we prove the monotonicity, stuff like that? In general, if the math software fails to find analytical solution, what should we do next?

share|improve this question
3  
The answer to "Does it mean that there no anlytical solution if Mathematica cannot find analytical solution?" is definitely no (i.e. there are definitely analytic solutions that Mathematica can't find for all kinds of things). However, those differential equations seem complicated enough that there could easily not be an analytic solution. – march Mar 25 at 16:32
    
Even if you are unable to derive a closed form solution to your DE, it might still be possible to study the qualitative behavior of the solutions. Have a look at Bender/Orszag for ideas. – J. M. Mar 25 at 16:35
    
@J.M. Is that book "Advanced Mathematical Methods for Scientists and Engineer"? – KevinKim Mar 25 at 16:38
1  
It's interesting to note that $\dot{x}(t) + \dot{y}(t) = 0$. – rcollyer Mar 25 at 16:43
2  
Well, it has the form $\dot{\vec{x}}(t) = \mathbf{A}(t) \vec{x}(t)$, so you could try diagonalizing $\mathbf{A}$ to decouple the two equations. – rcollyer Mar 25 at 17:00

Here, we take advantage of the observation mentioned in a comment that the sum of x and y is conserved. If we define

s[t] == x[t] + y[t]
d[t] == x[t] - y[t]

your differential equations become

eqns = {s'[t] == 0,
        d'[t] == -(1 + (r b)/(1 - (1 - E^-t) r)) d[t] + (1 - (r b)/(1 - (1 - E^-t) r)) s[t]}

Mathematica knows how to solve this:

First@DSolve[eqns, {s[t], d[t]}, t]

enter image description here

share|improve this answer

As noted in the comments above, you have $\dot{x} + \dot{y} = 0$, which implies that $x(t) + y(t)$ is a constant; call it $c_3$. (Note that in particular, $c_3 = x(0) + y(0)$.) You can therefore replace y[t] with c3 - x[t] in your first equation above, and Mathematica can solve that explicitly:

reducedsystem = {x'[t] == c3 - x[t] - c1*c2*x[t]/(1 - c1*(1 - Exp[-t]))}
DSolve[reducedsystem, x[t], t]

(* {{x[t] -> -((c3 E^(-t + (c1 c2 Log[-c1 - E^t + c1 E^t])/(-1 + c1)) (-E^t + c1 (-1 + E^t))^(1 - (c1 c2)/(-1 + c1)))/(1 + c1 (-1 + c2))) 
               + E^(-t + (c1 c2 Log[-c1 - E^t + c1 E^t])/(-1 + c1)) C[1]}} *)

I'm a little surprised that Mathematica can't do this on its own, to be honest; but here we are.

share|improve this answer
    
Thanks! This looks great! – KevinKim Mar 25 at 17:41
    
Wait, but now don't we have an unknown c3 in our solution? Meaning, x[t] is now expressed in terms of a y[t] that we still don't know what it is. – MathX Mar 25 at 18:39
    
$c_3$ can be determined from the initial conditions: since it's a constant, then $c_3 = x(0) + y(0)$. I've edited to clarify this. In general, you'll have two constants of integration for this system; in my solution, they'll be the $c_3$ I coded in and the C[1] generated by Mathematica in the solution. – Michael Seifert Mar 25 at 18:40
    
oh yes you are right. And in that case it is equal to a from the OP. – MathX Mar 25 at 18:48

The non-trivial solution for this system can be obtained by doing this:

system = {x'[t] == y[t] - c1*c2*x[t]/(1 - c1*(1 - Exp[-t])), 
   y'[t] == -y[t] + c1*c2*x[t]/(1 - c1*(1 - Exp[-t]))};

DSolve[First[system /. y -> (-x[#] &)], x[t], t]

(*
==> {{x[t] -> 
   E^(-t + (c1 c2 Log[-c1 - E^t + c1 E^t])/(-1 + c1)) C[1]}}
*)

All I did here is use the fact that the equations become identical if $y=-x$. That allows us to drop one of the equations.

share|improve this answer
    
As I noted in my comment above, the syntax of the input in the OP is incorrect. Mathematica will interpret exp(-t) as the product of a constant called exp with -t. – Michael Seifert Mar 25 at 17:10
    
@Jens This one looks awesome! Let me try to understand the syntax "DSolve[First[system /. y -> (-x[#] &)], x[t], t]" – KevinKim Mar 25 at 17:15
    
@MichaelSeifert oh yes, of course I used the corrected version to get the posted result - just copied the OP's error accidentally. – Jens Mar 25 at 17:49
    
@KevinKim the replacement y -> (-x[#] &) sets the function y equal to the function -x. You can't just use y -> -x here because that won't work in the derivative. Hence the more complex notation. & declares an (anonymous) function and # is the variable placeholder. – Jens Mar 25 at 17:57
    
@Jens: Are you sure that you used the corrected code to get your posted result? Your posted result has exp in it, including in the denominator without an argument. Also, note that $\dot{x} + \dot{y} = 0$ does not imply that $y = -x$; there should be an arbitrary constant involved. – Michael Seifert Mar 25 at 18:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.