Group Abstract Group Abstract

Message Boards Message Boards

[?] Solve the following system of differential equations with DSolve?

Posted 6 years ago

Hi, I want to solve following system of differential equations

sola = DSolve[{x5'[t] == -b, x1'[t] == x2[t], 
   x2'[t] == (k*b*Cos[fi])/x5[t], x3'[t] == x4[t], 
   x4'[t] == k*b*Sin[fi]/x5[t] - g, x1[0] == 0, x2[0] == 0, 
   x3[0] == 0, x4[0] == 0, x5[0] == m0}, {x1[t], x2[t], x3[t], x4[t], 
   x5[t]}, t]

Gives following output:

{{x5[t] -> m0 - b t, 
  x2[t] -> k Cos[fi] Log[-m0] - k Cos[fi] Log[-m0 + b t], 
  x1[t] -> (
   b k t Cos[fi] - k m0 Cos[fi] Log[-m0] + b k t Cos[fi] Log[-m0] + 
    k m0 Cos[fi] Log[-m0 + b t] - b k t Cos[fi] Log[-m0 + b t])/b, 
  x4[t] -> -g t + k Log[-m0] Sin[fi] - k Log[-m0 + b t] Sin[fi], 
  x3[t] -> (-b g t^2 + 2 b k t Sin[fi] - 2 k m0 Log[-m0] Sin[fi] + 
    2 b k t Log[-m0] Sin[fi] + 2 k m0 Log[-m0 + b t] Sin[fi] - 
    2 b k t Log[-m0 + b t] Sin[fi])/(2 b)}}

but there is a mistake in the Log[-m0], there should be a +m0. How can I thread this?

POSTED BY: František Prinz
4 Replies
Posted 6 years ago

Or more generally

result // ComplexExpand @* Re
POSTED BY: Rohit Namjoshi

The only solution of my problem I found is to delete the imaginary terms in the outputs and then make further calculations with it, which is not convenient. (I had to do it by hand, Functions like Re[] unfortunately did not help).

Try

result /. Complex[0,1]->0
POSTED BY: Hans Dolhaine
POSTED BY: František Prinz
POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard