There are multiple pre-defined drive functions available in OnScale such as:
- Sinusoidal Pulse
- Blackman Harris Wavelet
- Square Wave Pulse
- Ricker Wavelet
- 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.
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:
The data is put into an array whose name is specified by the user. For example:
hist 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:
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'
pdef pload1 func
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.