transiflow.TimeIntegration
- class TimeIntegration(interface, theta=1.0, newton_tolerance=1e-10, maximum_newton_iterations=10, residual_check='F', verbose=False)
Bases:
objectTime integration using the theta method.
- Parameters:
- interface
Interface object that implements the following functions:
rhs(x),jacobian(x),mass_matrix()andsolve(jac, rhs).- newton_tolerancescalar, optional
Tolerance used in the Newton corrector to determine convergence.
- maximum_newton_iterationsint, optional
Maximum number of Newton iterations.
- residual_check: str, optional
Method for checking the residual in the Newton method (default: ‘F’).
F: Use the norm of therhs(x)function.dx: Use the norm of the stepdx.
- verbosebool, optional
Give extra information about convergence. Since we have to compute this information, this may be slower.
- integration(x0, dt, tmax, callback=None)
Perform the time integration.
- Parameters:
- x0array_like
Initial solution.
- dtscalar
Time step.
- tmaxscalar
End time.
- callbackfunction, optional
User-supplied function to call after each continuation step. It is called as
callback(interface, x, t).
- Returns:
- xarray_like
Solution at the end time
- tscalar
End time
\[\]