Modified version of DASSL for solving overdetermined systems of (singularily) implicit ODEs. The main difference to DASSL is in the corrector iteration part.
ODASSL ad-ons : FUEHRER, CLAUS
DEUTSCHE FORSCHUNGSANSTALT
FUER LUFT- UND RAUMFAHRT (DLR)
INST. DYNAMIC DER FLUGSYSTEME
D-8031 WESSLING (F.R.G)
Based on DASSL version dated to 900103 by:
DASSL-Author: PETZOLD, LINDA
APPLIED MATHEMATICS DIVISION 8331
SANDIA NATIONAL LABORATORIES
LIVERMORE, CA. 94550
Import the solver together with the correct problem:
from assimulo.solvers import ODASSL
from assimulo.problem import Overdetermined_Problem
Define the problem, such as:
def res(t, y, yd): #Note that y and yd are 1-D numpy arrays.
res = [yd[0]-1.0, y[0]-1.0]
return N.array([res]) #Note that the return must be numpy array, NOT a scalar.
y0 = [1.0]
yd0 = [1.0]
t0 = 1.0
Create a problem instance:
mod = Overdetermined_Problem(res, y0, yd0, t0)
Note
For complex problems, it is recommended to check the available examples and the documentation in the problem class, Overdetermined_Problem. It is also recommended to define your problem as a subclass of Overdetermined_Problem.
Warning
When subclassing from a problem class, the function for calculating the right-hand-side (for ODEs) must be named rhs and in the case with a residual function (for DAEs) it must be named res.
Create a solver instance:
sim = ODASSL(mod)
Modify (optionally) the solver parameters.
Parameters:
atolDefines the absolute tolerance(s) that is to be used by the solver.backwardSpecifies if the simulation is done in reverse time.clock_stepSpecifies if the elapsed time of an integrator step should be timed or not.display_progressThis option actives output during the integration in terms of that the current integration is periodically printed to the stdout.inithThis determines the initial step-size to be used in the integration.maxhDefines the maximal step-size that is to be used by the solver.maxordDefines the maximal order that is to be used by the solver.maxsteps.num_threadsThis options specifies the number of threads to be used for those solvers that supports it.report_continuouslyThis options specifies if the solver should report the solution continuously after steps.rtolDefines the relative tolerance that is to be used by the solver.safe.store_event_pointsThis options specifies if the solver should save additional points at the events, \(t_e^-, t_e^+\).time_limitThis option can be used to limit the time of an integration.usejacThis sets the option to use the user defined Jacobian.verbosityThis determines the level of the output.
Simulate the problem:
Information:
ODASSL.get_options() Returns the current solver options.ODASSL.get_supports() Returns the functionality which the solver supports.ODASSL.get_statistics() Returns the run-time statistics (if any).ODASSL.get_event_data() Returns the event information (if any).ODASSL.print_event_data() Prints the event information (if any).ODASSL.print_statistics() Prints the run-time statistics for the problem.