F-14 Longitudinal Model - BlockImporter Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Toolboxes : BlockImporter : Examples : BlockImporter/Examples/F14Model

F-14 Longitudinal Model

 

NOTE:  You will need to have an installed and functioning version of MATLAB® and Simulink® to run this example.

 

 

Section Layout

Import the System

Simulate the System

Import the Subsystem

 

 

 

Initialization

Import the System

Simulate the System

Import the Subsystem

Initialization

withBlockImporter

BuildDE,Import,PrintSummary,SimplifyModel

(1.1)

Import the System

We import the model with the following command.  We need to specify the name of the model to import, as well as a MATLAB® script that initializes the variable names.

 

datadirBlockImporter:-DataDirectory:

model1  Importm_f14,path=datadir, init=f14_init,inplace:

 

Using the Summary command, we can view the model that we have imported.

 

PrintSummarymodel1

K0,Ka=0.677000000000000046,K0,Kf=1.74600000000000000,K0,Ki=3.86399999999999988,K0,Kq=0.815599999999999992,K0,Md=6.88469999999999960,K0,Mq=0.657100000000000017,K0,Mw=0.00591999999999999992,K0,Swg=3.,K0,Ta=0.0500000000000000028,K0,Tal=0.395899999999999974,K0,Ts=0.100000000000000006,K0,Uo=689.399999999999977,K0,Vto=690.399999999999977,K0,W1=2.97100000000000009,K0,W2=4.14400000000000013,K0,Zd=63.9979000000000013,K0,Zw=0.638499999999999956,K0,a=2.53480000000000016,K0,b=64.1299999999999955

(2.1)

 

We can now simplify the model to reduce the number of equations.

smodel1  SimplifyModelmodel1:

PrintSummarysmodel1

K0,Ka=0.677000000000000046,K0,Kf=1.74600000000000000,K0,Ki=3.86399999999999988,K0,Kq=0.815599999999999992,K0,Md=6.88469999999999960,K0,Mq=0.657100000000000017,K0,Mw=0.00591999999999999992,K0,Swg=3.,K0,Ta=0.0500000000000000028,K0,Tal=0.395899999999999974,K0,Ts=0.100000000000000006,K0,Uo=689.399999999999977,K0,Vto=690.399999999999977,K0,W1=2.97100000000000009,K0,W2=4.14400000000000013,K0,Zd=63.9979000000000013,K0,Zw=0.638499999999999956,K0,a=2.53480000000000016,K0,b=64.1299999999999955

(2.2)

Simulate the System

First we take the system and build a set of differential equations, and assign the result to the variable sys.

sys1BuildDEsmodel1

recordequations,initialeqs,known,outputvars,parameters,sourceeqs

(3.1)

The following table illustrates the different components of the variable sys1.

Differential Equations

sys1:equations

ⅆⅆtx3,1t=K0,Kfⅆⅆtx33,1tK0,Ta+x33,1tK0,KiK0,Tax3,1tK0,Ta,ⅆⅆtx15,1t=3K0,SwgK0,TaK0,ZwK0,ax26,2t+K0,Uox16,1tK0,a3K0,Ta+K0,Zwx15,1tK0,a3K0,TaK0,SwgK0,TaK0,Zwx26,1t+K0,Zdx3,1tK0,a3K0,a3K0,Ta,ⅆⅆtx16,1t=11616K0,Mqx16,1tK0,b2K0,a3K0,Ta+16K0,Mwx15,1tK0,b2K0,a3K0,Ta43πK0,MqK0,SwgK0,TaK0,aK0,bx26,2t+K0,a3π2K0,MqK0,TaK0,Vtox25,1t4πK0,MqK0,SwgK0,TaK0,bx26,1t163K0,MwK0,SwgK0,TaK0,aK0,b2x26,2t16K0,MwK0,SwgK0,TaK0,b2x26,1t+16K0,Mdx3,1tK0,b2K0,a3K0,b2K0,a3K0,Ta,ⅆⅆtx25,1t=144x26,2t3K0,SwgK0,aK0,b+πK0,Vtox25,1tK0,a34x26,1tK0,SwgK0,bK0,a3K0,b,ⅆⅆtx26,1t=x26,2t,ⅆⅆtx26,2t=u1,1,1tK0,a22x26,2tK0,ax26,1tK0,a2,ⅆⅆtx32,1t=K0,W2x32,1t+x16,1t,SinkScope,34,1,1t=x15,1tK0,Uo,SinkScope,34,2,1t=x16,1t,ⅆⅆtx35,1t=x15,1tK0,Talx35,1tK0,UoK0,UoK0,Tal,ⅆⅆtx37,1t=SourceSigGen,36,1tK0,Tsx37,1tK0,Ts,ⅆⅆtx33,1t=K0,KqK0,TalK0,TsK0,W1x32,1tK0,KqK0,TalK0,TsK0,W2x32,1t+K0,KqK0,TalK0,Tsx16,1t+K0,Kax35,1tK0,Tsx37,1tK0,TalK0,TsK0,Tal

(3.2)

Parameter values

sys1:-parameters

