MUSCLE3 IMAS Actor¶
The waveform editor includes an actor that can be included in an IMAS MUSCLE3 simulation. This page assumes you are familiar with MUSCLE3 and IMAS coupled simulations.
Caution
The IMAS MUSCLE3 actor requires the following packages:
Actor details¶
The actor expects messages on a single input port. We take the timestamp of the message and evaluate all waveforms at that moment in time. These waveforms are stored in their respective IDSs and sent on the respective (connected) output port.
implementations section for running the waveform-editor actor¶implementations:
waveform_actor:
executable: waveform-editor
args: actor
Available settings¶
waveforms(mandatory): indicate the (full) path to the waveform configuration.
Input ports (F_INIT)¶
The actor has one input port. The name can be chosen freely in the workflow yMMSL (see example below).
The actor will stop with a RuntimeError when there are no input ports, or when there
are multiple input ports declared.
Output ports (O_F)¶
The actor can have one output port per IDS that is defined in the waveform
configuration. Output ports must be named <ids_name>_out or <ids_name>.
The actor will stop with a RuntimeError when an output port is connected for which
there is no corresponding waveform defined. For below example, the actor would report an
error when the waveforms.yaml doesn't contain waveforms for either the
ec_launchers IDS or the nbi IDS.
Example¶
The following yMMSL shows an example coupling for a hypothetical controller actor
with the waveform-editor actor. N.B. __PATH__ is a placeholder which should be
replaced with the full path to the files.
ymmsl_version: v0.1
model:
name: example_coupling_with_waveform_actor
components:
controller:
implementation: controller
ports:
o_i: time_out
s:
- ec_launchers_in
- nbi_in
waveform_actor:
implementation: waveform_actor
ports:
# The name of the input port can be freely chosen:
f_init: time_in
# Names of the output port are "<ids_name>_out":
o_f:
- ec_launchers_out
- nbi_out
conduits:
controller.time_out: waveform_actor.time_in
waveform_actor.ec_launchers_out: controller.ec_launchers_in
waveform_actor.nbi_out: controller.nbi_in
settings:
# Mandatory setting for the waveform actor: the waveform configuration:
waveform_actor.waveforms: __PATH__/waveforms.yaml
resources:
controller:
threads: 1
waveform_actor:
threads: 1
implementations:
controller:
executable: python
args: __PATH__/controller.py
waveform_actor:
executable: waveform-editor
args: actor
The corresponding waveform configuration is shown below:
# Very simple waveform configuration as an example for the MUSCLE3 IMAS actor
globals:
dd_version: 4.0.0
ec_launchers:
ec_launchers/beam(1)/power_launched/data:
# Ramp up to 50 kW
- {type: linear, to: 50e3, duration: 10}
# Flat top, constant at 50 kW
- {type: constant, duration: 30}
# Ramp down
- {type: linear, to: 0, duration: 10}
nbi:
# Note that the actor would give an error if we do not include this waveform:
# the yMMSL file expects an output for the NBI IDS, so we must define
# waveforms for this IDS.
nbi/unit(1)/power_launched/data:
- {type: constant, value: 0} # NBI is turned off for this configuration