euler_with_disc.py

assimulo.examples.euler_with_disc.run_example(with_plots=True)[source]

Example of the use of Euler’s method for a differential equation with a discontinuity (state event) and the need for an event iteration.

on return:

  • exp_mod problem instance
  • exp_sim solver instance

The current solver does not support interpolated output. Setting ncp to 0 and ncp_list to None and continues.
No initialization defined for the problem.
A discontinuity occured at t = 1.000000e+00.
Current switches: [False, True, True]
Event info: [array([ 0,  0, -1]), False]
Final Run Statistics: ODE with discontinuities and a function with consistency problem 

 Number of state function evaluations  : 112
 Number of state events                : 1

Solver options:

 Solver            : ExplicitEuler
 Solver type       : fixed step size
 Step size         : 0.01

No finalization defined for the problem.
Final Run Statistics: ODE with discontinuities and a function with consistency problem 

 Number of state function evaluations  : 1013
 Number of state events                : 1

Solver options:

 Solver            : ExplicitEuler
 Solver type       : fixed step size
 Step size         : 0.01

Simulation interval    : 0.0 - 10.0 seconds.
Elapsed simulation time: 0.0490050315857 seconds.
_images/euler_with_disc.png

Note

Press [source] (to the top right) to view the example.