Plotting time histories

The POUT command is used in OnScale as a quick way to view output results without the need for further post processing. POUT lets the user specify analysis results that are to be printer to the Job Output File during execution. The time histories specified here are also written to the Time History File at the end of the job in time history form.

Time history results recorded in the POUT can be plotted in OnScale during a run with reference to the array they are stored in. Data is stored in arrays numerically.

A few examples will be presented showing some of the ways time histories can be plotted during execution, all examples were done by modifying the PZT Disk 2D example in our Examples section:

  • Before any plotting can be done some set up is required, all plotting is done after the prcs function:
prcs

symb #get { step } timestep /* Extract calculated timesteps from PRCS command
symb simtime = 40 / $freqint /* Simulation time - 40 cycles / @ 1 MHz
symb nexec = $simtime / $step /* Determine how many timesteps to run full model
symb nloops = 40 /* Plotting snapsots during model execution
symb nexec2 = $nexec / $nloops

grph
arrow off /* Turn off arrows
line off /* Turn off mesh lines

set imag mpeg /* Set up image capture for movie file generation
nvew 3 1 /* Set up 3 plotting widows in layout number 3
end

proc plot save

exec $nexec2

** INSERT GRPH COMMAND HERE **
end$ proc /* End of Procedure Code
c Run model by calling 'plot' procedure 'nloops' times proc plot $nloops term /* Pause model - Allow user to call procedure 'plot' from console window to run model for longer

With this the plotting set up is complete and the GRPH command can be inserted into this basic execution template and plots are produced.

In this particular example 6 data arrays are defined in the POUT function. To plot any of these time histories simply call the data arrays index so in this case (1 - 4)

grph
plot 1 /* Plot time history 1 - Drive function
plot 2 /* Plot time history 2 - Voltage top electrode
plot 3 /* Plot time history 3 - Charge top electrode
imag /* For movie generation (snapshots)
end

Untitled.png

It is possible to display multiple time histories on a single graph. The following example will serve as a tool to demonstrate this:

grph
plot 3 4 /* This will plot charge and displacement stored in arrays 3 and 4
end


Untitled.png

These are very basic examples of how to use your time history data. For more help on the GRPH command or for more advanced subcommands that accompany GRPH please refer to OnScale help documentation that can be accessed via help tab in the application's ribbon.