This tutorial will help you to clamp model variables using clamp commands.
CESE clamping system uses two types of files to construct clamp signals and control variables during simulation: Records and Signals. Records control the series of clamping commands and assign clamping signals to the model variables. Signals are used to specify an individual clamping signal for a given model variable. This approach for constructing commands has an advantage of the high degree of code reuse for Records, and (especially) Signals for different types of simulatons.
Record files serve three main purposes:
A typical Record file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE record SYSTEM "signal.dtd">
<record name="Test record">
<group name="group1">
<command source="sig1.xml" variable="v">
<expr>level=-71</expr>
<expr>dur=500</expr>
</command>
</group>
</record>
Inside the record file there is at least one <group>(s). A <group> can have an optional name attribute, which helps you to identify the group inside the file.
The group lists a number of <command>(s) that specify which signal file is used to clamp a single model variable. In the example we assign a command determined by "sig1.xml" Signal to the model variable "v". We also specify initial values for the variables in the Signal file using <expr> tags. Therefore, we can reuse the same Signal file, but produce commands with different parameters by modifying the initial signal variable values.
When CESE runs in the clamp mode, it selects a group in the record file based on the value of the current Record Number. For example, if you set a Record Number to 5, CESE will attempt to use a fifth group in the record file to clamp model variables. If there are less groups in the record file you selected, CESE will use last group in that file.
After each simulation the Record Number is incremented, therefore on the next simulation run clamping system will use next group in the given Record file.
You can prevent the automatic Record Number increment by using Lock Record command in the menu.
Signal files contain a sequence of segments
Here is a full list of available segments. You can also extend a system to create additional segments.
The duration of the signal (a sum of durations of all segments) should generally be larger than the duration of individual run of your simulation. If signal duration is shorter than the simulation duration, a 0 (zero) value will be applied to the model variable for the simulation period that exceeds a duration of the clamp signal.