How to Clamp Model Parameters

PDFPDF version

This tutorial will explain how 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.

Records

Record files serve three main purposes:

  • They assign clamping signals to the corresponding model variables.
  • They group several clamping signals for a single model run (therefore, it is possible to clamp several model variables at once, and assign different signals to different variables).
  • They specify initial values for the variables in signal files.

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 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 selected record file, CESE will use last group in that file.

After each simulation run 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.

Signals

Signal files contain a sequence of segments that determine the command that controls a single model variable.

Here is a list of available segments. You can also extend a system to create additional segments.

  • level generates a constant level signal segment. Example:
    <level>
            <expr> -86</expr>
            <expr> 50  </expr>
    </level>
    
    Parameters (<expr>):
    1. level
    2. duration
  • ramp, generates a ramp signal segment. Example:
    <ramp>
            <expr> -86</expr>
    	<expr>25 </expr>
            <expr> 50  </expr>
    </ramp>
    
    Parameters (<expr>):
    1. start level
    2. end level
    3. duration
  • sine, generates a sine signal segment. Example:
    <ramp>
            <expr> -86</expr>
    	<expr>25 </expr>
    	<expr> 10 </expr>
    	<expr> 0.5 </expr>
            <expr> 50  </expr>
    </ramp>
    
    Parameters (<expr>):
    1. lower limit
    2. upper limit
    3. period
    4. phase
    5. duration
  • waveform generates an arbitrary signal segment based on the ASCII data stored in a separate file. Example:
    <waveform file="test.dat">
            <expr> 500  </expr>
    </level>
    
    Attributes:
    • file: a name of the file that contains a single column of the numerical ASCII data. The file is read and the values in the file are used to generate an arbitrary signal segment of a given duration.
    Parameters (<expr>):
    1. duration

Each of the above signals can have parameters set as constants, for example:

<level>
        <expr> -86</expr>
        <expr> 50  </expr>
</level>

or as variables defined in signal or record files, for example:

<expr>level = -86</expr>
<expr>dur = 50</expr>

<level>
        <expr>level</expr>
        <expr> dur</expr>
</level>

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, 0 (zero) value will be assigned to the model variable for the simulation period that exceeds a duration of the clamp signal.

by Sergey Missan