Skip to content
Advertisement

Sympy gives a residual value when trying to solve the logistics equation

If I try solving the logistics differential equation in Sympy I get a residual value (10^(-13)) which prevents sympy from getting the correct values for the initial coditions. If I run this code:

JavaScript

import sympy as sp

JavaScript

I get:

JavaScript

How can one get rid of these residuals in the solution?

Advertisement

Answer

Either don’t use Float (use a = Rational(3, 100)) or if you know you want those 1e-13 magnitude numbers to be 0 then you can replace them with 0:

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