WSMLink`
WSMLink`

WSMStorePlot

WSMStorePlot has been replaced by WSMSetPlot.

WSMStorePlot["mmodel","name",{"v1","v2",}]

stores a plot of variables "vi" as "name" in the model "mmodel".

WSMStorePlot["mmodel","name",{{"v1,x","v1,y"},}]

stores a parametric plot with x and y coordinates vi,x and vi,y as a function of time.

WSMStorePlot["mmodel","name",,{tmin,tmax}]

stores a plot for the time interval tmin<t<tmax.

Details and Options

  • A stored plot can be shown with WSMPlot["mmodel","name"].
  • WSMStorePlot[,{{"v1", "p1", d1},}] stores variables vi with sensitivity bounds when parameter pi varies 100 di %.
  • The shortest unique model name mmodel can be used where WSMNames["*.mmodel"] gives a unique match.
  • Using "group/plot" as a name puts plot in group.
  • The following options can be given:
  • AxesLabelAutomaticaxes labels
    PlotLegendsAutomaticlegends for curves
    PlotRangeAutomaticrange of values to include
    "Preferred"Falsewhether the plot is a preferred one
  • AxesLabel can be Automatic, None, a string label for the y axis or {"xlabel","ylabel"}.
  • Possible PlotLegends are Automatic, None or a list of one string per variable in the plot.
  • PlotRange is Automatic, {ymin,ymax} or y, which is interpreted as {-y,y}.
  • If "Preferred" is True, it will be included when plotting preferred plots with WSMPlot[sim].

Examples

open allclose all

Basic Examples  (4)

Load Wolfram SystemModeler Link:

Store a plot to a model:

Simulate and show the newly defined plot:

Store a parametric plot:

Simulate and show the newly defined plot:

Store a sensitivity plot:

Plot the sensitivity of "integrator1.y" to the parameter "sine.freqHz", varying by 10%.

Simulate with sensitivity analysis against the frequency parameter:

Show the stored plot:

Scope  (4)

Store two plots in a group:

Simulate and show all plots in the group:

Store a plot with custom plot legends:

Simulate and show the plot:

Store a plot with custom axis labels:

Simulate and show the plot:

Restrict the plot range:

Simulate and show the plot:

Generalizations & Extensions  (1)

Get the full plot specification for stored plots:

Options  (7)

AxesLabel  (2)

Turn off axes labels completely:

Simulate and show the plot:

Specify an axis label for one axis:

Simulate and show the plot:

PlotLegends  (2)

Turn off plot legends:

Simulate and show the plot:

Turn off the plot legend for one variable:

Simulate and show the plot:

PlotRange  (2)

Store a plot range symmetrical around 0:

Simulate and show the plot:

Constrain the time range:

Simulate and show the plot:

"Preferred"  (1)

Make a plot preferred:

Preferred plots are used in WSMPlot if no plot name or variables are given:

Properties & Relations  (5)

Giving the same name as an existing plot overwrites the plot:

The last stored plot is used:

List the names of saved plots using WSMModelData:

Saved plots are inherited:

The base model has a saved plot:

Create a model that extends baseModel:

The newly created model inherits the base plot:

The new model does not have any local plots defined:

Delete plots using WSMDeletePlot:

Store a plot that will then be deleted:

WSMDeletePlot removes the plot from the model:

Rename plots using WSMRenamePlot:

Store a plot that will then be renamed:

WSMRenamePlot renames the plot but keeps the contents:

Simulate and show the renamed plot:

Possible Issues  (1)

Models are not saved unless explicitly saved in SystemModeler Model Center:

After quitting the Wolfram Language kernel and SystemModeler, the copied model is gone: