Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have three coupled second order ODE's given as below

$x''[t] = -c_1*y'[t]-c_2*z[t]-c_3$
$y''[t] = -c_4*x'[t]$
$z''[t] = \frac{c_5}{c_6}*x[t]-c_6$

where $c_i$'s are know constants. The boundary conditions are

$x[-1]=x[1]=y[-1]=y[1]=z'[-1]=z'[1]=0$.

I followed the example given here How do I solve coupled ordinary differential equations?

{x, y, z} = {x, y, z} /. 
        Dsolve[{x''[t] == -c1*y'[t] - c2*z[t] - c3, y''[t] == -c4*x'[t], 
          z''[t] == -c5 + c5*x[t]/c6, x[-1] == 0, x[1] == 0, y[-1] == 0, 
          y[1] == 0, z'[-1] == 0, z'[1] == 0}, {x, y, z}, t] // 
       FullySimplify // First

I get the following output

ReplaceAll::reps: {Dsolve[{x''[t] == -c3 - c2 z[t] - c1 y'[t], <<8>>}, {x, y, z}, t]}
 is neither a list of replacement rules nor a valid dispatch table, and 
 so cannot be used for replacing.

Set::shape: Lists {x, y, z} and {x, y, z} /. Dsolve[{x''[t] == 
-c3 - c2 z[t] - c1 y'[t], <<8>>}, {x, y, z}, t] are not the same shape.

Could someone please tell me what is wrong with my approach and please suggest me how to solve this system.
Thank you for your time

share|improve this question
1  
You have a typo in there. Try DSolve instead of Dsolve. –  Thies Heidecke Nov 12 '12 at 23:15
    
And FullSimplify instead of FullySimplify. –  David Skulsky Nov 12 '12 at 23:21
    
I just noticed another problem: the equation implemented for z''[t] is not the same as the equation listed at the beginning of the question. –  David Skulsky Nov 13 '12 at 0:50
    
I think {x, y, z} should be {x[t], y[t], z[t]} and I'd be inclined to apply First before FullSimplify. –  m_goldberg Nov 13 '12 at 1:55
add comment

1 Answer

As already pointed out the functions you use are misspelled. It's DSolve and FullSimplify. But even if your input is correct, it seems Mathematica cannot solve your problem without knowing your constants.

Choosing your constants to be 1, Mathematica is able to compute an analytic solution after a while

deq = {x''[t] == -c1*y'[t] - c2*z[t] - c3, y''[t] == -c4*x'[t], 
   z''[t] == -c5 + c5*x[t]/c6, x[-1] == 0, x[1] == 0, y[-1] == 0, 
   y[1] == 0, z'[-1] == 0, z'[1] == 0} /. 
  Thread[Rule[{c1, c2, c3, c4, c5, c6}, ConstantArray[1, 6]]];

DSolve[deq, {x, y, z}, t]

The computation of the general solution is running now for some minutes but I'm pessimistic that it will one.

share|improve this answer
    
I would think that c6, in particular, would pose a serious problem for DSolve. At a minimum, the OP might want to specify that c6 != 0. –  David Skulsky Nov 13 '12 at 0:47
    
Thank you for all the replies, I really appreciate your help. I corrected the mistakes and also made all the constants to be 1. I tried several times solving it and mathematica exited after some time. I trying one more time now. With the knowledge I have I don't see any anomalies with the equations and boundary conditions. –  Nawin Nov 13 '12 at 0:57
    
I can confirm that Mathematica will yield a solution when c1, ..., c6 are exactly 1 (and with the code for z''[t] consistent with the equation at the top of the question), but the result is extremely large and not particularly useful. If you replace c1, ..., c6 with 1., you will quickly get a result which shows the structure of the solution and it ain't pretty (46th order polynomials in t). –  David Skulsky Nov 13 '12 at 1:31
    
You should also be careful with FullSimplify. From the documentation: "For fairly small expressions, FullSimplify will often succeed in making some remarkable simplifications. But for larger expressions, it can become unmanageably slow. The reason for this is that to do its job, FullSimplify effectively has to try combining every part of an expression with every other, and for large expressions the number of cases that it has to consider can be astronomically large." –  David Skulsky Nov 13 '12 at 1:35
    
Ooops 46th order polynomial :). So looks like there is no simple solution to this problem. Now I am not sure even if I solve this system numerically whether I get a better solution or not. –  Nawin Nov 13 '12 at 2:05
add comment

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.