How to Define Your Own Drive Function

There are multiple pre-defined drive functions available in OnScale such as:

  • Sinusoidal Pulse
  • Blackman Harris Wavelet
  • Square Wave Pulse
  • Chirp
  • Ricker Wavelet 
  • Gaussian 
  • Apodized Step

However, it is sometimes necessary to define your own drive function to ensure the accuracy of results and this article details how to do this. 

Analyst Mode

The data hist command is used as a way of inputting digitized time history data into a user specified Data Manager array. The format of the time history data must be one pair (time, data value) per record for the number of records (nvalues). The data must also be free-format text form (i.e. text file or data file). For example:

0 10.05
1 5.75
2 3.49
3 4.93
4 6.78
5 8.21

The data is put into an array whose name is specified by the user. For example:

 time_func1 6 myfunction.txt 

This code takes the  first 6 lines of data from 'myfunction.txt' and saves it into the data manager array 'time_func1'. This array can then be called in the func command to be applied to loads:

func hist time_func1

To apply this function to a load use the bc command if using voltage load or pdef if using a pressure load:

Voltage Example:

wndo piez auto

defn top                    /* Define electrode - name 'top'
node $i1 $i2 $j3 $j4        /* Assign nodes to top electrode
bc top volt func   /* Apply voltage condition to top electorde and assign drive signal 'time_func1'

Pressure Example:

pdef pload1 func

Designer Mode

The Time section in the Model Tree is where to define your own drive function. 

Tip: The method to do this can be access via the Model Tree and using the Time Function Tool - both methods bring up the same window.

To choose your own drive function, select the 'User Defined' option in the drive function window and load in the data file containing your drive function.

Selecting 'Insert' will add the time function to the Model Tree which can then be referenced when defining loads.