Euler's method for solving ordinary differential equations expressed as a ODESim; operates by using the differential equations to advance the variables by a small time step.

Note that Euler's method is not numerically stable, it is provided for educational purposes only. See ModifiedEuler for a numerically stable version of Euler's method.

Implements

Constructors

Properties

inp_: number[] = []

array used within algorithm, retained to avoid reallocation of array.

k1_: number[] = []

array used within algorithm, retained to avoid reallocation of array.

ode_: ODESim

the set of differential equations to solve.

Methods

  • Name of this object, either the language-independent name for scripting purposes or the localized name for display to user.

    The language-independent name should be the same as the English version but capitalized and with spaces and dashes replaced by underscore, see Util.toName and nameEquals.

    Parameters

    • Optional opt_localized: boolean

      true means return the localized version of the name; default is false which means return the language independent name.

    Returns string

    name of this object

  • Whether this DiffEqSolver has the given name, adjusting for the transformation to a language-independent form of the name, as is done by Util.toName.

    Parameters

    • name: string

      the English or language-independent version of the name

    Returns boolean

    whether this DiffEqSolver has the given name (adjusted to language-independent form)

  • Advances the associated ODESim by the given small time increment, which results in modifiying the state variables of the ODESim. Modifies the variables array obtained from ODESim.getVarsList by using the change rates obtained from ODESim.evaluate.

    Parameters

    • stepSize: number

      the amount of time to advance the differential equation

    Returns null | object

    null if the step succeeds, otherwise an object relating to the error that occurred

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

Generated using TypeDoc