User manual

Dymola 2013 FD01 Release notes 27
Plot Parametric Curve
A new function
plotParametricCurve is available for plotting curves defined by a
parameter:
function plotParametricCurve "plot parametric curve"
input Real x[:] "x(s) values";
input Real y[size(x, 1)] "y(s) values";
input Real s[size(x, 1)] "s values";
input String xName = "" "The name of the x variable";
input String yName = "" "The name of the y variable";
input String sName = "" "The name of the s parameter";
input String legend = "" "Legend describing plotted data";
input Integer id = 0 "Identity of window (0-means last)";
input Integer color[3] = {-1, -1, -1} "Line color";
input Integer pattern = 2 "Line pattern, e.g., LinePattern.Solid";
input Integer marker = -1 "Line marker, e.g., MarkerStyle.Cross";
input Real thickness = 0.25 "Line thickness";
input Boolean labelWithS = false "if true, output values of s along the curve";
input Boolean erase = false "Erase window content before plotting";
output Boolean result "true if successful";
// Makes a x(s) - y(s) plot of given values.
end plotParametricCurve;
Giving the commands:
s=0:0.1:10
y={sin(t)*exp(-0.1*t) for t in s}
x={cos(t)*exp(-0.1*t) for t in s}
plotParametricCurve(x, y, s, labelWithS=true);
produces the following plot
The labels can be turned on and off in the context menu of the curve: