ResponsePlot - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


DynamicSystems

  

ResponsePlot

  

plot response of a system to a given input

 

Calling Sequence

Parameters

Options

Description

Examples

Calling Sequence

ResponsePlot (sys, input, opts)

Parameters

sys

-

System; system object to simulate

input

-

algebraic, list(algebraic), Vector(realcons), or list(Vector(realcons)); input signal to the system

opts

-

(optional) equation(s) of the form option = value; specify options for the ResponsePlot command

Options

Some options are used only with particular types of systems. If an option is not usable, it is ignored.

• 

initialconditions = Vector(realcons) or list of equations

Specifies the initial conditions of the system. For a state-space system the initial conditions are specified as a Vector with dimension equal to the number of state-variables. For a differential-equation system the initial conditions are a list of equations. For transfer-function, coefficients, zero-pole-gain, and difference-equation (discrete DE) systems, initial conditions are ignored. Ignored initial conditions are equivalent to initial conditions of zero.

• 

output = algebraic, list(algebraic), or listlist(algebraic)

Specifies the expressions to plot.

A single algebraic expression generates a plot of the expression versus time. The names of the system variables in the expression are replaced with their values at each instant of the solution. For example, for a continuous system with y1 as an output variable and  x1 as a state variable, the expression t*x1*y1^2 plots tx1ty1t2 versus t.

A list(algebraic) expression generates a multiplot of each element in the list versus time. The names of the system variables in the elements are replaced with their values at each instant of the solution. For example, for a discrete system with y1 and y2 as an output variables and u1 as an input variable, the list [y1, y2/u1] plots y1(q) versus q and y2(q)/u1(q) versus q.

A listlist(algebraic) expression generates a parametric multiplot, with each sublist specifying the coordinates of the corresponding plot. If the sublists contain two elements, then the plots are 2-D plane curves. If the sublists contain three elements, then the plots are 3-D space curves. The names of the system variables in the elements are replaced with their values at each instant of the solution. For example, for a continuous system with y1 and y2 as output variables, the listlist [[y1, y2]] plots y1t versus y2t.

As described above, system variables are substituted for the corresponding names in the expressions. Continuous systems do not have access to the input variables, while discrete systems do.

The default is to plot all output variables of a system versus time.

• 

parameters = set(name = complexcons) or list(name = complexcons)

  

Specifies numeric values for parameters in sys. These values override those specified by the parameters field of the system object, which in turn override the settings in in SystemOptions(parameters). The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the expressions that define the model. No checking is done during the substitution to determine whether the substituted value is valid. For example, a complex value can be substituted for the coefficient of a polynomial. If the complex value had been originally assigned to the model at creation, a warning would be generated.

Continuous System Options

• 

dsolveargs = list( equation )

Specifies extra parameters to be passed to dsolve. The simulation is achieved by formulating the system as a set of differential equations and then passing them to dsolve.  With this option additional parameters can be passed to dsolve.  See dsolve/numeric/DAE for details.

• 

duration = realcons

Specifies the duration of the simulation. The simulation starts at t=0 and proceeds until t = duration. The default value is assigned by DynamicSystems[SystemOptions].

• 

ignoredirac = truefalse

  

True means replace any function calls to Dirac in the system with 0; false means raise an error when a Dirac is present in the system. The default is false.

Description

• 

The ResponsePlot command plots the time response of sys, a System object, to a given input.

• 

ResponsePlot uses DynamicSystems[Simulate] to generate the response, consequently, sys and input must be compatible with Simulate.

• 

The ResponsePlot command takes all standard plot,options.

Examples

withDynamicSystems:

Create a linear system from a differential equation.

deqs0.5diffit,t+it=vt0.01diffθt,t,0.01diffdiffθt,t,t+0.1diffθt,t=0.01it

deqs0.5ⅆⅆtit+it=vt0.01ⅆⅆtθt,0.01ⅆ2ⅆt2θt+0.1ⅆⅆtθt=0.01it

(1)

sysDiffEquationdeqs,inputvariable=vt,outputvariable=θt,it:

Generate the input waveform, a sine wave with amplitude 1 and natural frequency of 2 radian/second.

vinSine1,2

vin0t<0sin2totherwise

(2)

Plot the response of the system to the input for a simulation time of 10 seconds.  This is the command to create the 2-D plot from the Plotting Guide.

Tsim10&colon;

ResponsePlotsys&comma;vin&comma;duration=Tsim&comma;color=red&comma;blue&comma;thickness=2

Plot theta vs i as time varies over the duration.

ResponsePlotsys&comma;vin&comma;duration=Tsim&comma;output=i&comma;θ

Create a discrete simulation of the previous system. Convert sys to a sampled system with a sampling period, Ts,  of 0.1 second. Assign the default samplecount so that the duration corresponds to Tsim'.

Ts0.1&colon;

SystemOptionssampletime=Ts&comma;samplecount=roundTsimTs&colon;

syszToDiscretesys

syszDiff. Equationdiscrete; sampletime = .12 output(s); 1 input(s)inputvariable&equals;vqoutputvariable&equals;θq&comma;iq

(3)

vin_zSine1&comma;2&comma;discrete=true

Plot the response of the system, and the input.

ResponsePlotsysz&comma;vin_z&comma;output=v&comma;θ&comma;i&comma;color=red&comma;blue&comma;green

Plot the output state, versus time, as a space-curve.  This is the command to create the 3-D plot from the Plotting Guide.

ResponsePlotsysz&comma;vin_z&comma;output=q&comma;θ&comma;i&comma;axes=normal

If the time-constants of the system are much less than the duration, passing the dsolve option stiff to PlotResponse can improve the plot. For example

sysTransferFunctionw02s2+2ζw0s+w02&comma;parameters=w0=1T&comma;ζ=34&colon;

T106&colon;

plots:-displayResponsePlotsys&comma;Step&comma;duration=100T&comma;color=red&comma;ResponsePlotsys&comma;Step&comma;duration=100T&comma;color=blue&comma;dsolveargs=stiff=true

See Also

dsolve/numeric/DAE

DynamicSystems

DynamicSystems[Simulate]

DynamicSystems[SystemObject]