modelon-community / Assimulo

Assimulo is a simulation package for solving ordinary differential equations.
https://jmodelica.org/assimulo/index.html
GNU Lesser General Public License v3.0
66 stars 16 forks source link

Removed all scipy references in cvode_gyro.py #65

Closed modelonrobinandersson closed 11 months ago

modelonrobinandersson commented 11 months ago

After I created the tag 3.4.2 I discovered further references to scipy functions that did not work with 1.10.1. This should be the last set of changes as the example works for me locally.

I also fixed some formatting issues and removed the function energi as it was not even used in the example. I will have to release Assimulo 3.4.3 after this.

In [1]: import scipy

In [2]: scipy.__version__
Out[2]: '1.10.1'

In [3]: from assimulo.examples import cvode_gyro

In [4]: cvode_gyro.run_example()
Final Run Statistics: Gyroscope Example

 Number of steps                                 : 3296
 Number of function evaluations                  : 3408
 Number of Jacobian evaluations                  : 55
 Number of function eval. due to Jacobian eval.  : 660
 Number of error test failures                   : 0
 Number of nonlinear iterations                  : 3404
 Number of nonlinear convergence failures        : 0

Solver options:

 Solver                   : CVode
 Linear multistep method  : BDF
 Nonlinear solver         : Newton
 Linear solver type       : DENSE
 Maximal order            : 2
 Tolerances (absolute)    : 1e-10
 Tolerances (relative)    : 1e-10

Simulation interval    : 0.0 - 0.1 seconds.
Elapsed simulation time: 0.25140339999779826 seconds.