evaluate_step_by_step#

TwinModel.evaluate_step_by_step(step_size, inputs=None)#

Evaluate the twin model at time instant t + step_size given inputs at time instant t. Return list of outputs values at time instant t + step_size (ordered by output_names).

Twin model evaluation must have been initialized before calling this method (see initialize_evaluation method).

Parameters:
step_sizefloat

The step size (in second) to reach next time step. It must be strictly positive.

inputsdict (optional)

The input values (i.e. {“name”: value}) at time instant t. An input is not updated if associated key is not found in twin model input_names property. Other inputs keep current value if not provided.

Examples

>>> from pytwin import TwinModel
>>> twin_model = TwinModel(model_filepath='path_to_your_twin_model.twin')
>>> twin_model.initialize_evaluation()
>>> twin_model.evaluate_step_by_step(step_size=0.1, inputs={'input1': 1., 'input2': 2.})
>>> results = {'Time': twin_model.evaluation_time, 'Outputs': twin_model.outputs}