Skip to content
Advertisement

SymPy returns wrong solution of a nonlinear ODE?

I am trying to solve the ODE of the frictional free fall:

JavaScript

enter image description here

JavaScript

enter image description here

I think the solution might be wrong. I believe it should be the reciprocal of the returned expression. Therefore, if I try to find the value of the constant for an initial condition of rest (v(0) = 0), I get no real solutions:

JavaScript

enter image description here

As a consequence, if I ask SymPy to solve the ODE with the initial condition, it throws errors:

JavaScript

enter image description here

Advertisement

Answer

The sympy answer is formally correct, with v=u'/u one gets u''=u so that

JavaScript

Depending on how the constants are combined into one parameter, and what sign combination one prefers, one has

JavaScript

One can switch from one version to the other using complex factors, as the solver did

JavaScript

This is what the solver for the initial condition proposed.


What you can do is check what other solution paths are available

JavaScript

which gives a sensible solution.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement