Dynamic Model Stimulation
Description of the dynamic model stimulation functionality available through SCADA Input components
Dynamic Model Stimulation Functionality
Dynamic model stimulation is a feature that enables reproduction of high resolution time-series profiles during simulation runtime. In order to reproduce time-series signals, SCADA Input components are used. The signal resolution is defined by the signal processing execution rate.
The interface is defined through the following HIL API functions:
HIL API function declarations | Function description |
---|---|
create_signal_stimulus() | Creates signal stimulus object. |
prepare_signal_stimulus() |
Prepares initial data for signal stimulus. |
start_signal_stimulus() | Starts signal reproduction. |
stop_signal_stimulus() |
Stops signal reproduction. |
pause_signal_stimulus() | Pauses signal reproduction. |
load_signal_gen_data() |
Loads data from a file and prepares it for stimulus object creation. |
Reproduction signal definition
In order to use this functionality, the signal to be reproduced must be created where the dictionary keys represent signal names and the signal values are represented as a list of float values. The time axis is represented as a dictionary key "Time" where values need to be in a list of increasing order. The time axis doesn't need to be equidistant, since linear interpolation is used.
Signals can be prepared manually through code, or a load_signal_gen_data() function can be used. This function can load all the file formats supported by Typhoon HIL Control Center.
Signals for reproduction don’t need to have same execution rate as the signal processing execution rate.
Creating a stimulus object and performing signal reproduction
In the process of signal reproduction, a signal stimulus object needs to be created with the create_signal_stimulus() function. The function takes the prepared signal in the form of a dictionary as an argument. All other functions will use this object to reference the proper stimulus. Once the object is created, initial data needs to be loaded to the HIL device. This is done with the prepare_signal_stimulus() function. Once the signal is prepared for reproduction, functions for controlling the stimulus can be used. These functions are start, stop, and pause signal stimulus.
import typhoon.api.hil as hil
example_signal = {"SCADA Input1": [0, 1, 2, 3, 4], "Time": [0, 1, 3, 4, 6]}
stimulus_object = hil.create_signal_stimulus(stimulation_signal)
hil.prepare_signal_stimulus(stimulus_object)
hil.start_signal_stimulus(stimulus_object)
hil.start_simulation()
…
hil.stop_signal_stimulus(stimulus_object)
hil.stop_simulation()
After stopping the simulation there is no need to stop signal stimulation because it will be automatically stopped.
There is no hard limitation regarding to the number of signals used for reproduction, but all signals referenced to a single signal stimulus need to be on the same signal processing simulation rate.