plot response of a system to a given input - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Dynamic Systems : Plotting and Graphical Tools : DynamicSystems/ResponsePlot

DynamicSystems[ResponsePlot] - plot response of a system to a given input

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

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.

deqs:=0.5ⅆⅆtit+it=vt0.01ⅆⅆtθt,0.01ⅆⅆtⅆⅆtθt+0.1ⅆⅆtθt=0.01it

deqs:=0.5ⅆⅆtit+it=vt0.01ⅆⅆtθt,0.01ⅆ2ⅆt2θt+0.1ⅆⅆtθt=0.01it

(1)

sys:=DiffEquationdeqs,inputvariable=vt,outputvariable=θt,it:

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

vin:=Sine1,2

vin:=&lcub;0t<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.

Tsim:=10&colon;

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

Plot theta vs i as time varies over the duration.

ResponsePlotsys&comma;vin&comma;duration&equals;Tsim&comma;output&equals;i&comma;&theta;

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'.

Ts:=0.1&colon;

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

sysz:=ToDiscretesys

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

(3)

vin_z:=Sine1&comma;2&comma;discrete&equals;true

vin_z:= 1 .. 100 VectorcolumnData Type: anythingStorage: rectangularOrder: Fortran_order

(4)

Plot the response of the system, and the input.

ResponsePlotsysz&comma;vin_z&comma;output&equals;v&comma;&theta;&comma;i&comma;color&equals;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&equals;q&comma;&theta;&comma;i&comma;axes&equals;normal

See Also

dsolve/numeric/DAE, DynamicSystems, DynamicSystems[Simulate], DynamicSystems[SystemObject]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam