linearize the equations of an active MapleSim model - MapleSim Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MapleSim : MapleSim Application Programming Interface : API Commands : MapleSim/LinkModel/Linearize

Linearize - linearize the equations of an active MapleSim model

Calling Sequence

A := MapleSim:-LinkModel();

A:-Linearize(options)

Parameters

options

-

(optional) equation(s) of the form name = value

Returns

• 

By default, the Linearize command returns a DynamicSystems object that is a linearized form of a linked subsystem.  Alternatively, the user can specify format=all to return a Maple record containing complete linearization information.

• 

If format = all then Linearize returns a record with the following fields:

– 

stateeqs - a set of linearized state equations

– 

outeqs - a set of linearized output equations

– 

A - state-space Matrix A

– 

B - state-space Matrix B

– 

C - state-space Matrix C

– 

D - state-space Matrix D

– 

varsubs - a list of variable name substitutions: a state, input, and output remapping list

– 

linpoint - a set of equations of the form xt=0 defining the linearization point

– 

dsobject - a DynamicSystems object created using linearized equations

– 

params - parameter definitions

• 

If implicitform=true and format=all then Linearize returns the following fields:

– 

linres - a list of two sets: first set has linearized implicit expressions including those for output variables, and the second set contains all the input variables.  The presence of input variables makes the resulting system non-square (number of equations does not match the number of variables) thus the user is made aware of their presence.

– 

linpoint - a set of equations of the form xt=0 defining the linearization point

– 

dsobject - a DynamicSystems object created using linearized expressions

– 

params - parameter definitions

Description

• 

The Linearize command returns a DynamicSystems model that is a linearized form of a linked subsystem, one that can be represented in first-order form:

ⅆⅆtxt=fxt,ut

yt=gxt,ut

  

where:

xt represents the state variables;

ut represents the input variables specified by inputs;

yt represents the output variables specified by outputs;

f and g are functions to be linearized;

• 

The output of Linearize can also be represented in state-space form:

ⅆⅆtxt=Axtx0+Butu0+fx0,u0

yt=Cxtx0+Dutu0+gx0,u0

  

where A=xf, B=uf, C=xg, and D=ug are the Jacobian matrices evaluated at the linearization point (x0,u0), which is the equilibrium or initial point.  At the equilibrium point fx0,u0=0 and gx0,u0=0.  At the initial point fx0,u0 may not be zero but this offset value will be returned in the equations.

• 

The linearization algorithm uses an initial point of the system in order to compute its equilibrium point (where derivatives of states are set to zero).  If no equilibrium point can be found then the user is invited to linearize the system around the initial point. The ics option can be used to affect the computation of the initial point.

• 

The system must have state variables or output equations in order for linearization to occur. If there are output equations but no states then the state-space matrices A, B, and C will be empty and only the D matrix representing the yt=Dut part of the linearized system will be populated.

• 

The Linearize command provides information about the linearized model that can be used for various purposes, including model analysis and control design. For example, a MapleSim model with no inputs or outputs will be represented by its system matrix after linearization and this information can be used for modal analysis as shown in the Examples section.

• 

The A := MapleSim:-LinkModel() statement needs to be run prior to successfully using any of the ModelObject A's export functions.

Examples

withMapleSim:

Linearization point of a MapleSim model

AMapleSim:-LinkModel'filename'=catkernelopts'toolboxdir'=MapleSim,/data/examples/RLCcircuit.msim:

A:-ListSubsystems

RLC

(1)

A:-SetSubsystemNameRLC

• 

Call Linearize to generate a linearized, DynamicSystems model, using all the parameters in the subsystem.

sysA:-Linearize'params'=A:-GetParameters:

sys:-parameters

C=1,L=1

(2)

withDynamicSystems:

PrintSystemsys

Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=InputSignaltoutputvariable=OutputSignaltde={[x1.t=x2tL, x2.t=x1tu1t+x2tC, y1t=x2t, x1t=I1_p_it, x2t=SC1_n_vt, u1t=InputSignalt, y1t=OutputSignalt]

(3)

BodePlotsys,parameters=C=10

• 

Call Linearize with format=all option to obtain the linearization point.

sysA:-Linearize'params'=A:-GetParameters,'format'='all':

sys:-linpoint

I1_p_it=0.,SC1_n_vt=0.,InputSignalt=0,OutputSignalt=0.

(4)

Modal analysis of a MapleSim model

• 

Consider a MapleSim model of a double mass-spring-damper system

AMapleSim:-LinkModel'filename'=catkernelopts'toolboxdir'=MapleSim,/data/examples/MassSpringDamper.msim:

• 

Call Linearize with paramcheck=false option to keep all symbolic parameters.

linsysA:-Linearize'params'=A:-GetParameters,'format'='all','paramcheck'=false:

• 

Obtain the parameter values.

plinsys:-params

p:=c1=10,c2=1,k1=10000,k2=1000,m1=2,m2=1

(5)
• 

Analyze the system matrix A.

alinsys:-A

a:=0100k1+k2m1c1+c2m1k2m1c2m10001k2m2c2m2k2m2c2m2

(6)
• 

Get its characteristic polynomial.

LinearAlgebra:-CharacteristicPolynomiala,s

s4+c1m2+c2m1+c2m2s3m2m1+c1c2+k1m2+k2m1+k2m2s2m2m1+c1k2+c2k1sm1m2+k1k2m1m2

(7)
• 

Get the system matrix with numeric parameters.

Anevallinsys:-A,linsys:-params

An:=010055001125001200011000110001

(8)
• 

Get the eigenvalues.

eigsevalfLinearAlgebra:-EigenvaluesAn

eigs:=0.445752358+29.85474874I0.44575235829.85474874I2.804247642+74.83736686I2.80424764274.83736686I

(9)
• 

The damping ratios of the two modes are given by:

damprat111+ℑeigs1ℜeigs12

damprat1:=0.01492903810

(10)

damprat211+ℑeigs3ℜeigs32

damprat2:=0.03744494387

(11)
• 

The natural frequencies of the two modes are:

natfreq1ℜeigs1damprat1

natfreq1:=29.85807625

(12)

natfreq2ℜeigs3damprat2

natfreq2:=74.88988772

(13)
• 

The periods of the two modes are given by:

T1evalf2πnatfreq11damprat12

T1:=0.2104584890

(14)

T2evalf2πnatfreq21damprat22

T2:=0.08395786184

(15)

See Also

DynamicSystems, DynamicSystems[SystemObject], MapleSim, MapleSim[LinkModel], MapleSim[LinkModel][GetICs], MapleSim[LinkModel][GetSettings], module


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