K0,Ka=0.677000000000000046,K0,Kf=1.74600000000000000,K0,Ki=3.86399999999999988,K0,Kq=0.815599999999999992,K0,Md=6.88469999999999960,K0,Mq=0.657100000000000017,K0,Mw=0.00591999999999999992,K0,Swg=3.,K0,Ta=0.0500000000000000028,K0,Tal=0.395899999999999974,K0,Ts=0.100000000000000006,K0,Uo=689.399999999999977,K0,Vto=690.399999999999977,K0,W1=2.97100000000000009,K0,W2=4.14400000000000013,K0,Zd=63.9979000000000013,K0,Zw=0.638499999999999956,K0,a=2.53480000000000016,K0,b=64.1299999999999955

(3.3)

Initial conditions

sys1:-initialeqs

x3,10=0,x15,10=0,x16,10=0,x25,10=0,x26,10=0,x26,20=0,x32,10=0,x33,10=0,x35,10=0,x37,10=0

(3.4)

Equations for the sources (inputs)

sys1:-sourceeqs

u1&comma;1&comma;1t&equals;0&comma;SourceSigGen&comma;36&comma;1t&equals;&lcub;1t4.000000000&pi;trunc0.2500000000t&pi;<2.000000000&pi;1otherwise

(3.5)

List of sinks (outputs)

sys1:-outputvars

SinkScope&comma;34&comma;1&comma;1t&comma;SinkScope&comma;34&comma;2&comma;1t

(3.6)

Using the information in the variable sys, we construct a simulation procedure.

sol1  dsolveevalevalsys1:-equations&comma; sys1:-parameters&comma;sys1:-sourceeqs&comma; sys1:-initialeqs&comma; numeric

procx_rkf45_dae...end proc

(3.7)

Then we plot the simulation results.

plotsodeplotsol1&comma; t&comma; sys1:-outputvars1&comma; 0..20&comma; numpoints&equals;200&comma; title&equals;Angle-of-attack

plotsodeplotsol1&comma; t&comma; sys1:-outputvars2&comma; 0..20&comma; numpoints&equals;200&comma; title&equals;Rate of pitch

 

Import the Subsystem

First we want to close the Simulink model without saving it, so we can reload it with the subsystem.  We send the command close_system('m_f14', 0) through the link to MATLAB®.

Matlab:-evalMclose_system ('m_f14',0)

 

We can import a subsystem from the model.

 

model2  Importm_f14&comma; m_f14/Aircraft dynamics&comma; path&equals;datadir&comma; init&equals;f14_init&comma;inplace&equals;true&colon;

The set of equations are simplified and the simplified set of equations is printed using the PrintSummary command.

smodel2  SimplifyModelmodel2&colon;

PrintSummarysmodel2&colon;

K0&comma;Md&equals;6.88469999999999960&comma;K0&comma;Mq&equals;0.657100000000000017&comma;K0&comma;Mw&equals;0.00591999999999999992&comma;K0&comma;Uo&equals;689.399999999999977&comma;K0&comma;Zd&equals;63.9979000000000013&comma;K0&comma;Zw&equals;0.638499999999999956

(4.1)

 

The differential equations are created.

sys2 BuildDEsmodel2

recordequations&comma;initialeqs&comma;known&comma;outputvars&comma;parameters&comma;sourceeqs

(4.2)

 

The following table illustrates the different components of the variable sys2.

Differential Equations

sys2:-equations

y1&comma;1&comma;1t&equals;x12&comma;1tK0&comma;Uo&comma;&DifferentialD;&DifferentialD;tx12&comma;1t&equals;K0&comma;Uoy1&comma;2&comma;1t&plus;K0&comma;Zdu1&comma;1&comma;1t&plus;K0&comma;Zwx12&comma;1tu1&comma;2&comma;1t&comma;&DifferentialD;&DifferentialD;tx13&comma;1t&equals;K0&comma;Mdu1&comma;1&comma;1t&plus;K0&comma;Mqx13&comma;1t&plus;K0&comma;Mwx12&comma;1tu1&comma;3&comma;1t&comma;y1&comma;2&comma;1t&equals;x13&comma;1t

(4.3)

Parameter values

sys2:-parameters

K0&comma;Md&equals;6.88469999999999960&comma;K0&comma;Mq&equals;0.657100000000000017&comma;K0&comma;Mw&equals;0.00591999999999999992&comma;K0&comma;Uo&equals;689.399999999999977&comma;K0&comma;Zd&equals;63.9979000000000013&comma;K0&comma;Zw&equals;0.638499999999999956

(4.4)

Initial conditions

sys2:-initialeqs

x12&comma;10&equals;0&comma;x13&comma;10&equals;0

(4.5)

Equations for the sources (inputs)

sys2:-sourceeqs

u1&comma;1&comma;1t&equals;0&comma;u1&comma;2&comma;1t&equals;0&comma;u1&comma;3&comma;1t&equals;0

(4.6)

List of sinks (outputs)

sys2:-outputvars

y1&comma;1&comma;1t&comma;y1&comma;2&comma;1t

(4.7)


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