Class SystemSimulateResult

Class which provides results of System.simulate, providing an underlying NdArray as well as helper methods to get state values by element index or time index.

Constructors

  • Parameters

    • nGroups: number

      The number of groups in the System

    • nParticles: number

      The number of particles per group

    • nStateElements: number

      The number of state elements for which this object holds state values

    • nTimes: number

      The number of times for which this object holds state values

    Returns SystemSimulateResult

Methods

  • Returns values at all time indexes, for a given state element index.

    Parameters

    • iGroup: number

      Index of the group

    • iParticle: number

      Index of the particle

    • iStateElement: number

      Index of the state element - NB not the element index within the entire System state, but the index in the stateElementIndices parameter provided to System.simulate

    Returns ArrayState

  • Returns all the result state values for a particle at a given time index. NB This returns a ParticleState but may be a a partial array of all elements in the particle, depending on the elements requested in the simulate call.

    Parameters

    • iGroup: number

      Index of the group

    • iParticle: number

      Index of the particle

    • iTime: number

      Index of the time - NB not time value, but the index in the times parameter provided to System.simulate

    Returns ArrayState

  • Provides the underlying NdArray holding all result values

    Returns NdArray<number[] | TypedArray | GenericArray<number>>

  • Sets result state values for a given particle at a given time.

    Parameters

    • iGroup: number

      Index of the group

    • iParticle: number

      Index of the particle

    • iTime: number

      Index of the time - NB not time value, but the index in the times parameter provided to System.simulate

    • stateValues: number[]

      The state values to set, for all values requested in the stateElementIndices parameter provided to System.simulate

    Returns void