├── .DS_Store ├── .gitignore ├── F16.slx ├── F16AeroData.h5 ├── F16AeroDataInterpolants.mat ├── F16AeroFM.m ├── F16Testing.slx ├── F16_2022a.mdl ├── F16_2023a.mdl ├── F16_Julia_Dump.mat ├── JuliaF16Model.ipynb ├── LICENSE ├── README.md ├── TrimF16.m ├── conversion.m ├── load_F16_params.m ├── load_aerodynamics.m ├── plot_trajectories.m ├── preprocess_F16_AeroData.m ├── runF16.m ├── test_with_julia.m └── trim_and_linearize.m /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isrlab/F16-Model-Matlab/d019742f2fe7f5f25c521bc7e846519b28b759b3/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.asv 2 | *.slxc 3 | slprj/ 4 | 5 | -------------------------------------------------------------------------------- /F16.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isrlab/F16-Model-Matlab/d019742f2fe7f5f25c521bc7e846519b28b759b3/F16.slx -------------------------------------------------------------------------------- /F16AeroData.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isrlab/F16-Model-Matlab/d019742f2fe7f5f25c521bc7e846519b28b759b3/F16AeroData.h5 -------------------------------------------------------------------------------- /F16AeroDataInterpolants.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isrlab/F16-Model-Matlab/d019742f2fe7f5f25c521bc7e846519b28b759b3/F16AeroDataInterpolants.mat -------------------------------------------------------------------------------- /F16AeroFM.m: -------------------------------------------------------------------------------- 1 | % ========================== 2 | % Developed by 3 | % Raktim Bhattacharya, 4 | % Professor 5 | % Aerospace Engineering, 6 | % Texas A&M University. 7 | % ========================== 8 | 9 | function FM = F16AeroFM(inp) 10 | 11 | persistent Param F16Aero r2d persistent_flag 12 | if isempty(persistent_flag) 13 | persistent_flag = 1; 14 | Param = load_F16_params(); % System Parameters, mass, inertia, etc. 15 | Data = load('F16AeroDataInterpolants.mat'); 16 | F16Aero = Data.F16AeroData; 17 | r2d = 180/pi; 18 | end 19 | 20 | Vt = inp(1); 21 | alpha = inp(2)*r2d; % Convert to degrees for aero table look up. 22 | beta = inp(3)*r2d; % Convert to degrees for aero table look up. 23 | om = inp(4:6); 24 | qbar = inp(7); 25 | ele = inp(8)*r2d; % Convert to degrees for aero table look up. 26 | ail = inp(9)*r2d; % Convert to degrees for aero table look up. 27 | rud = inp(10)*r2d; % Convert to degrees for aero table look up. 28 | lef = inp(11)*r2d; % Convert to degrees for aero table look up. 29 | 30 | p = om(1); 31 | q = om(2); 32 | r = om(3); 33 | 34 | dail = ail/21.5; % Aileron angle normalized against max deflection 35 | drud = rud/30.0; % Rudder normalized against max angle 36 | dlef = (1 - lef/25.0); % Leading edge flap normalized against max angle 37 | 38 | 39 | % Interpolate aerodynamics data 40 | % ============================= 41 | Cx = F16Aero.Cx(alpha,beta,ele); 42 | Cy = F16Aero.Cy(alpha,beta); 43 | Cz = F16Aero.Cz(alpha,beta,ele); 44 | Cm = F16Aero.Cm(alpha,beta,ele); 45 | Cn = F16Aero.Cn(alpha,beta,ele); 46 | Cl = F16Aero.Cl(alpha,beta,ele); 47 | 48 | delta_Cx_lef = F16Aero.Cx_lef(alpha,beta) - F16Aero.Cx(alpha,beta,0.0); 49 | delta_Cy_lef = F16Aero.Cy_lef(alpha,beta) - F16Aero.Cy(alpha,beta); 50 | delta_Cz_lef = F16Aero.Cz_lef(alpha,beta) - F16Aero.Cz(alpha,beta,0.0); 51 | 52 | delta_Cl_lef = F16Aero.Cl_lef(alpha,beta) - F16Aero.Cl(alpha,beta,0.0); 53 | delta_Cm_lef = F16Aero.Cm_lef(alpha,beta) - F16Aero.Cm(alpha,beta,0.0); 54 | delta_Cn_lef = F16Aero.Cn_lef(alpha,beta) - F16Aero.Cn(alpha,beta,0.0); 55 | 56 | Cxq = F16Aero.Cxq(alpha); 57 | Cyr = F16Aero.Cyr(alpha); 58 | Cyp = F16Aero.Cyp(alpha); 59 | Czq = F16Aero.Czq(alpha); 60 | Clr = F16Aero.Clr(alpha); 61 | Clp = F16Aero.Clp(alpha); 62 | Cmq = F16Aero.Cmq(alpha); 63 | Cnr = F16Aero.Cnr(alpha); 64 | Cnp = F16Aero.Cnp(alpha); 65 | 66 | delta_Cxq_lef = F16Aero.deltaCxq_lef(alpha); 67 | delta_Cyr_lef = F16Aero.deltaCyr_lef(alpha); 68 | delta_Cyp_lef = F16Aero.deltaCyp_lef(alpha); 69 | delta_Czq_lef = F16Aero.deltaCzq_lef(alpha); 70 | delta_Clr_lef = F16Aero.deltaClr_lef(alpha); 71 | delta_Clp_lef = F16Aero.deltaClp_lef(alpha); 72 | delta_Cmq_lef = F16Aero.deltaCmq_lef(alpha); 73 | delta_Cnr_lef = F16Aero.deltaCnr_lef(alpha); 74 | delta_Cnp_lef = F16Aero.deltaCnp_lef(alpha); 75 | 76 | delta_Cy_r30 = F16Aero.Cy_r30(alpha,beta) - F16Aero.Cy(alpha,beta); 77 | delta_Cn_r30 = F16Aero.Cn_r30(alpha,beta) - F16Aero.Cn(alpha,beta,0.0); 78 | delta_Cl_r30 = F16Aero.Cl_r30(alpha,beta) - F16Aero.Cl(alpha,beta,0.0); 79 | 80 | delta_Cy_a20 = F16Aero.Cy_a20(alpha,beta) - F16Aero.Cy(alpha,beta); 81 | delta_Cy_a20_lef = F16Aero.Cy_a20_lef(alpha,beta) - F16Aero.Cy_lef(alpha,beta) - delta_Cy_a20; 82 | 83 | delta_Cn_a20 = F16Aero.Cn_a20(alpha,beta) - F16Aero.Cn(alpha,beta,0.0); 84 | delta_Cn_a20_lef = F16Aero.Cn_a20_lef(alpha,beta) - F16Aero.Cn_lef(alpha,beta) - delta_Cn_a20; 85 | 86 | delta_Cl_a20 = F16Aero.Cl_a20(alpha,beta) - F16Aero.Cl(alpha,beta,0.0); 87 | delta_Cl_a20_lef = F16Aero.Cl_a20_lef(alpha,beta) - F16Aero.Cl_lef(alpha,beta) - delta_Cl_a20; 88 | 89 | delta_Cnbeta = F16Aero.deltaCnbeta(alpha); 90 | delta_Clbeta = F16Aero.deltaClbeta(alpha); 91 | delta_Cm = F16Aero.deltaCm(alpha); 92 | eta_el = F16Aero.eta_el(ele); 93 | delta_Cm_ds = 0; % Ignore deep-stall effects. 94 | 95 | % Compute total aerodynamic coefficients 96 | % ====================================== 97 | % Compute total Cx 98 | dXdq = (Param.cbar/(2*Vt))*(Cxq + delta_Cxq_lef*dlef); 99 | Cx_tot = Cx + delta_Cx_lef*dlef + dXdq*q; 100 | 101 | % Compute total Cz 102 | dZdq = (Param.cbar/(2*Vt))*(Czq + delta_Cz_lef*dlef); 103 | Cz_tot = Cz + delta_Cz_lef*dlef + dZdq*q; 104 | 105 | % Compute total Cm 106 | dMdq = (Param.cbar/(2*Vt))*(Cmq + delta_Cmq_lef*dlef); 107 | Cm_tot = Cm*eta_el + Cz_tot*(Param.xcgr - Param.xcg) + delta_Cm_lef*dlef + dMdq*q + delta_Cm + delta_Cm_ds; 108 | 109 | % Compute total Cy 110 | dYdail = delta_Cy_a20 + delta_Cy_a20_lef*dlef; 111 | dYdr = (Param.b/(2*Vt))*(Cyr + delta_Cyr_lef*dlef); 112 | dYdp = (Param.b/(2*Vt))*(Cyp + delta_Cyp_lef*dlef); 113 | Cy_tot = Cy + delta_Cy_lef*dlef + dYdail*dail + delta_Cy_r30*drud + dYdr*r + dYdp*p; 114 | 115 | % Compute total Cn 116 | dNdail = delta_Cn_a20 + delta_Cn_a20_lef*dlef; 117 | dNdr = (Param.b/(2*Vt))*(Cnr + delta_Cnr_lef*dlef); 118 | dNdp = (Param.b/(2*Vt))*(Cnp + delta_Cnp_lef*dlef); 119 | Cn_tot = Cn + delta_Cn_lef*dlef - Cy_tot*(Param.xcgr - Param.xcg)*(Param.cbar/Param.b) + dNdail*dail + delta_Cn_r30*drud + dNdr*r + dNdp*p + delta_Cnbeta*beta; 120 | 121 | % Compute total Cl 122 | dLdail = delta_Cl_a20 + delta_Cl_a20_lef*dlef; 123 | dLdr = (Param.b/(2*Vt))*(Clr + delta_Clr_lef*dlef); 124 | dLdp = (Param.b/(2*Vt))*(Clp + delta_Clp_lef*dlef); 125 | Cl_tot = Cl + delta_Cl_lef*dlef + dLdail*dail + delta_Cl_r30*drud + dLdr*r + dLdp*p + delta_Clbeta*beta; 126 | 127 | % Compute forces 128 | Fx = qbar*Param.S*Cx_tot; 129 | Fy = qbar*Param.S*Cy_tot; 130 | Fz = qbar*Param.S*Cz_tot; 131 | 132 | % Compute moments 133 | L = Cl_tot*qbar*Param.S*Param.b; 134 | M = Cm_tot*qbar*Param.S*Param.cbar; 135 | N = Cn_tot*qbar*Param.S*Param.b; 136 | 137 | 138 | % Fb = [Fx,Fy,Fz]; 139 | % Mb = [L,M,N]; 140 | 141 | FM = [Fx,Fy,Fz,L,M,N]; 142 | 143 | if isnan(norm(FM)) 144 | keyboard 145 | end 146 | 147 | end 148 | -------------------------------------------------------------------------------- /F16Testing.slx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isrlab/F16-Model-Matlab/d019742f2fe7f5f25c521bc7e846519b28b759b3/F16Testing.slx -------------------------------------------------------------------------------- /F16_2022a.mdl: -------------------------------------------------------------------------------- 1 | # MathWorks OPC Text Package 2 | Model { 3 | Version 10.5 4 | Description "Simulink model exported from R2024b to R2022a format" 5 | } 6 | __MWOPC_PACKAGE_BEGIN__ R2024b 7 | __MWOPC_PART_BEGIN__ /[Content_Types].xml 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | __MWOPC_PART_BEGIN__ /_rels/.rels 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | __MWOPC_PART_BEGIN__ /metadata/coreProperties.xml 40 | 41 | 42 | model 43 | 44 | 2022-01-03T18:52:29Z 45 | sherpa 46 | sherpa 47 | 2025-02-07T04:25:52Z 48 | 9.4 49 | R2022a 50 | 51 | 52 | __MWOPC_PART_BEGIN__ /metadata/mwcoreProperties.xml 53 | 54 | 55 | application/vnd.mathworks.simulink.model 56 | Simulink Model 57 | R2022a 58 | 59 | 60 | __MWOPC_PART_BEGIN__ /metadata/mwcorePropertiesExtension.xml 61 | 62 | 63 | 2bc3bc68-94db-46af-bf99-4bd93440a67d 64 | 65 | 66 | __MWOPC_PART_BEGIN__ /simulink/_rels/blockdiagram.xml.rels 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | __MWOPC_PART_BEGIN__ /simulink/_rels/configSetInfo.xml.rels 79 | 80 | 81 | 82 | 83 | 84 | __MWOPC_PART_BEGIN__ /simulink/bddefaults.xml 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | __MWOPC_PART_BEGIN__ /simulink/blockdiagram.xml 97 | 98 | 99 | 100 |

277a7258-65a5-482f-ab5f-cc4d492c78ee

101 |

maca64

102 | 103 |

%<Auto>

104 |

%<Auto>

105 |

%<AutoIncrement:4.0>

106 |
107 | 108 |

normal

109 | 110 |

$bdroot

111 |

0U

112 | 113 | $bdroot 114 | 115 | 116 | [] 117 | 118 |
119 |
120 | 121 |

warning

122 |
123 | 124 | 125 |

Ensure deterministic transfer (maximum delay)

126 |

Ensure data integrity only

127 |

Ensure deterministic transfer (minimum delay)

128 |

None

129 |
130 |
131 | 132 |
133 |
134 | 135 | __MWOPC_PART_BEGIN__ /simulink/configSet0.xml 136 | 137 | 138 | 139 |

[]

140 |

141 | 142 | 143 |

[]

144 |

145 |

[]

146 |

0.0

147 |

Tend

148 |

auto

149 |

on

150 |

auto

151 |

auto

152 |

5

153 |

auto

154 |

10*128*eps

155 |

1000

156 |

4

157 |

1

158 |

auto

159 |

auto

160 |

1

161 |

1e-3

162 |

off

163 |

off

164 |

off

165 |

VariableStepAuto

166 |

auto

167 |

auto

168 |

DisableAll

169 |

UseLocalSettings

170 |

Nonadaptive

171 |

TrustRegion

172 |

on

173 |

off

174 |

Fast

175 |

off

176 |

off

177 |

Unconstrained

178 |

Whenever possible

179 |

[]

180 |

off

181 |

off

182 |

ode3

183 |

off

184 |

2

185 |

10

186 |
187 | 188 |

[]

189 |

190 |

[]

191 |

1

192 |

193 |

xFinal

194 |

195 |

off

196 |

1000

197 |

off

198 |

off

199 |

off

200 |

off

201 |

Dataset

202 |

Dataset

203 |

on

204 |

off

205 |

on

206 |

on

207 |

on

208 |

off

209 |

on

210 |

off

211 |

streamout

212 |

on

213 |

on

214 |

xout

215 |

tout

216 |

yout

217 |

logsout

218 |

dsmout

219 |

RefineOutputTimes

220 |

[]

221 |

out

222 |

1

223 |

off

224 |

timeseries

225 |

out.mat

226 |

[-inf, inf]

227 |
228 | 229 | 230 | BooleansAsBitfields 231 | PassReuseOutputArgsAs 232 | PassReuseOutputArgsThreshold 233 | ZeroExternalMemoryAtStartup 234 | ZeroInternalMemoryAtStartup 235 | OptimizeModelRefInitCode 236 | NoFixptDivByZeroProtection 237 | UseSpecifiedMinMax 238 | EfficientTunableParamExpr 239 | 240 |

241 |

[]

242 |

on

243 |

on

244 |

on

245 |

Tunable

246 |

off

247 |

off

248 |

off

249 |

off

250 |

double

251 |

off

252 |

off

253 |

on

254 |

on

255 |

off

256 |

off

257 |

on

258 |

off

259 |

260 |

on

261 |

off

262 |

uint_T

263 |

Same as modeled

264 |

on

265 |

64

266 |

Structure reference

267 |

12

268 |

128

269 |

on

270 |

5

271 |

off

272 |

off

273 |

Native Integer

274 |

on

275 |

on

276 |

off

277 |

off

278 |

off

279 |

on

280 |

auto

281 |

Inherit from target

282 |

on

283 |

off

284 |

off

285 |

off

286 |

on

287 |

on

288 |

off

289 |

off

290 |

level2

291 |

Balanced

292 |

on

293 |

off

294 |

off

295 |

GradualUnderflow

296 |

off

297 |
298 | 299 | 300 | UseOnlyExistingSharedCode 301 | 302 |

303 |

[]

304 |

error

305 |

none

306 |

none

307 |

none

308 |

error

309 |

none

310 |

UseLocalSettings

311 |

UseLocalSettings

312 |

UseLocalSettings

313 |

warning

314 |

warning

315 |

warning

316 |

warning

317 |

on

318 |

Simplified

319 |

error

320 |

off

321 |

UseLocalSettings

322 |

warning

323 |

warning

324 |

none

325 |

error

326 |

warning

327 |

warning

328 |

none

329 |

warning

330 |

error

331 |

error

332 |

error

333 |

none

334 |

warning

335 |

none

336 |

warning

337 |

none

338 |

warning

339 |

warning

340 |

error

341 |

error

342 |

none

343 |

warning

344 |

warning

345 |

none

346 |

none

347 |

none

348 |

none

349 |

none

350 |

none

351 |

error

352 |

none

353 |

warning

354 |

warning

355 |

warning

356 |

error

357 |

none

358 |

error

359 |

none

360 |

warning

361 |

warning

362 |

UseLocalSettings

363 |

on

364 |

off

365 |

error

366 |

none

367 |

none

368 |

warning

369 |

warning

370 |

none

371 |

warning

372 |

none

373 |

warning

374 |

error

375 |

warning

376 |

none

377 |

warning

378 |

ErrorLevel1

379 |

WarnAndRepair

380 |

none

381 |

warning

382 |

warning

383 |

error

384 |

error

385 |

none

386 |

warning

387 |

error

388 |

warning

389 |

error

390 |

warning

391 |

warning

392 |

warning

393 |

warning

394 |

error

395 |

warning

396 |

warning

397 |

warning

398 |

warning

399 |

all

400 |

warning

401 |

on

402 |

warning

403 |

warning

404 |

off

405 |

406 |

none

407 |

off

408 |

error

409 |

none

410 |
411 | 412 |

[]

413 |

414 |

[]

415 |

8

416 |

16

417 |

32

418 |

32

419 |

64

420 |

32

421 |

64

422 |

64

423 |

64

424 |

64

425 |

Char

426 |

Float

427 |

Zero

428 |

LittleEndian

429 |

64

430 |

on

431 |

off

432 |

Intel->x86-64 (Windows64)

433 |

8

434 |

16

435 |

32

436 |

32

437 |

64

438 |

32

439 |

64

440 |

32

441 |

32

442 |

32

443 |

Char

444 |

None

445 |

on

446 |

off

447 |

Undefined

448 |

Unspecified

449 |

32

450 |

32

451 |

32

452 |

Specified

453 |

off

454 |

on

455 |

on

456 |

on

457 |

EmbeddedCoderHSP

458 |
459 | 460 |

[]

461 |

462 |

[]

463 |

IfOutOfDateOrStructuralChange

464 |

on

465 |

error

466 |

off

467 |

on

468 |

None

469 |

Multi

470 |

Infer from blocks in model

471 |

472 |

on

473 |

off

474 |

on

475 |

off

476 |

off

477 |
478 | 479 |

[]

480 |

481 |

[]

482 |

483 |

484 |

485 |

486 |

[]

487 |

488 |

489 |

490 |

491 |

492 |

493 |

on

494 |

on

495 |

on

496 |

on

497 |

on

498 |

off

499 |

off

500 |

off

501 |

on

502 |

50

503 |

on

504 |

on

505 |

on

506 |

65536

507 |

off

508 |

[]

509 |

NotSpecified

510 |

FilterOut

511 |

off

512 |

None

513 |

514 |

generic

515 |

C

516 |

off

517 |

200

518 |

1024

519 |

off

520 |

521 |

522 |

mkl-dnn

523 |

on

524 |
525 | 526 | 527 | IncludeHyperlinkInReport 528 | GenerateTraceInfo 529 | GenerateTraceReport 530 | GenerateTraceReportSl 531 | GenerateTraceReportSf 532 | GenerateTraceReportEml 533 | PortableWordSizes 534 | GenerateWebview 535 | GenerateCodeMetricsReport 536 | GenerateCodeReplacementReport 537 | GenerateMissedCodeReplacementReport 538 | GenerateErtSFunction 539 | CreateSILPILBlock 540 | CodeProfilingInstrumentation 541 | CodeStackProfiling 542 | 543 |

544 |

grt.tlc

545 |

546 |

None

547 |

off

548 |

off

549 |

550 |

off

551 |

make_rtw

552 |

on

553 |

off

554 |

555 |

grt_default_tmf

556 |

557 |

off

558 |

on

559 |

off

560 |

[]

561 |

off

562 |

off

563 |

off

564 |

off

565 |

on

566 |

off

567 |

568 |

569 |

570 |

571 |

572 |

573 |

574 |

575 |

576 |

577 |

578 |

Automatically locate an installed toolchain

579 |

Faster Builds

580 |

[]

581 |

off

582 |

off

583 |

off

584 |

None

585 |

off

586 |

executionProfile

587 |

SummaryOnly

588 |

off

589 |

off

590 |

stackProfile

591 |

off

592 |

C

593 |

None

594 |

off

595 |

off

596 |

off

597 |

off

598 |

off

599 |

off

600 |

off

601 |

off

602 |

off

603 |

off

604 |

off

605 |

[]

606 |

607 |

Off

608 |

1024

609 |

610 |

-1

611 |

discrete

612 |

200

613 |

off

614 |

1024

615 |

on

616 |

on

617 |

on

618 |

off

619 |

3.5

620 |

621 |

622 |

0

623 |

none

624 |

on

625 |

19.05

626 |

unspecified

627 | 628 | 629 | 630 | IgnoreCustomStorageClasses 631 | IgnoreTestpoints 632 | BlockCommentType 633 | InsertBlockDesc 634 | InsertPolySpaceComments 635 | SFDataObjDesc 636 | MATLABFcnDesc 637 | SimulinkDataObjDesc 638 | DefineNamingRule 639 | SignalNamingRule 640 | ParamNamingRule 641 | InternalIdentifier 642 | InlinedPrmAccess 643 | CustomSymbolStr 644 | CustomSymbolStrGlobalVar 645 | CustomSymbolStrType 646 | CustomSymbolStrField 647 | CustomSymbolStrFcn 648 | CustomSymbolStrModelFcn 649 | CustomSymbolStrFcnArg 650 | CustomSymbolStrBlkIO 651 | CustomSymbolStrTmpVar 652 | CustomSymbolStrMacro 653 | CustomSymbolStrUtil 654 | CustomSymbolStrEmxType 655 | CustomSymbolStrEmxFcn 656 | CustomUserTokenString 657 | ReqsInCode 658 | 659 |

660 |

[]

661 |

662 |

off

663 |

on

664 |

Auto

665 |

on

666 |

off

667 |

31

668 |

off

669 |

off

670 |

off

671 |

off

672 |

off

673 |

off

674 |

off

675 |

1

676 |

8

677 |

$R$N$M

678 |

$N$R$M_T

679 |

$N$M

680 |

$R$N$M$F

681 |

$R$N

682 |

rt$I$N$M

683 |

rtb_$N$M

684 |

$N$M

685 |

$R$N$M

686 |

$N$C

687 |

emxArray_$M$N

688 |

emx$M$N

689 |

690 |

691 |

None

692 |

693 |

None

694 |

695 |

None

696 |

697 |

off

698 |

off

699 |

on

700 |

BlockPathComment

701 |

off

702 |

off

703 |

off

704 |

705 |

Shortened

706 |

Literals

707 |

off

708 |

off

709 |

[]

710 |

error

711 |
712 | 713 | 714 | IncludeMdlTerminateFcn 715 | SuppressErrorStatus 716 | ERTCustomFileBanners 717 | GenerateSampleERTMain 718 | ExistingSharedCode 719 | GenerateTestInterfaces 720 | ModelStepFunctionPrototypeControlCompliant 721 | GenerateAllocFcn 722 | PurelyIntegerCode 723 | SupportComplex 724 | SupportAbsoluteTime 725 | SupportContinuousTime 726 | SupportNonInlinedSFcns 727 | RemoveDisableFunc 728 | RemoveResetFunc 729 | PreserveStateflowLocalDataDimensions 730 | ParenthesesLevel 731 | ERTMultiwordTypeDef 732 | MultiwordTypeDef 733 | 734 |

735 |

[]

736 |

ansi_tfl_table_tmw.mat

737 |

738 |

739 |

NOT IN USE

740 |

C99 (ISO)

741 |

None

742 |

Auto

743 |

System defined

744 |

2048

745 |

256

746 |

on

747 |

off

748 |

749 |

off

750 |

off

751 |

on

752 |

on

753 |

on

754 |

on

755 |

on

756 |

on

757 |

off

758 |

off

759 |

off

760 |

Auto

761 |

off

762 |

on

763 |

rt_

764 |

on

765 |

Nonreusable function

766 |

off

767 |

on

768 |

on

769 |

on

770 |

on

771 |

off

772 |

off

773 |

off

774 |

Nominal

775 |

Nominal

776 |

Simulink.SoftwareTarget.GRTCustomization

777 |

off

778 |

on

779 |

off

780 |

off

781 |

off

782 |

off

783 |

on

784 |

on

785 |

[]

786 |

[]

787 |

1,2,3,4,...

788 |

Size,Breakpoints,Table

789 |

Size,Breakpoints,Table

790 |

Column-major

791 |

error

792 |

$R$E

793 |

$R$E

794 |

$R_data

795 | 796 | None 797 | 798 |

off

799 |

off

800 |

off

801 |

off

802 |

off

803 |

1000000

804 |

0

805 |

ext_comm

806 |

807 |

Level1

808 |

off

809 |

off

810 |

off

811 |

off

812 |

off

813 |

Error

814 |
815 |
816 |
817 | 818 |

[]

819 |

Simulink Coverage Configuration Component

820 |

[]

821 |

Simulink Coverage

822 |

off

823 |

EntireSystem

824 |

on

825 |

off

826 |

/

827 |

covdata

828 |

829 |

dwe

830 |

831 |

832 |

off

833 |

on

834 |

on

835 |

off

836 |

off

837 |

covCumulativeData

838 |

off

839 |

on

840 |

slcov_output/$ModelName$

841 |

$ModelName$_cvdata

842 |

on

843 |

off

844 |

845 |

on

846 |

on

847 |

1e-05

848 |

0.01

849 |

off

850 |

0

851 |

0

852 |

Masking

853 |

off

854 |
855 |
856 |

Configuration

857 |

Data Import//Export

858 |

[ 625, 229, 971, 781 ]

859 |

860 |

861 |
862 | 863 | __MWOPC_PART_BEGIN__ /simulink/configSetInfo.xml 864 | 865 | 866 | Configuration 867 | 868 | 869 | __MWOPC_PART_BEGIN__ /simulink/graphicalInterface.xml 870 | 871 | 872 |

5

873 | 874 |

875 |

off

876 |

off

877 |

-1

878 |

inherit

879 |
880 | 881 |

882 |

off

883 |

off

884 |

-1

885 |

inherit

886 |
887 | 888 |

889 |

off

890 |

off

891 |

-1

892 |

inherit

893 |
894 | 895 |

896 |

off

897 |

off

898 |

-1

899 |

inherit

900 |
901 | 902 |

903 |

off

904 |

off

905 |

-1

906 |

inherit

907 |
908 |

11

909 | 910 |

911 |

off

912 |

Xe

913 |

inherit

914 |

off

915 |
916 | 917 |

918 |

off

919 |

Ve

920 |

inherit

921 |

off

922 |
923 | 924 |

925 |

off

926 |

Vt

927 |

inherit

928 |

off

929 |
930 | 931 |

932 |

off

933 |

alpha

934 |

inherit

935 |

off

936 |
937 | 938 |

939 |

off

940 |

beta

941 |

inherit

942 |

off

943 |
944 | 945 |

946 |

off

947 |

EA

948 |

inherit

949 |

off

950 |
951 | 952 |

953 |

off

954 |

gamma

955 |

inherit

956 |

off

957 |
958 | 959 |

960 |

off

961 |

om

962 |

inherit

963 |

off

964 |
965 | 966 |

967 |

off

968 |

accl

969 |

inherit

970 |

off

971 |
972 | 973 |

974 |

off

975 |

ang accl

976 |

inherit

977 |

off

978 |
979 | 980 |

981 |

off

982 |

inherit

983 |

off

984 |
985 |

986 |

0

987 |

0

988 |

0

989 |

0

990 |

0

991 |

0

992 |

0

993 |

Unset

994 |

0

995 |

VariableStepAuto

996 |

0

997 |

Simulink

998 |

0

999 |

5

1000 | 1001 |

shared6dof/6DOF (Euler Angles)

1002 |

$bdroot/Nonlinear F16 Model/6DOF (Quaternion)

1003 |

192

1004 |

LIBRARY_BLOCK

1005 |
1006 | 1007 |

aerolibasang/Dynamic Pressure

1008 |

$bdroot/Nonlinear F16 Model/Dynamic Pressure

1009 |

26

1010 |

LIBRARY_BLOCK

1011 |
1012 | 1013 |

aerolibatmos2/ISA Atmosphere Model

1014 |

$bdroot/Nonlinear F16 Model/ISA Atmosphere Model

1015 |

5

1016 |

LIBRARY_BLOCK

1017 |
1018 | 1019 |

aerolibasang/Incidence, Sideslip, 1020 | & Airspeed

1021 |

$bdroot/Nonlinear F16 Model/Incidence, Sideslip, & Airspeed

1022 |

7

1023 |

LIBRARY_BLOCK

1024 |
1025 | 1026 |

aerolibasang/Mach Number

1027 |

$bdroot/Nonlinear F16 Model/Mach Number

1028 |

200

1029 |

LIBRARY_BLOCK

1030 |
1031 |

1

1032 |
1033 | 1034 | __MWOPC_PART_BEGIN__ /simulink/modelDictionary.xml 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | __MWOPC_PART_BEGIN__ /simulink/plugins/SimscapeModelParametersPlugin.xml 1043 | 1044 | 1045 |

ode23t

1046 |
1047 | 1048 | __MWOPC_PART_BEGIN__ /simulink/ScheduleCore.xml 1049 | 1050 | 1051 | 1052 | 1053 | portFu 1054 | RootInport 1055 | 1056 | 1057 | portIn1 1058 | RootInport 1059 | 1060 | 1061 | portMach 1062 | RootOutport 1063 | 1064 | 1065 | portMu 1066 | RootInport 1067 | 1068 | 1069 | portT 1070 | RootInport 1071 | 1072 | 1073 | portThrust 1074 | RootInport 1075 | 1076 | 1077 | portVt 1078 | RootOutport 1079 | 1080 | 1081 | portX,Y, Z in inertial 1082 | RootOutport 1083 | 1084 | 1085 | portXd,Yd, Zd in inertial 1086 | RootOutport 1087 | 1088 | 1089 | portXe 1090 | RootOutport 1091 | 1092 | 1093 | portail 1094 | RootInport 1095 | 1096 | 1097 | portalpha 1098 | RootOutport 1099 | 1100 | 1101 | portangle of attack 1102 | RootOutport 1103 | 1104 | 1105 | portangular acceleration vector 1106 | RootOutport 1107 | 1108 | 1109 | portangular velocity vector 1110 | RootOutport 1111 | 1112 | 1113 | portangular velocity vector 1114 | (expressed in body) 1115 | RootOutport 1116 | 1117 | 1118 | portbeta 1119 | RootOutport 1120 | 1121 | 1122 | portda 1123 | RootInport 1124 | 1125 | 1126 | portde 1127 | RootInport 1128 | 1129 | 1130 | portdr 1131 | RootInport 1132 | 1133 | 1134 | portele 1135 | RootInport 1136 | 1137 | 1138 | porteuler angles 1139 | RootOutport 1140 | 1141 | 1142 | portflight path angle 1143 | RootOutport 1144 | 1145 | 1146 | portgamma 1147 | RootOutport 1148 | 1149 | 1150 | portgust 1151 | RootInport 1152 | 1153 | 1154 | portlef 1155 | RootInport 1156 | 1157 | 1158 | portlinear acceleration vector 1159 | RootOutport 1160 | 1161 | 1162 | portlinear acceleration vector 1163 | (expressed in body) 1164 | RootOutport 1165 | 1166 | 1167 | portlinear accl 1168 | RootOutport 1169 | 1170 | 1171 | portomega 1172 | RootOutport 1173 | 1174 | 1175 | portrud 1176 | RootInport 1177 | 1178 | 1179 | portside slip angle 1180 | RootOutport 1181 | 1182 | 1183 | porttotal velocity 1184 | RootOutport 1185 | 1186 | HighNumberLast 1187 | 1188 | true 1189 | 1190 | 1191 | 1192 | 1193 | false 1194 | Default 1195 | -2147483648 1196 | 1197 | 1198 | true 1199 | 1200 | false 1201 | 1 1202 | true 1203 | Cont 1204 | 40 1205 | 1206 | Cont 1207 | 255 1208 | true 1209 | 1210 | 0.0 1211 | 1212 | 0 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | __MWOPC_PART_BEGIN__ /simulink/ScheduleEditor.xml 1221 | 1222 | 1223 | 1224 | 1225 | 0,0 1226 | 0,0,0,0 1227 | 1228 | Cont 1229 | base 1230 | 1231 | 0,0 1232 | 1233 | Cont 1234 | graph.Graph 1235 | 1236 | 1237 | 1238 | Default 1239 | graph.Graph 1240 | 1241 | 1242 | 1243 | portFu 1244 | RootInport 1245 | 1246 | 1247 | portIn1 1248 | RootInport 1249 | 1250 | 1251 | portMach 1252 | RootOutport 1253 | 1254 | 1255 | portMu 1256 | RootInport 1257 | 1258 | 1259 | portT 1260 | RootInport 1261 | 1262 | 1263 | portThrust 1264 | RootInport 1265 | 1266 | 1267 | portVt 1268 | RootOutport 1269 | 1270 | 1271 | portX,Y, Z in inertial 1272 | RootOutport 1273 | 1274 | 1275 | portXd,Yd, Zd in inertial 1276 | RootOutport 1277 | 1278 | 1279 | portXe 1280 | RootOutport 1281 | 1282 | 1283 | portail 1284 | RootInport 1285 | 1286 | 1287 | portalpha 1288 | RootOutport 1289 | 1290 | 1291 | portangle of attack 1292 | RootOutport 1293 | 1294 | 1295 | portangular acceleration vector 1296 | RootOutport 1297 | 1298 | 1299 | portangular velocity vector 1300 | RootOutport 1301 | 1302 | 1303 | portangular velocity vector 1304 | (expressed in body) 1305 | RootOutport 1306 | 1307 | 1308 | portbeta 1309 | RootOutport 1310 | 1311 | 1312 | portda 1313 | RootInport 1314 | 1315 | 1316 | portde 1317 | RootInport 1318 | 1319 | 1320 | portdr 1321 | RootInport 1322 | 1323 | 1324 | portele 1325 | RootInport 1326 | 1327 | 1328 | porteuler angles 1329 | RootOutport 1330 | 1331 | 1332 | portflight path angle 1333 | RootOutport 1334 | 1335 | 1336 | portgamma 1337 | RootOutport 1338 | 1339 | 1340 | portgust 1341 | RootInport 1342 | 1343 | 1344 | portlef 1345 | RootInport 1346 | 1347 | 1348 | portlinear acceleration vector 1349 | RootOutport 1350 | 1351 | 1352 | portlinear acceleration vector 1353 | (expressed in body) 1354 | RootOutport 1355 | 1356 | 1357 | portlinear accl 1358 | RootOutport 1359 | 1360 | 1361 | portomega 1362 | RootOutport 1363 | 1364 | 1365 | portrud 1366 | RootInport 1367 | 1368 | 1369 | portside slip angle 1370 | RootOutport 1371 | 1372 | 1373 | porttotal velocity 1374 | RootOutport 1375 | 1376 | 1377 | 1378 | 40 1379 | 1380 | #000000 1381 | true 1382 | 0 1383 | Cont 1384 | 1385 | Cont 1386 | base 1387 | 1388 | 1389 | Cont 1390 | 1391 | 1392 | 1393 | Default 1394 | 1395 | 1396 | 1397 | 1398 | 1399 | __MWOPC_PART_BEGIN__ /simulink/stateflow/_rels/machine.xml.rels 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | __MWOPC_PART_BEGIN__ /simulink/stateflow/chart_8.xml 1406 | 1407 | 1408 |

Nonlinear F16 Model/Transform weight vector to body axis

1409 |

[422 539.941 189 413]

1410 |

[0 156.75 0 153.75]

1411 |

[1 1 3600 1200 1.180555555555556]

1412 |

8

1413 |

6

1414 |

CLUSTER_CHART

1415 |

EML_CHART

1416 |

1

1417 |

1

1418 | 1419 |

fcn

1420 |
1421 | 1422 | 1423 |

eML_blk_kernel()

1424 |

[18 64.5 118 66]

1425 |

12

1426 |

SUBCHART

1427 |

8

1428 |

FUNC_STATE

1429 |

CLUSTER_STATE

1430 | 1431 |

1

1432 |

function Wb = fcn(We,DCM_be) 1433 | Wb = DCM_be*We; % Weight in body coordinate system. DCM_be is correct, no need for transpose. They must have fixed it in this version. 1434 |

1435 |

1

1436 |
1437 |
1438 | 1439 |

INPUT_DATA

1440 | 1441 | 1442 |

-1

1443 |
1444 | 1445 |

SF_INHERITED_TYPE

1446 |

SF_DOUBLE_TYPE

1447 |
1448 |

SF_COMPLEX_INHERITED

1449 | 1450 |

inherit

1451 |
1452 |
1453 |

Inherit: Same as Simulink

1454 |
1455 | 1456 |

OUTPUT_DATA

1457 | 1458 | 1459 |

-1

1460 |
1461 | 1462 |

SF_INHERITED_TYPE

1463 |

SF_DOUBLE_TYPE

1464 |
1465 |

SF_COMPLEX_INHERITED

1466 |

SF_FRAME_NO

1467 | 1468 |

inherit

1469 |
1470 |
1471 |

Inherit: Same as Simulink

1472 |
1473 | 1474 |

INPUT_DATA

1475 | 1476 | 1477 |

-1

1478 |
1479 | 1480 |

SF_INHERITED_TYPE

1481 |

SF_DOUBLE_TYPE

1482 |

1

1483 |

16

1484 |
1485 |

SF_COMPLEX_INHERITED

1486 |

SF_FRAME_INHERITED

1487 | 1488 |

inherit

1489 |
1490 |
1491 |

Inherit: Same as Simulink

1492 |
1493 | 1494 |

{eML_blk_kernel();}

1495 |

[28.125 13.875 102.544 14.964]

1496 |

12

1497 | 1498 |

[0 0 1 0 23.5747 14.625 0 0]

1499 |
1500 | 1501 |

3

1502 |

[1 0 -1 0 23.5747 42.5747 0 0]

1503 |
1504 |

[23.5747 24.9468]

1505 |

[21.175 25.975 14.625 42.575]

1506 |

8

1507 |

SMART

1508 | 1509 |

BOTH_STICK

1510 |
1511 |

1

1512 |
1513 | 1514 |

[23.5747 49.5747 7]

1515 |

8

1516 |

CONNECTIVE_JUNCTION

1517 |
1518 |
1519 |
1520 | 1521 | __MWOPC_PART_BEGIN__ /simulink/stateflow/machine.xml 1522 | 1523 | 1524 | 1525 |

80000049

1526 | 1527 | 1528 |

Default Simulink S-Function Target.

1529 |
1530 | 1531 |
1532 |
1533 | 1534 |

7

1535 |

Nonlinear F16 Model/Transform weight vector to body axis

1536 |

8

1537 |
1538 |
1539 | 1540 | __MWOPC_PART_BEGIN__ /simulink/systems/_rels/system_84.xml.rels 1541 | 1542 | 1543 | 1544 | 1545 | 1546 | 1547 | __MWOPC_PART_BEGIN__ /simulink/systems/_rels/system_root.xml.rels 1548 | 1549 | 1550 | 1551 | 1552 | 1553 | __MWOPC_PART_BEGIN__ /simulink/systems/system_122.xml 1554 | 1555 | 1556 |

[223, 338, 826, 833]

1557 |

40

1558 | 1559 |

[20, 101, 40, 119]

1560 |

-1

1561 |
1562 | 1563 |

[20, 136, 40, 154]

1564 |

13

1565 |

2

1566 |
1567 | 1568 |

[1, 1]

1569 |

[270, 230, 320, 270]

1570 |

30

1571 |

1

1572 |
1573 | 1574 |

Stateflow S-Function 1

1575 |

[2, 2]

1576 |

[180, 100, 230, 160]

1577 |

29

1578 |

sf_sfun

1579 |

[2 2]

1580 |

off

1581 |

on

1582 |

off

1583 | 1584 |

2

1585 |

Wb

1586 |
1587 |
1588 | 1589 |

[460, 241, 480, 259]

1590 |

31

1591 |
1592 | 1593 |

[460, 101, 480, 119]

1594 |

-5

1595 |
1596 | 1597 |

39

1598 |

122::1#out:1

1599 |

[120, 0]

1600 |

122::38#in:1

1601 |
1602 | 1603 |

40

1604 |

122::22#out:1

1605 |

122::38#in:2

1606 |
1607 | 1608 |

Wb

1609 |

41

1610 |

[0, 0]

1611 |

122::38#out:2

1612 |

122::5#in:1

1613 |
1614 | 1615 |

42

1616 |

122::39#out:1

1617 |

122::40#in:1

1618 |
1619 | 1620 |

43

1621 |

122::38#out:1

1622 |

122::39#in:1

1623 |
1624 |
1625 | 1626 | __MWOPC_PART_BEGIN__ /simulink/systems/system_259.xml 1627 | 1628 | 1629 |

[887, 25, 2144, 1030]

1630 |

189

1631 | 1632 |

[-235, -222, -205, -208]

1633 |

-1

1634 |
1635 | 1636 |

[-235, -192, -205, -178]

1637 |

1

1638 |

2

1639 |
1640 | 1641 |

[-235, -162, -205, -148]

1642 |

2

1643 |

3

1644 |
1645 | 1646 |

[-235, -132, -205, -118]

1647 |

3

1648 |

4

1649 |
1650 | 1651 |

[-235, -102, -205, -88]

1652 |

4

1653 |

5

1654 |
1655 | 1656 |

[-235, -72, -205, -58]

1657 |

5

1658 |

6

1659 |
1660 | 1661 |

[-235, -42, -205, -28]

1662 |

6

1663 |

7

1664 |
1665 | 1666 |

[-235, -12, -205, 2]

1667 |

8

1668 |

8

1669 |
1670 | 1671 |

[-235, 18, -205, 32]

1672 |

9

1673 |

9

1674 |
1675 | 1676 |

[1, 2]

1677 |

[260, -94, 265, -56]

1678 |

12

1679 |

2

1680 |
1681 | 1682 |

[1, 1]

1683 |

[75, -95, 145, -65]

1684 |

11

1685 |

F16AeroFM

1686 |

6

1687 |
1688 | 1689 |

[9, 1]

1690 |

[-85, -277, -75, 117]

1691 |

10

1692 |

9

1693 |

bar

1694 |
1695 | 1696 |

[350, -172, 380, -158]

1697 |

-2

1698 |

3

1699 |
1700 | 1701 |

[350, -12, 380, 2]

1702 |

7

1703 |

2

1704 |

3

1705 |
1706 | 1707 |

2

1708 |

264#out:1

1709 |

271#in:4

1710 |
1711 | 1712 |

3

1713 |

263#out:1

1714 |

[59, 0; 0, -15]

1715 |

271#in:3

1716 |
1717 | 1718 |

4

1719 |

265#out:1

1720 |

[71, 0; 0, 15]

1721 |

271#in:5

1722 |
1723 | 1724 |

5

1725 |

262#out:1

1726 |

[49, 0; 0, -30]

1727 |

271#in:2

1728 |
1729 | 1730 |

6

1731 |

266#out:1

1732 |

[60, 0; 0, 30]

1733 |

271#in:6

1734 |
1735 | 1736 |

7

1737 |

260#out:1

1738 |

[40, 0; 0, -45]

1739 |

271#in:1

1740 |
1741 | 1742 |

8

1743 |

267#out:1

1744 |

[49, 0; 0, 45]

1745 |

271#in:7

1746 |
1747 | 1748 |

9

1749 |

269#out:1

1750 |

[39, 0; 0, 60]

1751 |

271#in:8

1752 |
1753 | 1754 |

10

1755 |

270#out:1

1756 |

[28, 0; 0, 75]

1757 |

271#in:9

1758 |
1759 | 1760 |

12

1761 |

271#out:1

1762 |

272#in:1

1763 |
1764 | 1765 |

13

1766 |

273#out:1

1767 |

[38, 0; 0, -80]

1768 |

261#in:1

1769 |
1770 | 1771 |

14

1772 |

273#out:2

1773 |

[38, 0; 0, 60]

1774 |

268#in:1

1775 |
1776 | 1777 |

15

1778 |

272#out:1

1779 |

[48, 0; 0, 5]

1780 |

273#in:1

1781 |
1782 |
1783 | 1784 | __MWOPC_PART_BEGIN__ /simulink/systems/system_84.xml 1785 | 1786 | 1787 |

[1972, 87, 3456, 1090]

1788 |

73

1789 | 1790 |

[715, 618, 745, 632]

1791 |

165

1792 |

3

1793 |
1794 | 1795 |

[105, 68, 135, 82]

1796 |

168

1797 |

2

1798 |

3

1799 |
1800 | 1801 |

[105, 243, 135, 257]

1802 |

167

1803 |

3

1804 |

3

1805 |
1806 | 1807 |

[780, 163, 810, 177]

1808 |

182

1809 |

4

1810 |
1811 | 1812 |

[780, 198, 810, 212]

1813 |

183

1814 |

5

1815 |
1816 | 1817 |

[780, 233, 810, 247]

1818 |

184

1819 |

6

1820 |
1821 | 1822 |

[780, 268, 810, 282]

1823 |

197

1824 |

7

1825 |
1826 | 1827 |

[2, 8]

1828 |

[295, 6, 490, 279]

1829 |

169

1830 |

6.0

1831 |

shared6dof/6DOF (Euler Angles)

1832 |

6DOF EoM (Body Axis)

1833 | 1834 |

Inherit from model

1835 |

Inherit from model

1836 |

Inherit from model

1837 |

Inherit from model

1838 |

Inherit from model

1839 |

on

1840 |

Metric (MKS)

1841 |

Fixed

1842 |

Euler Angles

1843 |

IC.inertial_position

1844 |

IC.body_velocity

1845 |

IC.euler_angles

1846 |

IC.omega

1847 |

Param.mass

1848 |

0.5

1849 |

2.0

1850 |

Param.moi

1851 |

eye(3)

1852 |

2*eye(3)

1853 |

1.0

1854 |

on

1855 |

off

1856 |

0

1857 |

{'Xe', 'Ye', 'Ze'}

1858 |

{'U', 'v', 'w'}

1859 |

''

1860 |

{'qr', 'qi', 'qj', 'qk'}

1861 |

{'p', 'q', 'r'}

1862 |

''

1863 |
1864 |
1865 | 1866 |

[1235, 475, 1265, 505]

1867 |

204

1868 |

off

1869 |
1870 | 1871 |

[2, 1]

1872 |

[1290, 212, 1315, 288]

1873 |

98

1874 |

rectangular

1875 |

+-

1876 |
1877 | 1878 |

[3, 1]

1879 |

[230, 28, 265, 122]

1880 |

144

1881 |

rectangular

1882 |

+++

1883 |
1884 | 1885 |

[105, 495, 160, 525]

1886 |

130

1887 |

Param.g

1888 |
1889 | 1890 |

[105, 445, 135, 475]

1891 |

143

1892 |

0

1893 |
1894 | 1895 |

[2, 1]

1896 |

[820, 391, 880, 464]

1897 |

54

1898 |

6.0

1899 |

aerolibasang/Dynamic Pressure

1900 |

Dynamic Pressure

1901 | 1902 |

Inherit from model

1903 |

Inherit from model

1904 |

Inherit from model

1905 |

Inherit from model

1906 |

Inherit from model

1907 |

on

1908 |
1909 |
1910 | 1911 |

[9, 2]

1912 |

[895, -27, 955, 297]

1913 |

203

1914 |

on

1915 | 1916 |
1917 | 1918 |

[765, 20, 825, 40]

1919 |

116

1920 |

alpha

1921 |
1922 | 1923 |

[765, -15, 825, 5]

1924 |

161

1925 |

Vt

1926 |
1927 | 1928 |

[1135, 85, 1195, 105]

1929 |

85

1930 |

alpha

1931 |
1932 | 1933 |

[1135, 220, 1195, 240]

1934 |

156

1935 |

euler_ang

1936 |
1937 | 1938 |

[1135, 120, 1195, 140]

1939 |

87

1940 |

beta

1941 |
1942 | 1943 |

[1135, 260, 1195, 280]

1944 |

97

1945 |

alpha

1946 |
1947 | 1948 |

[705, 580, 765, 600]

1949 |

94

1950 |

Vb

1951 |
1952 | 1953 |

[1455, -20, 1515, 0]

1954 |

101

1955 |

omega

1956 |
1957 | 1958 |

[1455, 15, 1515, 35]

1959 |

103

1960 |

lin_accl

1961 |
1962 | 1963 |

[155, 35, 210, 55]

1964 |

123

1965 |

Faero

1966 |
1967 | 1968 |

[155, 200, 210, 220]

1969 |

124

1970 |

Maero

1971 |
1972 | 1973 |

[345, 520, 415, 540]

1974 |

142

1975 |

DCM_be

1976 |
1977 | 1978 |

[730, 398, 775, 422]

1979 |

57

1980 |

Vb

1981 |
1982 | 1983 |

[1455, 110, 1515, 130]

1984 |

179

1985 |

off

1986 |

off

1987 |

Vb

1988 |
1989 | 1990 |

[155, 95, 210, 115]

1991 |

146

1992 |

Weight

1993 | 1994 |

1

1995 |

Wb

1996 |
1997 |
1998 | 1999 |

[765, 55, 825, 75]

2000 |

157

2001 |

beta

2002 |
2003 | 2004 |

[765, 90, 825, 110]

2005 |

158

2006 |

omega

2007 |
2008 | 2009 |

[1455, 135, 1515, 155]

2010 |

180

2011 |

a

2012 |
2013 | 2014 |

[730, 435, 775, 455]

2015 |

58

2016 |

rho

2017 |
2018 | 2019 |

[1135, 15, 1195, 35]

2020 |

172

2021 |

Ve

2022 |
2023 | 2024 |

[1455, 50, 1520, 70]

2025 |

174

2026 |

off

2027 |

off

2028 |

ang_accl

2029 |
2030 | 2031 |

[1035, 475, 1075, 505]

2032 |

73

2033 |

Xe

2034 |
2035 | 2036 |

[765, 125, 825, 145]

2037 |

118

2038 |

qbar

2039 |
2040 | 2041 |

[1135, -20, 1195, 0]

2042 |

81

2043 |

Xe

2044 |
2045 | 2046 |

[1135, 50, 1195, 70]

2047 |

83

2048 |

Vt

2049 |
2050 | 2051 |

[945, 542, 985, 568]

2052 |

38

2053 |

alpha

2054 |
2055 | 2056 |

[550, 217, 620, 243]

2057 |

170

2058 |

off

2059 |

off

2060 |

ang_accl

2061 |
2062 | 2063 |

[550, 182, 620, 208]

2064 |

67

2065 |

off

2066 |

off

2067 |

omega

2068 |
2069 | 2070 |

[550, 252, 620, 278]

2071 |

69

2072 |

off

2073 |

off

2074 |

lin_accl

2075 |
2076 | 2077 |

[550, 42, 620, 68]

2078 |

71

2079 |

off

2080 |

off

2081 |

Xe

2082 |
2083 | 2084 |

[550, 77, 620, 103]

2085 |

72

2086 |

off

2087 |

off

2088 |

euler_ang

2089 |
2090 | 2091 |

[550, 147, 620, 173]

2092 |

93

2093 |

off

2094 |

off

2095 |

Vb

2096 |
2097 | 2098 |

[980, 42, 1050, 68]

2099 |

125

2100 |

off

2101 |

off

2102 |

Faero

2103 |
2104 | 2105 |

[980, 202, 1050, 228]

2106 |

127

2107 |

Maero

2108 |
2109 | 2110 |

[550, 7, 620, 33]

2111 |

171

2112 |

off

2113 |

off

2114 |

Ve

2115 |
2116 | 2117 |

[580, 497, 650, 523]

2118 |

138

2119 |

Weight

2120 |
2121 | 2122 |

[1540, 550, 1625, 580]

2123 |

44

2124 |

rho

2125 |
2126 | 2127 |

[1540, 450, 1625, 480]

2128 |

178

2129 |

a

2130 |
2131 | 2132 |

[945, 577, 985, 603]

2133 |

55

2134 |

beta

2135 |
2136 | 2137 |

[945, 612, 985, 638]

2138 |

56

2139 |

Vt

2140 |
2141 | 2142 |

[915, 417, 955, 443]

2143 |

59

2144 |

qbar

2145 |
2146 | 2147 |

[550, 112, 620, 138]

2148 |

66

2149 |

off

2150 |

off

2151 |

DCM_be

2152 |
2153 | 2154 |

[1, 4]

2155 |

[1360, 387, 1505, 593]

2156 |

33

2157 |

off

2158 |

6.0

2159 |

aerolibatmos2/ISA Atmosphere Model

2160 |

International Standard Atmosphere Model

2161 | 2162 |

Inherit from model

2163 |

Inherit from model

2164 |

Inherit from model

2165 |

Inherit from model

2166 |

Inherit from model

2167 |

on

2168 |

off

2169 |

9.80665

2170 |

1.4

2171 |

287.0531

2172 |

0.0065

2173 |

11000

2174 |

20000

2175 |

1.225

2176 |

101325

2177 |

288.15

2178 |

0

2179 |
2180 |
2181 | 2182 |

[1, 3]

2183 |

[825, 540, 885, 640]

2184 |

35

2185 |

6.0

2186 |

aerolibasang/Incidence, Sideslip, 2187 | & Airspeed

2188 |

Incidence,Sideslip,&Airspeed

2189 | 2190 |

Inherit from model

2191 |

Inherit from model

2192 |

Inherit from model

2193 |

Inherit from model

2194 |

Inherit from model

2195 |

on

2196 |
2197 |
2198 | 2199 |

[2, 1]

2200 |

[1540, 107, 1600, 158]

2201 |

177

2202 |

off

2203 |

off

2204 |

6.0

2205 |

aerolibasang/Mach Number

2206 |

Mach Number

2207 | 2208 |

Inherit from model

2209 |

Inherit from model

2210 |

Inherit from model

2211 |

Inherit from model

2212 |

Inherit from model

2213 |

on

2214 |
2215 |
2216 | 2217 |

[3, 1]

2218 |

[310, 448, 315, 522]

2219 |

133

2220 |

3

2221 |

bar

2222 |
2223 | 2224 |

[1, 1]

2225 |

[1100, 471, 1140, 509]

2226 |

39

2227 |

3

2228 |

Index vector (dialog)

2229 |

3

2230 |

1

2231 |
2232 | 2233 |

[1, 1]

2234 |

[1220, 211, 1260, 249]

2235 |

95

2236 |

3

2237 |

Index vector (dialog)

2238 |

2

2239 |

1

2240 |
2241 | 2242 |

[2, 1]

2243 |

[780, 580, 800, 600]

2244 |

164

2245 |

|++

2246 |
2247 | 2248 |

[2, 1]

2249 |

[235, 200, 255, 220]

2250 |

166

2251 |

off

2252 |

off

2253 |

|++

2254 |
2255 | 2256 |

[1540, 405, 1560, 425]

2257 |

147

2258 |
2259 | 2260 |

[1540, 505, 1560, 525]

2261 |

148

2262 |
2263 | 2264 |

[2, 1]

2265 |

[450, 464, 545, 551]

2266 |

141

2267 |

Stateflow.Translate.translate

2268 |

ExplicitOnly

2269 |

on

2270 |

MATLAB Function

2271 |

on

2272 | 2273 |

1

2274 |

Wb

2275 |
2276 | 2277 |
2278 | 2279 |

[185, 485, 265, 535]

2280 |

132

2281 |

Param.mass

2282 |
2283 | 2284 |

[1230, -17, 1260, -3]

2285 |

108

2286 |
2287 | 2288 |

[1230, 18, 1260, 32]

2289 |

173

2290 |

2

2291 |
2292 | 2293 |

[1230, 53, 1260, 67]

2294 |

109

2295 |

3

2296 |
2297 | 2298 |

[1230, 88, 1260, 102]

2299 |

110

2300 |

4

2301 |
2302 | 2303 |

[1230, 123, 1260, 137]

2304 |

111

2305 |

5

2306 |
2307 | 2308 |

[1360, 183, 1390, 197]

2309 |

160

2310 |

6

2311 |
2312 | 2313 |

[1360, 243, 1390, 257]

2314 |

112

2315 |

7

2316 |
2317 | 2318 |

[1550, -17, 1580, -3]

2319 |

113

2320 |

8

2321 |
2322 | 2323 |

[1550, 18, 1580, 32]

2324 |

114

2325 |

9

2326 |
2327 | 2328 |

[1555, 53, 1585, 67]

2329 |

175

2330 |

10

2331 |
2332 | 2333 |

[1625, 128, 1655, 142]

2334 |

181

2335 |

11

2336 |
2337 | 2338 |

60

2339 |

50#out:1

2340 |

11#in:1

2341 |
2342 | 2343 |

96

2344 |

65#out:1

2345 |

[30, 0]

2346 |

92#in:1

2347 |
2348 | 2349 |

37

2350 |

7#out:3

2351 |

28#in:1

2352 |
2353 | 2354 |

156

2355 |

5#out:3

2356 |

131#in:1

2357 |
2358 | 2359 |

155

2360 |

5#out:1

2361 |

130#in:1

2362 |
2363 | 2364 |

25

2365 |

5#out:4

2366 |

16#in:1

2367 |
2368 | 2369 |

40

2370 |

30#out:1

2371 |

26#in:2

2372 |
2373 | 2374 |

99

2375 |

81#out:1

2376 |

[30, 0]

2377 |

95#in:1

2378 |
2379 | 2380 |

95

2381 |

62#out:1

2382 |

[30, 0]

2383 |

91#in:1

2384 |
2385 | 2386 |

310

2387 |

5#out:2

2388 |

201#in:1

2389 |
2390 | 2391 |

39

2392 |

29#out:1

2393 |

26#in:1

2394 |
2395 | 2396 |

97

2397 |

77#out:1

2398 |

93#in:1

2399 |
2400 | 2401 |

94

2402 |

60#out:1

2403 |

90#in:1

2404 |
2405 | 2406 |

38

2407 |

7#out:2

2408 |

27#in:1

2409 |
2410 | 2411 |

84

2412 |

75#out:1

2413 |

77#in:1

2414 |
2415 | 2416 |

12

2417 |

7#out:1

2418 |

10#in:1

2419 |
2420 | 2421 |

13

2422 |

11#out:1

2423 |

274#in:1

2424 |
2425 | 2426 |

83

2427 |

76#out:1

2428 |

77#in:2

2429 |
2430 | 2431 |

183

2432 |

157#out:1

2433 |

[4, 0]

2434 | 2435 |

187

2436 |

[0, -40]

2437 |

174#in:1

2438 |
2439 | 2440 |

186

2441 |

75#in:1

2442 |
2443 |
2444 | 2445 |

98

2446 |

79#out:1

2447 |

[30, 0]

2448 |

94#in:1

2449 |
2450 | 2451 |

42

2452 |

26#out:1

2453 |

31#in:1

2454 |
2455 | 2456 |

93

2457 |

59#out:1

2458 |

[30, 0]

2459 |

89#in:1

2460 |
2461 | 2462 |

123

2463 |

111#out:1

2464 |

113#in:1

2465 |
2466 | 2467 |

462

2468 |

113#out:1

2469 |

114#in:3

2470 |
2471 | 2472 |

145

2473 |

114#out:1

2474 |

122#in:1

2475 |
2476 | 2477 |

146

2478 |

122#out:1

2479 |

119#in:1

2480 |
2481 | 2482 |

147

2483 |

123#out:1

2484 |

122#in:2

2485 |
2486 | 2487 |

148

2488 |

124#out:1

2489 |

[119, 0]

2490 | 2491 |

150

2492 |

[0, 25]

2493 |

114#in:2

2494 |
2495 | 2496 |

149

2497 |

114#in:1

2498 |
2499 |
2500 | 2501 |

151

2502 |

103#out:1

2503 |

126#in:1

2504 |
2505 | 2506 |

276

2507 |

187#out:1

2508 |

126#in:2

2509 |
2510 | 2511 |

153

2512 |

128#out:1

2513 |

126#in:3

2514 |
2515 | 2516 |

293

2517 |

126#out:1

2518 |

192#in:1

2519 |
2520 | 2521 |

268

2522 |

72#out:1

2523 |

182#in:1

2524 |
2525 | 2526 |

269

2527 |

182#out:1

2528 |

7#in:1

2529 |
2530 | 2531 |

270

2532 |

183#out:1

2533 |

[40, 0]

2534 |

182#in:2

2535 |
2536 | 2537 |

272

2538 |

104#out:1

2539 |

185#in:1

2540 |
2541 | 2542 |

275

2543 |

186#out:1

2544 |

[105, 0]

2545 |

185#in:2

2546 |
2547 | 2548 |

305

2549 |

192#out:1

2550 |

194#in:1

2551 |
2552 | 2553 |

297

2554 |

192#out:2

2555 |

[55, 0]

2556 |

48#in:1

2557 |
2558 | 2559 |

298

2560 |

192#out:3

2561 |

[55, 0]

2562 |

49#in:1

2563 |
2564 | 2565 |

299

2566 |

192#out:4

2567 |

[55, 0]

2568 |

43#in:1

2569 |
2570 | 2571 |

300

2572 |

192#out:5

2573 |

[55, 0]

2574 |

71#in:1

2575 |
2576 | 2577 |

301

2578 |

192#out:6

2579 |

[55, 0]

2580 |

44#in:1

2581 |
2582 | 2583 |

304

2584 |

192#out:7

2585 |

193#in:1

2586 |
2587 | 2588 |

303

2589 |

192#out:8

2590 |

[55, 0]

2591 |

46#in:1

2592 |
2593 | 2594 |

306

2595 |

195#out:1

2596 |

196#in:1

2597 |
2598 | 2599 |

307

2600 |

197#out:1

2601 |

198#in:1

2602 |
2603 | 2604 |

311

2605 |

202#out:1

2606 |

200#in:1

2607 |
2608 | 2609 |

312

2610 |

203#out:1

2611 |

200#in:2

2612 |
2613 | 2614 |

313

2615 |

200#out:1

2616 |

204#in:1

2617 |
2618 | 2619 |

578

2620 |

259#out:1

2621 |

105#in:1

2622 |
2623 | 2624 |

461

2625 |

185#out:1

2626 |

192#in:2

2627 |
2628 | 2629 |

579

2630 |

259#out:2

2631 |

107#in:1

2632 |
2633 | 2634 |

569

2635 |

179#out:1

2636 |

259#in:1

2637 |
2638 | 2639 |

570

2640 |

9#out:1

2641 |

259#in:2

2642 |
2643 | 2644 |

571

2645 |

169#out:1

2646 |

259#in:3

2647 |
2648 | 2649 |

572

2650 |

170#out:1

2651 |

259#in:4

2652 |
2653 | 2654 |

573

2655 |

51#out:1

2656 |

259#in:5

2657 |
2658 | 2659 |

574

2660 |

212#out:1

2661 |

259#in:6

2662 |
2663 | 2664 |

575

2665 |

213#out:1

2666 |

259#in:7

2667 |
2668 | 2669 |

576

2670 |

214#out:1

2671 |

259#in:8

2672 |
2673 | 2674 |

577

2675 |

242#out:1

2676 |

259#in:9

2677 |
2678 | 2679 |

590

2680 |

274#out:1

2681 |

5#in:1

2682 |
2683 | 2684 |

Gravity

2685 |

[87, 354, 669, 652]

2686 |

[0, 0, 0, 0]

2687 |

on

2688 |

on

2689 |

[0.952941, 0.952941, 0.952941]

2690 |

[0.952941, 0.952941, 0.952941]

2691 |

on

2692 |

area_annotation

2693 |

3916

2694 |

12

2695 |

bold

2696 |
2697 | 2698 |

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 2699 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 2700 | p, li { white-space: pre-wrap; } 2701 | </style></head><body align="left" style=" font-family:'Helvetica'; font-size:10px; font-weight:400; font-style:normal;"> 2702 | <p align="left" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:18px; font-weight:600;">Nonlinear Model of the F16 Aircraft</span></p> 2703 | <p align="left" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12px;"><br /></p> 2704 | <p align="left" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12px;">Developed by Raktim Bhattacharya</span></p> 2705 | <p align="left" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12px;">Professor, Aerospace Engineering,</span></p> 2706 | <p align="left" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12px;">Texas A&amp;M University.</span></p></body></html>

2707 |

[752, -143, 1057, -75]

2708 |

[0, 0, 0, 0]

2709 |

rich

2710 |

-2

2711 |
2712 | 2713 |

Aerodynamics

2714 |

[730, -50, 1080, 327]

2715 |

[0, 0, 0, 0]

2716 |

on

2717 |

on

2718 |

[0.996078, 0.968627, 0.909804]

2719 |

[0.996078, 0.968627, 0.909804]

2720 |

on

2721 |

area_annotation

2722 |

3912

2723 |

12

2724 |

bold

2725 |
2726 | 2727 |

Outputs

2728 |

[1095, -52, 1669, 312]

2729 |

[0, 0, 0, 0]

2730 |

on

2731 |

on

2732 |

[0.956863, 0.980392, 0.921569]

2733 |

[0.956863, 0.980392, 0.921569]

2734 |

on

2735 |

area_annotation

2736 |

3911

2737 |

12

2738 |

bold

2739 |
2740 | 2741 |

Rigid Body Dynamics

2742 |

[89, -49, 715, 327]

2743 |

[0, 0, 0, 0]

2744 |

on

2745 |

on

2746 |

[0.992157, 0.937255, 0.913725]

2747 |

[0.992157, 0.937255, 0.913725]

2748 |

on

2749 |

area_annotation

2750 |

3913

2751 |

12

2752 |

bold

2753 |
2754 | 2755 |

Stability Axes Conversion

2756 |

[686, 516, 1006, 652]

2757 |

[0, 0, 0, 0]

2758 |

on

2759 |

on

2760 |

[0.952941, 0.952941, 0.952941]

2761 |

[0.952941, 0.952941, 0.952941]

2762 |

on

2763 |

area_annotation

2764 |

3917

2765 |

12

2766 |

bold

2767 |
2768 | 2769 |

Atmospheric Parameters

2770 |

[1021, 353, 1670, 652]

2771 |

[0, 0, 0, 0]

2772 |

on

2773 |

on

2774 |

[0.952941, 0.952941, 0.952941]

2775 |

[0.952941, 0.952941, 0.952941]

2776 |

on

2777 |

area_annotation

2778 |

3915

2779 |

12

2780 |

bold

2781 |
2782 | 2783 |

Flight Parameters

2784 |

[687, 352, 1006, 505]

2785 |

[0, 0, 0, 0]

2786 |

on

2787 |

on

2788 |

[0.952941, 0.952941, 0.952941]

2789 |

[0.952941, 0.952941, 0.952941]

2790 |

on

2791 |

area_annotation

2792 |

3914

2793 |

12

2794 |

bold

2795 |
2796 |
2797 | 2798 | __MWOPC_PART_BEGIN__ /simulink/systems/system_root.xml 2799 | 2800 | 2801 |

[1972, 87, 3456, 1090]

2802 |

93

2803 |

simulink-default.rpt

2804 |

286

2805 | 2806 |

[260, 148, 290, 162]

2807 |

178

2808 |
2809 | 2810 |

[420, 283, 450, 297]

2811 |

177

2812 |

2

2813 |
2814 | 2815 |

[420, 338, 450, 352]

2816 |

181

2817 |

3

2818 |
2819 | 2820 |

[420, 393, 450, 407]

2821 |

182

2822 |

4

2823 |
2824 | 2825 |

[455, 118, 485, 132]

2826 |

187

2827 |

5

2828 |
2829 | 2830 |

[320, 180, 350, 210]

2831 |

180

2832 |

0

2833 |
2834 | 2835 |

[440, 222, 500, 248]

2836 |

145

2837 |

zeros(1,3)

2838 |
2839 | 2840 |

[420, 440, 450, 470]

2841 |

186

2842 |

0

2843 |
2844 | 2845 |

[3, 1]

2846 |

[400, 143, 405, 217]

2847 |

179

2848 |

3

2849 |

bar

2850 |
2851 | 2852 |

[7, 11]

2853 |

[535, 94, 780, 486]

2854 |

104

2855 |

on

2856 | 2857 |

1

2858 |

Xe

2859 |
2860 | 2861 |

2

2862 |

Ve

2863 |
2864 | 2865 |

3

2866 |

Vt

2867 |
2868 | 2869 |

4

2870 |

alpha

2871 |
2872 | 2873 |

5

2874 |

beta

2875 |
2876 | 2877 |

6

2878 |

EA

2879 |
2880 | 2881 |

7

2882 |

gamma

2883 |
2884 | 2885 |

8

2886 |

om

2887 |
2888 | 2889 |

9

2890 |

accl

2891 |
2892 | 2893 |

10

2894 |

ang accl

2895 |
2896 | 2897 |
2898 | 2899 |

[865, 108, 895, 122]

2900 |

105

2901 |
2902 | 2903 |

[865, 143, 895, 157]

2904 |

146

2905 |

2

2906 |
2907 | 2908 |

[865, 178, 895, 192]

2909 |

106

2910 |

3

2911 |
2912 | 2913 |

[865, 213, 895, 227]

2914 |

107

2915 |

4

2916 |
2917 | 2918 |

[865, 248, 895, 262]

2919 |

108

2920 |

5

2921 |
2922 | 2923 |

[865, 283, 895, 297]

2924 |

112

2925 |

6

2926 |
2927 | 2928 |

[865, 318, 895, 332]

2929 |

109

2930 |

7

2931 |
2932 | 2933 |

[865, 353, 895, 367]

2934 |

110

2935 |

8

2936 |
2937 | 2938 |

[865, 388, 895, 402]

2939 |

111

2940 |

9

2941 |
2942 | 2943 |

[865, 423, 895, 437]

2944 |

147

2945 |

10

2946 |
2947 | 2948 |

[865, 458, 895, 472]

2949 |

148

2950 |

11

2951 |
2952 | 2953 |

Xe

2954 |

100

2955 |

[0, 0]

2956 |

84#out:1

2957 |

96#in:1

2958 |
2959 | 2960 |

Vt

2961 |

101

2962 |

[0, 0]

2963 |

84#out:3

2964 |

97#in:1

2965 |
2966 | 2967 |

alpha

2968 |

102

2969 |

[0, 0]

2970 |

84#out:4

2971 |

98#in:1

2972 |
2973 | 2974 |

beta

2975 |

103

2976 |

[0, 0]

2977 |

84#out:5

2978 |

99#in:1

2979 |
2980 | 2981 |

gamma

2982 |

104

2983 |

[1, 1]

2984 |

84#out:7

2985 |

100#in:1

2986 |
2987 | 2988 |

om

2989 |

105

2990 |

[1, 1]

2991 |

84#out:8

2992 |

101#in:1

2993 |
2994 | 2995 |

accl

2996 |

106

2997 |

[1, 1]

2998 |

84#out:9

2999 |

102#in:1

3000 |
3001 | 3002 |

EA

3003 |

114

3004 |

[1, 1]

3005 |

84#out:6

3006 |

175#in:1

3007 |
3008 | 3009 |

Ve

3010 |

128

3011 |

[0, 0]

3012 |

84#out:2

3013 |

205#in:1

3014 |
3015 | 3016 |

ang accl

3017 |

129

3018 |

[1, 1]

3019 |

84#out:10

3020 |

206#in:1

3021 |
3022 | 3023 |

130

3024 |

84#out:11

3025 |

207#in:1

3026 |
3027 | 3028 |

200

3029 |

190#out:1

3030 |

84#in:3

3031 |
3032 | 3033 |

204

3034 |

277#out:1

3035 |

278#in:1

3036 |
3037 | 3038 |

205

3039 |

279#out:1

3040 |

[8, 0]

3041 | 3042 |

214

3043 |

[0, 10]

3044 |

278#in:3

3045 |
3046 | 3047 |

213

3048 |

[0, -15]

3049 |

278#in:2

3050 |
3051 |
3052 | 3053 |

208

3054 |

278#out:1

3055 |

[-5, 0]

3056 |

84#in:2

3057 |
3058 | 3059 |

209

3060 |

276#out:1

3061 |

84#in:4

3062 |
3063 | 3064 |

210

3065 |

281#out:1

3066 |

84#in:6

3067 |
3068 | 3069 |

223

3070 |

285#out:1

3071 |

84#in:7

3072 |
3073 | 3074 |

212

3075 |

280#out:1

3076 |

84#in:5

3077 |
3078 | 3079 |

226

3080 |

286#out:1

3081 |

84#in:1

3082 |
3083 | 3084 |

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> 3085 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> 3086 | p, li { white-space: pre-wrap; } 3087 | </style></head><body align="left" style=" font-family:'Helvetica'; font-size:10px; font-weight:400; font-style:normal;"> 3088 | <p align="left" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:18px; font-weight:600;">Nonlinear Model of the F16 Aircraft</span></p> 3089 | <p align="left" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12px;"><br /></p> 3090 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10px;">Developed by </span></p> 3091 | <p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> 3092 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10px;">Raktim Bhattacharya</span></p> 3093 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10px; font-style:italic;">Professor, </span></p> 3094 | <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10px;">Aerospace Engineering,Texas A&amp;M University.</span></p></body></html>

3095 |

[505, -1, 810, 81]

3096 |

[0, 0, 0, 0]

3097 |

rich

3098 |

-1

3099 |
3100 |
3101 | 3102 | __MWOPC_PART_BEGIN__ /simulink/windowsInfo.xml 3103 | 3104 | 3105 | 3106 | 3107 |

1

3108 |

[1972.0, 87.0, 1484.0, 1003.0]

3109 | 3110 |

0

3111 |

Left

3112 |

50

3113 |

50

3114 |

9

3115 |

Off

3116 |
3117 | 3118 |

1

3119 |
3120 | 3121 | 3122 |

1

3123 |

1

3124 |

SimulinkTopLevel

3125 |

0

3126 |

[1446.0, 769.0]

3127 |

0.93013972055888228

3128 |

[-33.930492221030022, -16.051502145922711]

3129 |

[-33.930492221030022, -16.051502145922711, 1554.6051502145922, 826.75751072961373]

3130 |
3131 | 3132 |

0

3133 |

0

3134 |

SimulinkSubsys

3135 |

84

3136 |

[1446.0, 769.0]

3137 |

0.72773215413771319

3138 |

[-114.99739583333337, -273.85373263888891]

3139 |

[-114.99739583333337, -273.85373263888891, 1986.9947916666667, 1056.7074652777778]

3140 |
3141 | 3142 |

0

3143 |

0

3144 |

SimulinkSubsys

3145 |

259

3146 |

[1219.0, 771.0]

3147 |

1.8857868020304567

3148 |

[-250.70726783310903, -284.42395693135938]

3149 |

[-250.70726783310903, -284.42395693135938, 646.41453566621806, 408.84791386271877]

3150 |
3151 | 3152 |

0

3153 |

0

3154 |

StudioAdapterBlock

3155 |

122

3156 |

[1699.0, 837.0]

3157 |

1.0

3158 |

[0.0, 0.0]

3159 |

[0.0, 0.0, 0.0, 0.0]

3160 |
3161 | 3162 |

0

3163 |

0

3164 |

StudioAdapterBlock

3165 |

229

3166 |

[1446.0, 837.0]

3167 |

1.0

3168 |

[0.0, 0.0]

3169 |

[0.0, 0.0, 0.0, 0.0]

3170 |
3171 | 3172 |

0

3173 |

0

3174 |

StudioAdapterBlock

3175 |

217

3176 |

[1808.0, 737.0]

3177 |

1.0

3178 |

[0.0, 0.0]

3179 |

[0.0, 0.0, 0.0, 0.0]

3180 |
3181 | 3182 |

0

3183 |

0

3184 |

SimulinkSubsys

3185 |

192

3186 |

[1337.0, 803.0]

3187 |

1.0

3188 |

[-226.140625, -205.78125]

3189 |

[-226.140625, -205.78125, 1337.0, 803.0]

3190 |
3191 | 3192 |

0

3193 |

0

3194 |

SimulinkSubsys

3195 |

200:85

3196 |

[899.0, 584.0]

3197 |

1.0

3198 |

[-279.5, -204.5]

3199 |

[-279.5, -204.5, 899.0, 584.0]

3200 |
3201 | 3202 |

0

3203 |

0

3204 |

SimulinkSubsys

3205 |

146

3206 |

[1988.0, 817.0]

3207 |

1.509364615078332

3208 |

[-399.27542613636365, -385.74173599837661]

3209 |

[-399.27542613636365, -385.74173599837661, 1317.1105113636363, 541.28736810064936]

3210 |
3211 | 3212 |

0

3213 |

0

3214 |

StudioAdapterBlock

3215 |

216

3216 |

[1988.0, 817.0]

3217 |

1.0

3218 |

[0.0, 0.0]

3219 |

[0.0, 0.0, 0.0, 0.0]

3220 |
3221 | 3222 |

0

3223 |

0

3224 |

SimulinkSubsys

3225 |

181

3226 |

[1327.0, 935.0]

3227 |

1.0

3228 |

[-200.22265625, -229.5]

3229 |

[-200.22265625, -229.5, 1327.0, 935.0]

3230 |
3231 | 3232 |

0

3233 |

0

3234 |

SimulinkSubsys

3235 |

7

3236 |

[1327.0, 935.0]

3237 |

1.0

3238 |

[-488.5, -350.0]

3239 |

[-488.5, -350.0, 1327.0, 935.0]

3240 |
3241 | 3242 |

0

3243 |

0

3244 |

SimulinkSubsys

3245 |

3:89

3246 |

[1327.0, 935.0]

3247 |

1.0

3248 |

[-373.5, -362.8125]

3249 |

[-373.5, -362.8125, 1327.0, 935.0]

3250 |
3251 | 3252 |

0

3253 |

0

3254 |

SimulinkSubsys

3255 |

26

3256 |

[1627.0, 935.0]

3257 |

1.0

3258 |

[-617.1015625, -420.5]

3259 |

[-617.1015625, -420.5, 1627.0, 935.0]

3260 |
3261 | 3262 |

0

3263 |

0

3264 |

SimulinkSubsys

3265 |

8

3266 |

[1291.0, 889.0]

3267 |

2.0

3268 |

[-103.99999999999886, -85.499999999999659]

3269 |

[-103.99999999999886, -85.499999999999659, 645.5, 444.5]

3270 |
3271 | 3272 |

0

3273 |

0

3274 |

SimulinkSubsys

3275 |

8:85

3276 |

[1599.0, 903.0]

3277 |

1.0

3278 |

[-643.0, -379.5]

3279 |

[-643.0, -379.5, 1599.0, 903.0]

3280 |
3281 | 3282 |

0

3283 |

0

3284 |

SimulinkSubsys

3285 |

26:32

3286 |

[1599.0, 903.0]

3287 |

1.0

3288 |

[-643.0, -379.5]

3289 |

[-643.0, -379.5, 1599.0, 903.0]

3290 |
3291 | 3292 |

0

3293 |

0

3294 |

SimulinkSubsys

3295 |

135

3296 |

[1599.0, 903.0]

3297 |

1.03

3298 |

[-784.173354065534, -278.36407766990288]

3299 |

[-784.173354065534, -278.36407766990288, 1552.4271844660193, 876.69902912621353]

3300 |
3301 | 3302 |

0

3303 |

0

3304 |

SimulinkSubsys

3305 |

3

3306 |

[1599.0, 903.0]

3307 |

1.0

3308 |

[-85.265625, -139.875]

3309 |

[-85.265625, -139.875, 1599.0, 903.0]

3310 |
3311 | 3312 |

0

3313 |

0

3314 |

SimulinkSubsys

3315 |

2

3316 |

[1055.0, 671.0]

3317 |

1.0

3318 |

[-49.234375, -148.0]

3319 |

[-49.234375, -148.0, 1055.0, 671.0]

3320 |
3321 | 3322 |

0

3323 |

0

3324 |

SimulinkSubsys

3325 |

1

3326 |

[1194.0, 672.0]

3327 |

1.0

3328 |

[-130.5390625, -24.0]

3329 |

[-130.5390625, -24.0, 1194.0, 672.0]

3330 |
3331 |
3332 | 3333 | 3334 |

GLUE2:PropertyInspector

3335 |

Property Inspector

3336 |

0

3337 |

3338 |

3339 |

0

3340 |

Right

3341 |

640

3342 |

480

3343 |

Off

3344 |
3345 | 3346 |

Simulink:Editor:ReferencedFiles

3347 |

Referenced Files

3348 |

0

3349 |

3350 |

{"filterShowRefModels":"true","filterShowRefSubs":"true","filterShowOnlyDirtyFiles":"false"} 3351 |

3352 |

0

3353 |

Left

3354 |

640

3355 |

480

3356 |

Unset

3357 |
3358 |
3359 |

AAAA/wAAAAD9AAAAAwAAAAAAAAE0AAAElfwCAAAABPsAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAAAAAAAAA+wAAABYARABvAGMAawBXAGkAZABnAGUAdAA0AAAAAAD/////AAAAAAAAAAD7AAAAUgBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQAAAAAeQAAA2AAAABjAP////wAAAB5AAAElQAAAAAA////+gAAAAECAAAAA/sAAABgAFMAaQBtAHUAbABpAG4AawA6AEUAZABpAHQAbwByADoAUgBlAGYAZQByAGUAbgBjAGUAZABGAGkAbABlAHMALwBSAGUAZgBlAHIAZQBuAGMAZQBkACAARgBpAGwAZQBzAAAAAAD/////AAAAhwD////7AAAAYgBMAGkAYgByAGEAcgB5AEIAcgBvAHcAcwBlAHIAMgAgAEwAaQBiAHIAYQByAHkAQgByAG8AdwBzAGUAcgBTAHQAdQBkAGkAbwBDAG8AbQBwAG8AbgBlAG4AdAAvAEYAMQA4AQAAAAD/////AAAAAAAAAAD7AAAAYgBMAGkAYgByAGEAcgB5AEIAcgBvAHcAcwBlAHIAMgAgAEwAaQBiAHIAYQByAHkAQgByAG8AdwBzAGUAcgBTAHQAdQBkAGkAbwBDAG8AbQBwAG8AbgBlAG4AdAAvAEYAMQA2AQAAAAD/////AAAAAAAAAAAAAAABAAABMAAAAy78AgAAAAH7AAAAVABHAEwAVQBFADIAOgBQAHIAbwBwAGUAcgB0AHkASQBuAHMAcABlAGMAdABvAHIALwBQAHIAbwBwAGUAcgB0AHkAIABJAG4AcwBwAGUAYwB0AG8AcgAAAAB5AAADLgAAAawA////AAAAAwAABMIAAAES/AEAAAAB+/////8AAAAAAP////8AAAJ5AP///wAABcwAAAM+AAAAAQAAAAIAAAABAAAAAvwAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAAA

3360 | 3361 |

73b98cb5-e14f-4073-9185-4f69a7e93b9f

3362 |
3363 |

5979e32a-0f1b-4139-bc26-209caa99016e

3364 |
3365 |
3366 | 3367 | __MWOPC_PACKAGE_END__ 3368 | -------------------------------------------------------------------------------- /F16_Julia_Dump.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isrlab/F16-Model-Matlab/d019742f2fe7f5f25c521bc7e846519b28b759b3/F16_Julia_Dump.mat -------------------------------------------------------------------------------- /JuliaF16Model.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Comparison with Julia Model" 8 | ] 9 | }, 10 | { 11 | "cell_type": "code", 12 | "execution_count": 37, 13 | "metadata": {}, 14 | "outputs": [], 15 | "source": [ 16 | "using F16Model, OrdinaryDiffEq\n" 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": 38, 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [ 25 | "\n", 26 | "# Define state vector\n", 27 | "# -------------------\n", 28 | "d2r = pi/180;\n", 29 | "npos = 0; # ft\n", 30 | "epos = 0; # ft\n", 31 | "alt = 10000; # should be in between 5000 ft and 100000 ft\n", 32 | "phi = 0; # rad -- Roll\n", 33 | "theta = 0; # rad -- Pitch\n", 34 | "psi = 0; # rad -- Yaw\n", 35 | "Vt = 300; # ft/s -- Total velocity\n", 36 | "alp = 0; # rad -- Angle of attack\n", 37 | "bet = 0; # rad -- Side slip angle \n", 38 | "p = 0; # rad/s -- Roll rate\n", 39 | "q = 0; # rad/s -- Pitch rate\n", 40 | "r = 0; # rad/s -- Yaw rate\n", 41 | "\n", 42 | "x0 = [npos,epos,alt,phi,theta,psi,Vt,alp,bet,p,q,r];\n", 43 | "\n", 44 | "# Define control vector\n", 45 | "# ---------------------\n", 46 | "T = 9000; # Thrust lbs\n", 47 | "dele = 2; # deg elevator angle\n", 48 | "dail = 2; # deg aileron angle\n", 49 | "drud = 2; # deg rudder angle\n", 50 | "dlef = 2; # deg leading edge flap angle\n", 51 | "u0 = [T,dele,dail,drud,dlef];" 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 39, 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [ 60 | "tspan = (0.0,10);\n", 61 | "xdot = zeros(12)\n", 62 | "\n", 63 | "nlplant! = (xdot,x,p,t) -> F16Model.Dynamics!(xdot,x,u0)\n", 64 | "\n", 65 | "prob = ODEProblem(nlplant!,x0,tspan, saveat=0.01);\n", 66 | "sol = solve(prob);" 67 | ] 68 | }, 69 | { 70 | "cell_type": "code", 71 | "execution_count": 40, 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [ 75 | "xout = hcat(sol.u...)\n", 76 | "tout = sol.t\n", 77 | "\n", 78 | "using MAT\n", 79 | "file = matopen(\"F16_Julia_Dump.mat\",\"w\")\n", 80 | "write(file, \"xout\", xout)\n", 81 | "write(file, \"tout\", tout)\n", 82 | "close(file)" 83 | ] 84 | }, 85 | { 86 | "cell_type": "code", 87 | "execution_count": 41, 88 | "metadata": {}, 89 | "outputs": [ 90 | { 91 | "name": "stdout", 92 | "output_type": "stream", 93 | "text": [ 94 | "This is Ipopt version 3.14.17, running with linear solver MUMPS 5.7.3.\n", 95 | "\n", 96 | "Number of nonzeros in equality constraint Jacobian...: 0\n", 97 | "Number of nonzeros in inequality constraint Jacobian.: 8\n", 98 | "Number of nonzeros in Lagrangian Hessian.............: 36\n", 99 | "\n", 100 | "Total number of variables............................: 8\n", 101 | " variables with only lower bounds: 1\n", 102 | " variables with lower and upper bounds: 7\n", 103 | " variables with only upper bounds: 0\n", 104 | "Total number of equality constraints.................: 0\n", 105 | "Total number of inequality constraints...............: 1\n", 106 | " inequality constraints with only lower bounds: 0\n", 107 | " inequality constraints with lower and upper bounds: 0\n", 108 | " inequality constraints with only upper bounds: 1\n", 109 | "\n", 110 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 111 | " 0 9.9999900e-03 1.45e+02 1.00e+00 -1.0 0.00e+00 - 0.00e+00 0.00e+00 0\n", 112 | " 1 1.0000312e-01 3.63e+01 1.05e-01 -1.0 1.88e-01 - 9.37e-01 1.00e+00h 1\n", 113 | " 2 1.0004177e-01 8.07e+00 5.65e-01 -1.0 5.70e-01 0.0 9.90e-01 1.00e+00h 1\n", 114 | " 3 1.0010984e-01 1.10e+02 2.87e+00 -1.0 2.98e+00 -0.5 1.49e-01 9.28e-02h 3\n", 115 | " 4 1.0004505e-01 2.20e+01 5.28e-01 -1.0 2.39e+01 - 9.96e-01 1.00e+00h 1\n", 116 | " 5 1.0016456e-01 1.49e+02 4.73e+00 -1.0 1.00e+03 - 1.00e+00 1.00e+00f 1\n", 117 | " 6 1.0008417e-01 7.27e+01 1.16e+00 -1.0 1.48e-01 0.9 1.00e+00 1.00e+00h 1\n", 118 | " 7 1.0005038e-01 2.08e+01 7.77e-01 -1.0 4.14e+02 - 1.00e+00 1.00e+00h 1\n", 119 | " 8 1.0009114e-01 2.33e+00 6.64e-01 -1.0 1.19e-01 0.4 1.00e+00 2.50e-01h 3\n", 120 | " 9 1.0011207e-01 7.27e-01 3.04e-01 -1.0 3.17e+02 - 1.00e+00 9.99e-01h 1\n", 121 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 122 | " 10 2.0766648e-02 1.34e+01 9.08e+00 -1.7 3.12e+01 - 1.00e+00 1.00e+00h 1\n", 123 | " 11 2.0177631e-02 5.17e-01 9.66e-01 -1.7 5.09e-02 0.8 1.00e+00 1.00e+00h 1\n", 124 | " 12 2.0341148e-02 5.86e-01 3.15e+00 -1.7 1.41e-01 0.3 1.00e+00 2.50e-01h 3\n", 125 | " 13 2.0150872e-02 2.77e-01 8.68e-01 -1.7 2.57e+02 - 1.00e+00 9.64e-01h 1\n", 126 | " 14 2.1522158e-02 4.27e-01 1.15e+01 -1.7 2.13e+03 - 1.00e+00 1.00e+00f 1\n", 127 | " 15 2.1742110e-02 3.02e-02 2.32e+00 -1.7 2.89e-01 0.7 1.00e+00 2.50e-01h 3\n", 128 | " 16 2.2398935e-02 1.36e-02 9.44e-01 -1.7 2.52e-01 0.3 1.00e+00 9.92e-01h 1\n", 129 | " 17 3.6360171e-02 3.61e-01 3.51e+01 -1.7 2.15e+03 - 1.00e+00 1.00e+00f 1\n", 130 | " 18 7.4853617e-02 1.81e-01 4.33e+00 -1.7 2.20e-01 -0.2 1.00e+00 8.43e-01h 1\n", 131 | " 19 9.0338449e-02 4.47e-01 1.40e+02 -1.7 2.93e-01 -0.7 1.00e+00 1.00e+00f 1\n", 132 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 133 | " 20 9.0337459e-04 1.61e-01 3.75e+01 -1.7 4.54e-01 -1.2 1.00e+00 9.20e-01h 1\n", 134 | " 21 4.1545019e-02 3.74e-02 1.99e+01 -1.7 7.46e-01 -1.6 1.00e+00 1.00e+00f 1\n", 135 | " 22 4.1547487e-02 0.00e+00 2.99e-01 -1.7 7.04e-01 -2.1 1.00e+00 1.00e+00h 1\n", 136 | " 23 3.8499906e-02 3.83e-01 6.41e+01 -1.7 1.39e+03 - 1.00e+00 1.00e+00h 1\n", 137 | " 24 2.2959201e-02 6.93e-02 1.58e+01 -1.7 1.86e-02 -1.7 1.00e+00 1.00e+00h 1\n", 138 | " 25 2.6770580e-02 0.00e+00 1.24e+00 -1.7 1.27e-02 -2.2 1.00e+00 1.00e+00h 1\n", 139 | " 26 3.3182261e-02 0.00e+00 4.47e-01 -1.7 2.74e+02 - 1.00e+00 1.00e+00h 1\n", 140 | " 27 4.7884222e-02 0.00e+00 3.38e-01 -1.7 1.47e-02 -2.6 1.00e+00 1.00e+00h 1\n", 141 | " 28 4.5843521e-02 0.00e+00 5.08e+00 -1.7 9.98e+02 - 1.00e+00 1.00e+00h 1\n", 142 | " 29 4.4576647e-02 0.00e+00 1.65e-01 -1.7 1.51e-02 -3.1 1.00e+00 1.00e+00h 1\n", 143 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 144 | " 30 9.9552848e-03 1.76e-02 1.26e+01 -2.5 1.39e+03 - 1.00e+00 1.00e+00f 1\n", 145 | " 31 3.2071378e-03 5.55e-03 2.42e+00 -2.5 7.33e-02 -2.7 1.00e+00 1.00e+00h 1\n", 146 | " 32 6.7573201e-03 1.20e-03 2.71e+00 -2.5 1.74e-01 -3.2 1.00e+00 1.00e+00h 1\n", 147 | " 33 7.5471813e-03 3.96e-05 1.10e+00 -2.5 4.46e-02 -0.0 1.00e+00 2.50e-01h 3\n", 148 | " 34 1.0568040e-02 0.00e+00 2.02e+00 -2.5 1.37e-02 -0.5 1.00e+00 1.00e+00h 1\n", 149 | " 35 1.0838686e-02 0.00e+00 1.35e-01 -2.5 3.52e-03 -1.0 1.00e+00 1.00e+00h 1\n", 150 | " 36 9.7670052e-03 0.00e+00 3.02e+00 -2.5 2.45e+03 - 1.00e+00 2.50e-01h 3\n", 151 | " 37 9.2644658e-03 0.00e+00 1.26e-01 -2.5 2.11e-03 -1.5 1.00e+00 1.00e+00h 1\n", 152 | " 38 8.1141907e-03 1.34e-03 5.33e+00 -2.5 1.77e+03 - 1.00e+00 5.00e-01h 2\n", 153 | " 39 5.9295647e-03 0.00e+00 7.45e-01 -2.5 2.18e-03 -1.9 1.00e+00 1.00e+00h 1\n", 154 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 155 | " 40 7.9879972e-03 0.00e+00 1.15e-01 -2.5 1.21e-02 -2.4 1.00e+00 1.00e+00h 1\n", 156 | " 41 8.4702757e-03 0.00e+00 6.39e-02 -2.5 1.39e-02 -2.9 1.00e+00 1.00e+00h 1\n", 157 | " 42 7.5357985e-03 0.00e+00 2.52e+00 -2.5 1.24e+03 - 1.00e+00 5.00e-01h 2\n", 158 | " 43 6.4843794e-03 0.00e+00 2.29e-01 -2.5 2.77e-03 -3.4 1.00e+00 1.00e+00h 1\n", 159 | " 44 7.0895935e-03 0.00e+00 4.57e-01 -2.5 3.57e+02 - 1.00e+00 1.00e+00h 1\n", 160 | " 45 7.0830652e-03 0.00e+00 4.92e-02 -2.5 1.82e-01 -3.9 1.00e+00 1.00e+00h 1\n", 161 | " 46 6.8750677e-03 0.00e+00 4.59e-01 -2.5 4.06e+02 - 1.00e+00 5.00e-01h 2\n", 162 | " 47 6.8385513e-03 0.00e+00 5.99e-03 -2.5 4.09e-01 -4.3 1.00e+00 1.00e+00h 1\n", 163 | " 48 1.0186846e-06 5.10e-01 2.48e+01 -3.8 1.87e+03 - 9.32e-01 9.38e-01f 1\n", 164 | " 49 3.2666720e-04 1.27e-01 6.20e+00 -3.8 1.40e-02 -2.1 1.00e+00 1.00e+00h 1\n", 165 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 166 | " 50 1.4610597e-04 3.14e-02 1.55e+00 -3.8 7.35e-03 -2.6 1.00e+00 1.00e+00h 1\n", 167 | " 51 1.6320367e-04 7.10e-03 3.87e-01 -3.8 5.87e-03 -3.1 1.00e+00 1.00e+00h 1\n", 168 | " 52 1.5807559e-04 7.42e-04 8.32e-02 -3.8 1.13e-02 -3.5 1.00e+00 1.00e+00h 1\n", 169 | " 53 1.6306995e-04 2.23e-04 7.58e-02 -3.8 4.59e-02 -4.0 1.00e+00 1.00e+00h 1\n", 170 | " 54 1.7522640e-04 1.02e-04 1.10e-01 -3.8 8.55e-04 0.9 1.00e+00 1.00e+00h 1\n", 171 | " 55 2.0343657e-04 0.00e+00 1.75e-01 -3.8 1.28e-03 0.5 1.00e+00 1.00e+00h 1\n", 172 | " 56 2.4103675e-04 0.00e+00 1.29e-01 -3.8 1.76e-03 0.9 1.00e+00 1.00e+00h 1\n", 173 | " 57 2.9789285e-04 0.00e+00 4.43e-02 -3.8 8.02e-04 0.4 1.00e+00 1.00e+00h 1\n", 174 | " 58 3.2579106e-04 0.00e+00 5.03e-02 -3.8 1.86e-03 -0.1 1.00e+00 1.00e+00h 1\n", 175 | " 59 3.2578355e-04 0.00e+00 7.60e-04 -3.8 2.67e-03 -0.5 1.00e+00 1.00e+00h 1\n", 176 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 177 | " 60 -9.3989388e-09 9.39e-06 9.11e-02 -5.7 6.16e+01 - 9.36e-01 9.42e-01h 1\n", 178 | " 61 3.7284521e-06 0.00e+00 1.01e-02 -5.7 5.17e-04 -1.0 1.00e+00 1.00e+00f 1\n", 179 | " 62 3.8018210e-06 0.00e+00 1.43e-03 -5.7 1.60e-03 -1.5 1.00e+00 1.00e+00h 1\n", 180 | " 63 4.0763468e-06 0.00e+00 2.43e-03 -5.7 6.05e+00 - 1.00e+00 1.00e+00h 1\n", 181 | " 64 4.2397018e-06 0.00e+00 6.18e-05 -5.7 2.07e-04 -2.0 1.00e+00 1.00e+00h 1\n", 182 | " 65 4.2670128e-06 0.00e+00 1.71e-02 -5.7 1.97e+01 - 1.00e+00 1.00e+00h 1\n", 183 | " 66 4.1363852e-06 0.00e+00 3.87e-04 -5.7 2.16e-01 - 1.00e+00 1.00e+00h 1\n", 184 | " 67 4.2669850e-06 0.00e+00 7.56e-05 -5.7 1.30e+00 - 1.00e+00 1.00e+00h 1\n", 185 | " 68 4.2709781e-06 0.00e+00 5.84e-05 -5.7 1.08e+00 - 1.00e+00 1.00e+00h 1\n", 186 | " 69 4.2711819e-06 0.00e+00 1.63e-06 -5.7 1.80e-01 - 1.00e+00 1.00e+00h 1\n", 187 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 188 | " 70 9.7507272e-07 1.51e-06 4.94e-02 -8.6 3.38e+01 - 9.15e-01 9.02e-01f 1\n", 189 | " 71 -9.9999975e-09 1.08e-06 8.40e-02 -8.6 4.86e-04 -2.5 1.00e+00 8.45e-01f 1\n", 190 | " 72 -9.3463801e-09 9.97e-07 1.05e+00 -8.6 8.39e+00 - 1.72e-01 1.16e-01f 2\n", 191 | " 73 1.0918006e-06 2.47e-07 2.20e+01 -8.6 9.68e+00 - 2.61e-01 1.00e+00h 1\n", 192 | " 74 1.0854214e-06 2.53e-07 2.39e+01 -8.6 6.20e-07 5.4 1.00e+00 1.03e-02h 1\n", 193 | " 75 1.1153708e-06 2.20e-07 2.55e+01 -8.6 5.67e-07 4.9 8.23e-01 1.25e-01f 4\n", 194 | " 76 1.2717711e-06 7.29e-10 3.39e-02 -8.6 1.69e-06 4.4 1.00e+00 1.00e+00h 1\n", 195 | " 77 6.6797717e-07 6.14e-07 1.55e-02 -8.6 2.83e+00 - 1.00e+00 1.00e+00h 1\n", 196 | " 78 1.2626335e-06 0.00e+00 1.26e-02 -8.6 1.39e-06 4.0 1.00e+00 1.00e+00h 1\n", 197 | " 79 1.2338173e-06 3.85e-09 7.41e-03 -8.6 2.43e-06 3.5 1.00e+00 1.00e+00h 1\n", 198 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 199 | " 80 1.2222169e-06 3.40e-09 2.47e-03 -8.6 2.45e-06 3.0 1.00e+00 1.00e+00h 1\n", 200 | " 81 1.2241144e-06 0.00e+00 6.86e-04 -8.6 2.04e-06 2.5 1.00e+00 1.00e+00h 1\n", 201 | " 82 1.2200558e-06 0.00e+00 7.17e-04 -8.6 6.38e-06 2.1 1.00e+00 1.00e+00h 1\n", 202 | " 83 1.2072541e-06 0.00e+00 6.43e-04 -8.6 1.72e-05 1.6 1.00e+00 1.00e+00h 1\n", 203 | " 84 1.1821983e-06 7.84e-10 4.70e-04 -8.6 3.82e-05 1.1 1.00e+00 1.00e+00h 1\n", 204 | " 85 1.1566599e-06 4.41e-09 2.19e-04 -8.6 5.67e-05 0.6 1.00e+00 1.00e+00h 1\n", 205 | " 86 1.1489456e-06 1.43e-09 6.65e-05 -8.6 4.57e-05 0.1 1.00e+00 1.00e+00h 1\n", 206 | " 87 1.1431404e-06 0.00e+00 4.17e-05 -8.6 9.03e-05 -0.3 1.00e+00 1.00e+00h 1\n", 207 | " 88 1.1316595e-06 0.00e+00 3.75e-05 -8.6 2.43e-04 -0.8 1.00e+00 1.00e+00h 1\n", 208 | " 89 1.0798349e-06 2.57e-07 3.25e-02 -8.6 3.26e+02 - 1.00e+00 6.25e-02h 5\n", 209 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 210 | " 90 5.3491747e-07 6.71e-07 3.16e-02 -8.6 2.12e+01 - 1.00e+00 3.17e-01h 2\n", 211 | " 91 9.0724978e-07 1.34e-07 8.14e-03 -8.6 4.27e-04 -1.3 8.87e-01 1.00e+00h 1\n", 212 | " 92 1.0238911e-06 3.92e-09 8.42e-05 -8.6 6.16e-04 -1.8 1.00e+00 1.00e+00h 1\n", 213 | " 93 1.0263178e-06 0.00e+00 1.27e-05 -8.6 3.40e-04 -2.2 1.00e+00 1.00e+00h 1\n", 214 | " 94 1.0276045e-06 0.00e+00 6.53e-07 -8.6 3.01e-04 -2.7 1.00e+00 1.00e+00h 1\n", 215 | " 95 1.0271854e-06 0.00e+00 5.52e-07 -8.6 8.71e-04 -3.2 1.00e+00 1.00e+00h 1\n", 216 | " 96 1.0257339e-06 0.00e+00 5.46e-07 -8.6 2.58e-03 -3.7 1.00e+00 1.00e+00h 1\n", 217 | " 97 1.0215541e-06 0.00e+00 5.30e-07 -8.6 7.52e-03 -4.2 1.00e+00 1.00e+00h 1\n", 218 | " 98 1.0104474e-06 0.00e+00 4.85e-07 -8.6 2.07e-02 -4.6 1.00e+00 1.00e+00h 1\n", 219 | " 99 9.8682331e-07 7.99e-11 2.00e-06 -8.6 4.87e-02 -5.1 1.00e+00 1.00e+00h 1\n", 220 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 221 | " 100 9.5829714e-07 4.51e-09 3.32e-06 -8.6 8.01e-02 -5.6 1.00e+00 1.00e+00h 1\n", 222 | " 101 9.5054641e-07 2.74e-09 3.82e-07 -8.6 6.94e-02 -6.1 1.00e+00 1.00e+00h 1\n", 223 | " 102 9.3365045e-07 2.12e-08 1.36e-02 -8.6 3.42e+03 - 1.23e-01 3.13e-03h 6\n", 224 | " 103 9.1604246e-07 1.64e-08 4.24e-04 -8.6 2.32e+00 - 1.00e+00 1.00e+00h 1\n", 225 | " 104 8.8799347e-07 4.74e-07 4.38e-02 -8.6 4.88e+01 - 1.00e+00 5.00e-01h 2\n", 226 | " 105 4.3274185e-07 4.63e-07 4.41e-05 -8.6 7.93e-03 -5.6 1.00e+00 1.00e+00h 1\n", 227 | " 106 4.3454830e-07 4.56e-07 6.45e-03 -8.6 2.80e+02 - 1.00e+00 3.12e-02h 6\n", 228 | " 107 8.7158186e-07 5.48e-09 1.10e-03 -8.6 4.62e+00 - 1.00e+00 1.00e+00h 1\n", 229 | " 108 8.5099897e-07 1.59e-07 2.57e-02 -8.6 1.97e+01 - 1.00e+00 1.00e+00h 1\n", 230 | " 109 6.8973398e-07 1.58e-07 6.16e-05 -8.6 1.13e+00 - 1.00e+00 1.00e+00h 1\n", 231 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 232 | " 110 6.7555848e-07 2.45e-07 1.99e-02 -8.6 2.85e+02 - 1.00e+00 6.25e-02h 5\n", 233 | " 111 7.2802549e-07 9.43e-08 7.07e-05 -8.6 1.30e+00 - 1.00e+00 1.00e+00h 1\n", 234 | " 112 7.1307187e-07 1.46e-07 1.54e-02 -8.6 2.56e+02 - 1.00e+00 6.25e-02h 5\n", 235 | " 113 7.4399526e-07 5.56e-08 1.21e-04 -8.6 1.62e+00 - 1.00e+00 1.00e+00h 1\n", 236 | " 114 7.3461244e-07 6.12e-08 6.16e-03 -8.6 1.64e+02 - 1.00e+00 6.25e-02h 5\n", 237 | " 115 7.7527902e-07 6.89e-09 7.50e-04 -8.6 3.71e+00 - 1.00e+00 1.00e+00h 1\n", 238 | " 116 1.3279508e-06 0.00e+00 4.89e-02 -8.6 2.95e+01 - 1.00e+00 1.00e+00H 1\n", 239 | " 117 1.7133396e-07 5.75e-07 5.35e-05 -8.6 6.26e-03 -5.2 1.00e+00 1.00e+00f 1\n", 240 | " 118 1.7885821e-07 5.61e-07 5.41e-02 -8.6 2.69e+02 - 1.00e+00 2.88e-02h 6\n", 241 | " 119 7.2772787e-07 2.57e-09 1.20e-01 -8.6 7.53e+00 - 3.89e-01 1.00e+00h 1\n", 242 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 243 | " 120 7.1968949e-07 2.80e-09 3.92e-03 -8.6 8.73e+00 - 1.00e+00 1.00e+00h 1\n", 244 | " 121 7.1095783e-07 1.94e-09 1.69e-03 -8.6 5.86e+00 - 1.00e+00 1.00e+00h 1\n", 245 | " 122 6.9905988e-07 1.75e-08 8.88e-03 -8.6 1.34e+01 - 1.00e+00 1.00e+00h 1\n", 246 | " 123 6.7776292e-07 1.68e-08 3.22e-04 -8.6 2.67e+00 - 1.00e+00 1.00e+00h 1\n", 247 | " 124 6.6418051e-07 5.97e-08 1.40e-02 -8.6 6.77e+01 - 1.00e+00 2.50e-01h 3\n", 248 | " 125 6.2931290e-07 4.52e-08 1.29e-04 -8.6 1.79e+00 - 1.00e+00 1.00e+00h 1\n", 249 | " 126 6.1454707e-07 1.19e-07 1.80e-02 -8.6 1.57e+02 - 1.00e+00 1.25e-01h 4\n", 250 | " 127 5.7572973e-07 7.69e-08 7.83e-05 -8.6 1.46e+00 - 1.00e+00 1.00e+00h 1\n", 251 | " 128 5.6016894e-07 1.98e-07 2.30e-02 -8.6 2.40e+02 - 1.00e+00 9.46e-02h 4\n", 252 | " 129 5.0265591e-07 1.26e-07 5.56e-05 -8.6 1.24e+00 - 1.00e+00 1.00e+00h 1\n", 253 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 254 | " 130 4.9124619e-07 1.92e-07 1.74e-02 -8.6 3.11e+02 - 1.00e+00 6.48e-02h 4\n", 255 | " 131 5.3635875e-07 7.15e-08 6.15e-05 -8.6 1.50e+00 - 1.00e+00 1.00e+00h 1\n", 256 | " 132 5.2411590e-07 1.09e-07 1.31e-02 -8.6 2.84e+02 - 1.00e+00 6.25e-02h 4\n", 257 | " 133 5.4994838e-07 3.95e-08 1.22e-04 -8.6 1.89e+00 - 1.00e+00 1.00e+00h 1\n", 258 | " 134 5.3964185e-07 5.92e-08 9.85e-03 -8.6 1.62e+02 - 1.00e+00 9.66e-02h 4\n", 259 | " 135 5.5190105e-07 2.12e-08 2.11e-04 -8.6 2.42e+00 - 1.00e+00 1.00e+00h 1\n", 260 | " 136 5.4383758e-07 2.73e-08 6.07e-03 -8.6 9.83e+01 - 1.00e+00 1.25e-01h 4\n", 261 | " 137 5.5231377e-07 6.56e-09 5.38e-04 -8.6 3.81e+00 - 1.00e+00 1.00e+00h 1\n", 262 | " 138 1.5216975e-06 0.00e+00 6.43e-02 -8.6 4.06e+01 - 5.81e-01 1.00e+00H 1\n", 263 | " 139 -9.9999962e-09 5.87e-07 1.48e-02 -8.6 6.44e-03 -4.8 1.00e+00 7.73e-01f 1\n", 264 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 265 | " 140 1.3932434e-08 5.79e-07 6.61e+00 -8.6 1.70e+01 - 1.07e-01 1.56e-02f 7\n", 266 | " 141 1.3928723e-08 5.78e-07 1.43e-01 -8.6 1.92e+00 - 1.00e+00 6.56e-03h 1\n", 267 | " 142 4.2974052e-08 5.12e-07 1.10e-01 -8.6 4.84e+00 - 1.01e-01 1.25e-01f 4\n", 268 | " 143 4.9669577e-07 2.55e-08 7.49e-04 -8.6 2.03e+00 - 1.00e+00 1.00e+00h 1\n", 269 | " 144 7.1046331e-07 0.00e+00 1.16e-01 -8.6 2.81e+01 - 7.59e-01 1.00e+00H 1\n", 270 | " 145 2.9772931e-07 2.01e-07 5.49e-04 -8.6 1.02e+00 - 1.00e+00 1.00e+00h 1\n", 271 | " 146 4.4448635e-07 1.30e-07 1.97e-02 -8.6 2.93e+01 - 1.00e+00 8.17e-01h 1\n", 272 | " 147 3.9366105e-07 1.11e-07 1.24e-03 -8.6 7.02e+00 - 1.00e+00 1.00e+00f 1\n", 273 | " 148 4.7175416e-07 1.54e-08 8.78e-04 -8.6 2.61e+00 - 1.00e+00 1.00e+00h 1\n", 274 | " 149 4.8220276e-07 0.00e+00 2.88e-03 -8.6 9.29e+00 - 1.00e+00 1.00e+00h 1\n", 275 | "iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls\n", 276 | " 150 4.8178682e-07 0.00e+00 1.08e-04 -8.6 1.78e+00 - 1.00e+00 1.00e+00h 1\n", 277 | " 151 4.8429030e-07 0.00e+00 1.46e-05 -8.6 6.77e-01 - 1.00e+00 1.00e+00h 1\n", 278 | " 152 4.8440760e-07 0.00e+00 7.09e-07 -8.6 1.46e-01 - 1.00e+00 1.00e+00h 1\n", 279 | " 153 4.8440821e-07 0.00e+00 1.77e-11 -8.6 7.27e-04 - 1.00e+00 1.00e+00h 1\n", 280 | "\n", 281 | "Number of Iterations....: 153\n", 282 | "\n", 283 | " (scaled) (unscaled)\n", 284 | "Objective...............: 4.8440820559524264e-07 4.8440820559524264e-07\n", 285 | "Dual infeasibility......: 1.7710343972634979e-11 1.7710343972634979e-11\n", 286 | "Constraint violation....: 0.0000000000000000e+00 0.0000000000000000e+00\n", 287 | "Variable bound violation: 0.0000000000000000e+00 0.0000000000000000e+00\n", 288 | "Complementarity.........: 2.5059035596800622e-09 2.5059035596800622e-09\n", 289 | "Overall NLP error.......: 2.5059035596800622e-09 2.5059035596800622e-09\n", 290 | "\n", 291 | "\n", 292 | "Number of objective function evaluations = 285\n", 293 | "Number of objective gradient evaluations = 154\n", 294 | "Number of equality constraint evaluations = 0\n", 295 | "Number of inequality constraint evaluations = 285\n", 296 | "Number of equality constraint Jacobian evaluations = 0\n", 297 | "Number of inequality constraint Jacobian evaluations = 154\n", 298 | "Number of Lagrangian Hessian evaluations = 153\n", 299 | "Total seconds in IPOPT = 0.096\n", 300 | "\n", 301 | "EXIT: Optimal Solution Found.\n" 302 | ] 303 | } 304 | ], 305 | "source": [ 306 | "h0 = 10000; # ft\n", 307 | "Vt0 = 500; # ft/s\n", 308 | "\n", 309 | "# Stead-Level Flight\n", 310 | "xbar, ubar, status, prob = F16Model.Trim(h0,Vt0,γ=0, ψdot=0, ϕ=(0,1), ψ=(0,1), β=(0,1), p=(0,1), q=(0,1), r=(0,1));\n", 311 | "xdot_trim = F16Model.Dynamics(xbar,ubar); # Should be close to zero." 312 | ] 313 | }, 314 | { 315 | "cell_type": "code", 316 | "execution_count": 42, 317 | "metadata": {}, 318 | "outputs": [ 319 | { 320 | "name": "stdout", 321 | "output_type": "stream", 322 | "text": [ 323 | "┌────────┬──────────────┬───────────┬───────────┬──────────┐\n", 324 | "│\u001b[1m states \u001b[0m│\u001b[1m xdot \u001b[0m│\u001b[1m xmin \u001b[0m│\u001b[1m xbar \u001b[0m│\u001b[1m xmax \u001b[0m│\n", 325 | "├────────┼──────────────┼───────────┼───────────┼──────────┤\n", 326 | "│ npos │ 500.0 │ -Inf │ 0.0 │ Inf │\n", 327 | "│ epos │ 0.0 │ -Inf │ 0.0 │ Inf │\n", 328 | "│ h │ 3.02269e-5 │ 5000.0 │ 10000.0 │ 40000.0 │\n", 329 | "│ phi │ 0.0 │ -1.5708 │ 0.0 │ 1.5708 │\n", 330 | "│ theta │ 0.0 │ -1.5708 │ 0.0590342 │ 1.5708 │\n", 331 | "│ psi │ 0.0 │ -1.5708 │ 0.0 │ 1.5708 │\n", 332 | "│ V │ 1.8945e-9 │ 300.0 │ 500.0 │ 900.0 │\n", 333 | "│ alpha │ 8.79867e-6 │ -0.349066 │ 0.0590341 │ 0.785398 │\n", 334 | "│ beta │ -0.000701234 │ -0.523599 │ 0.0 │ 0.523599 │\n", 335 | "│ p │ 6.75021e-8 │ -Inf │ 0.0 │ Inf │\n", 336 | "│ q │ -2.15363e-7 │ -Inf │ 0.0 │ Inf │\n", 337 | "│ r │ -9.08611e-6 │ -Inf │ 0.0 │ Inf │\n", 338 | "└────────┴──────────────┴───────────┴───────────┴──────────┘\n", 339 | "┌──────────┬────────┬─────────────┬─────────┐\n", 340 | "│\u001b[1m controls \u001b[0m│\u001b[1m umin \u001b[0m│\u001b[1m ubar \u001b[0m│\u001b[1m umax \u001b[0m│\n", 341 | "├──────────┼────────┼─────────────┼─────────┤\n", 342 | "│ T │ 1000.0 │ 1891.67 │ 19000.0 │\n", 343 | "│ ele │ -25.0 │ -1.37945 │ 25.0 │\n", 344 | "│ ail │ -21.5 │ -0.0802958 │ 21.5 │\n", 345 | "│ rud │ -30.0 │ -0.00584493 │ 30.0 │\n", 346 | "│ lef │ 0.0 │ 0.0699389 │ 25.0 │\n", 347 | "└──────────┴────────┴─────────────┴─────────┘\n" 348 | ] 349 | } 350 | ], 351 | "source": [ 352 | "using PrettyTables\n", 353 | "\n", 354 | "# Check Trim Values\n", 355 | "xuBounds = F16Model.StateAndControlBounds();\n", 356 | "states = [\"npos\",\"epos\",\"h\",\"phi\",\"theta\",\"psi\",\"V\",\"alpha\",\"beta\",\"p\",\"q\",\"r\"];\n", 357 | "statesDer = [\"Dnpos\",\"Depos\",\"Dh\",\"Dphi\",\"Dtheta\",\"Dpsi\",\"DV\",\"Dalpha\",\"Ddbeta\",\"Dp\",\"Dq\",\"Dr\"];\n", 358 | "controls = [\"T\",\"ele\",\"ail\",\"rud\",\"lef\"];\n", 359 | "\n", 360 | "xmin = vcat([-Inf;-Inf],xuBounds[1:10,1]); xmax = vcat([Inf;Inf], xuBounds[1:10,2]);\n", 361 | "\n", 362 | "data = hcat(states,xdot_trim,xmin,xbar,xmax)\n", 363 | "pretty_table(header=[\"states\",\"xdot\",\"xmin\",\"xbar\",\"xmax\"],data);\n", 364 | "pretty_table(header=[\"controls\",\"umin\",\"ubar\",\"umax\"],hcat(controls,xuBounds[11:end,1],ubar,xuBounds[11:end,2]));\n", 365 | " " 366 | ] 367 | }, 368 | { 369 | "cell_type": "code", 370 | "execution_count": 43, 371 | "metadata": {}, 372 | "outputs": [ 373 | { 374 | "name": "stdout", 375 | "output_type": "stream", 376 | "text": [ 377 | "┌───────────┬─────────────┬──────────────┬───────────┬──────────┬────────────┬─────────────┐\n", 378 | "│\u001b[1m xdotLongi \u001b[0m│\u001b[1m theta \u001b[0m│\u001b[1m V \u001b[0m│\u001b[1m alpha \u001b[0m│\u001b[1m q \u001b[0m│\u001b[1m T \u001b[0m│\u001b[1m ele \u001b[0m│\n", 379 | "├───────────┼─────────────┼──────────────┼───────────┼──────────┼────────────┼─────────────┤\n", 380 | "│ Dtheta │ 0.0 │ 0.0 │ 0.0 │ 1.0 │ 0.0 │ 0.0 │\n", 381 | "│ DV │ -32.17 │ -0.0118591 │ -2.58453 │ -1.28295 │ 0.00156727 │ 0.0662367 │\n", 382 | "│ Dalpha │ -3.88959e-9 │ -0.000255941 │ -0.782055 │ 0.929171 │ -1.8526e-7 │ -0.00172694 │\n", 383 | "│ Dq │ 0.0 │ -8.61453e-10 │ -0.455764 │ -1.01533 │ 0.0 │ -0.140354 │\n", 384 | "└───────────┴─────────────┴──────────────┴───────────┴──────────┴────────────┴─────────────┘\n", 385 | "┌─────────────────────────┐\n", 386 | "│\u001b[1m Eigen values \u001b[0m│\n", 387 | "├─────────────────────────┤\n", 388 | "│ -0.901194-0.640782im │\n", 389 | "│ -0.901194+0.640782im │\n", 390 | "│ -0.00342886-0.0552919im │\n", 391 | "│ -0.00342886+0.0552919im │\n", 392 | "└─────────────────────────┘\n" 393 | ] 394 | } 395 | ], 396 | "source": [ 397 | "A, B = F16Model.Linearize(xbar,ubar);\n", 398 | "\n", 399 | "# Pull out longitudinal dynamics -- states:(theta,V,alpha,q), control:(T,ele)\n", 400 | "ix = [5,7,8,11]; iu = [1,2]; # 4 states, 3 control system.\n", 401 | "longiA = A[ix,ix];\n", 402 | "longiB = B[ix,iu];\n", 403 | "\n", 404 | "# Show system\n", 405 | "pretty_table(header = vcat(\"xdotLongi\",states[ix],controls[iu]),hcat(statesDer[ix],longiA,longiB))\n", 406 | "\n", 407 | "# Eigen values \n", 408 | "using LinearAlgebra\n", 409 | "ev = eigen(longiA).values;\n", 410 | "pretty_table(header=[\"Eigen values\"],ev)\n", 411 | "\n", 412 | "# plot(real(ev),imag(ev),seriestype=:scatter,label=\"Eigen values\")" 413 | ] 414 | }, 415 | { 416 | "cell_type": "code", 417 | "execution_count": 44, 418 | "metadata": {}, 419 | "outputs": [ 420 | { 421 | "data": { 422 | "text/plain": [ 423 | "4×4 Matrix{Float64}:\n", 424 | " 0.0 0.0 0.0 1.0\n", 425 | " -32.17 -0.0118591 -2.58453 -1.28295\n", 426 | " -3.88959e-9 -0.000255941 -0.782055 0.929171\n", 427 | " 0.0 -8.61453e-10 -0.455764 -1.01533" 428 | ] 429 | }, 430 | "metadata": {}, 431 | "output_type": "display_data" 432 | } 433 | ], 434 | "source": [ 435 | "longiA" 436 | ] 437 | }, 438 | { 439 | "cell_type": "code", 440 | "execution_count": 45, 441 | "metadata": {}, 442 | "outputs": [ 443 | { 444 | "data": { 445 | "text/plain": [ 446 | "44.99999063801584" 447 | ] 448 | }, 449 | "metadata": {}, 450 | "output_type": "display_data" 451 | } 452 | ], 453 | "source": [ 454 | "0.785398*180/pi\n" 455 | ] 456 | } 457 | ], 458 | "metadata": { 459 | "kernelspec": { 460 | "display_name": "Julia 1.11.3", 461 | "language": "julia", 462 | "name": "julia-1.11" 463 | }, 464 | "language_info": { 465 | "file_extension": ".jl", 466 | "mimetype": "application/julia", 467 | "name": "julia", 468 | "version": "1.11.3" 469 | } 470 | }, 471 | "nbformat": 4, 472 | "nbformat_minor": 2 473 | } 474 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Raktim Bhattacharya 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # F16-Model-Matlab 2 | This is a Matlab/Simulink implementation of a full nonlinear F16 aircraft model. The aerodynamics included in this model come from the NASA Technical Report 1538, Simulator Study of Stall/Post-Stall Characteristics of a Fighter Airplane with Relaxed Longitudinal Static Stability, by Nguyen, Ogburn, Gilbert, Kibler, Brown, and Deal, Dec 1979. 3 | 4 | The model is based on Aircraft Control and Simulations, by Brian Stevens and Frank Lewis, Wiley Inter-Science, New York, 1992. 5 | 6 | This is a revised implementation of the older implementation available at [MATLAB/Simulink package](https://dept.aem.umn.edu/~balas/darpa_sec/SEC.Software.html). 7 | 8 | 9 | ## Trim and Linearization 10 | * Please see trim_and_linearize.m 11 | * Trim and linearization is done using [Simulink's Control System Design and Analysis Apps](https://www.mathworks.com/products/simcontrol.html). The script file Trim16.m, exported by Simulink, is for steady-level flight. This is called by trim_and_linearize.m. 12 | 13 | 14 | -------------------------------------------------------------------------------- /TrimF16.m: -------------------------------------------------------------------------------- 1 | %% Search for a specified operating point for the model - F16. 2 | % 3 | % This MATLAB script is the command line equivalent of the specification 4 | % tab in the Steady State Manager with current specifications and options. 5 | % It produces the exact same operating points as hitting the Trim button. 6 | 7 | % MATLAB(R) file generated by MATLAB(R) 24.2 and Simulink Control Design (TM) 24.2. 8 | % 9 | % Generated on: 13-Feb-2025 21:04:29 10 | 11 | %% Specify the model name 12 | model = 'F16'; 13 | 14 | %% Create the operating point specification object. 15 | opspec = operspec(model); 16 | 17 | 18 | %% Limits 19 | control.lb = [1000*lbf2N -25*d2r -21.5*d2r -30*d2r 0]; 20 | control.ub = [19000*lbf2N 25*d2r 21.5*d2r 30*d2r 25*d2r]; 21 | 22 | %% Set the constraints on the states in the model. 23 | % - The defaults for all states are Known = false, SteadyState = true, 24 | % Min = -Inf, Max = Inf, dxMin = -Inf, and dxMax = Inf. 25 | 26 | % State (1) - F16/Nonlinear F16 Model/6DOF (Quaternion)/Calculate DCM & Euler Angles/phi theta psi 27 | % - Default model initial conditions are used to initialize optimization. 28 | opspec.States(1).Known = [true;true;true]; 29 | 30 | % State (2) - F16/Nonlinear F16 Model/6DOF (Quaternion)/p,q,r 31 | % - Default model initial conditions are used to initialize optimization. 32 | opspec.States(2).Known = true; 33 | 34 | % State (3) - F16/Nonlinear F16 Model/6DOF (Quaternion)/p,q,r 35 | % - Default model initial conditions are used to initialize optimization. 36 | opspec.States(3).Known = true; 37 | 38 | % State (4) - F16/Nonlinear F16 Model/6DOF (Quaternion)/p,q,r 39 | % - Default model initial conditions are used to initialize optimization. 40 | opspec.States(4).Known = true; 41 | 42 | % State (5) - F16/Nonlinear F16 Model/6DOF (Quaternion)/ub,vb,wb 43 | % - Default model initial conditions are used to initialize optimization. 44 | opspec.States(5).Known = true; 45 | 46 | % State (6) - F16/Nonlinear F16 Model/6DOF (Quaternion)/ub,vb,wb 47 | % - Default model initial conditions are used to initialize optimization. 48 | opspec.States(6).Known = true; 49 | 50 | % State (7) - F16/Nonlinear F16 Model/6DOF (Quaternion)/ub,vb,wb 51 | % - Default model initial conditions are used to initialize optimization. 52 | opspec.States(7).Known = true; 53 | 54 | % State (8) - F16/Nonlinear F16 Model/6DOF (Quaternion)/xe,ye,ze 55 | % - Default model initial conditions are used to initialize optimization. 56 | opspec.States(8).Known = true; 57 | opspec.States(8).SteadyState = false; 58 | 59 | % State (9) - F16/Nonlinear F16 Model/6DOF (Quaternion)/xe,ye,ze 60 | % - Default model initial conditions are used to initialize optimization. 61 | opspec.States(9).Known = true; 62 | opspec.States(9).SteadyState = false; 63 | 64 | % State (10) - F16/Nonlinear F16 Model/6DOF (Quaternion)/xe,ye,ze 65 | % - Default model initial conditions are used to initialize optimization. 66 | opspec.States(10).Known = true; 67 | 68 | %% Set the constraints on the inputs in the model. 69 | % - The defaults for all inputs are Known = false, Min = -Inf, and 70 | % Max = Inf. 71 | 72 | % Input (1) - F16/Thrust 73 | % - Default model initial conditions are used to initialize optimization. 74 | opspec.Inputs(1).Known = false; 75 | opspec.Inputs(1).Min = control.lb(1); 76 | opspec.Inputs(1).Max = control.ub(1); 77 | 78 | % Input (2) - F16/ele 79 | % - Default model initial conditions are used to initialize optimization. 80 | opspec.Inputs(2).Known = false; 81 | opspec.Inputs(2).Min = control.lb(2); 82 | opspec.Inputs(2).Max = control.ub(2); 83 | 84 | % Input (3) - F16/ail 85 | % - Default model initial conditions are used to initialize optimization. 86 | opspec.Inputs(3).Known = true; 87 | opspec.Inputs(3).u = 0; 88 | 89 | % Input (4) - F16/rud 90 | % - Default model initial conditions are used to initialize optimization. 91 | opspec.Inputs(4).Known = true; 92 | opspec.Inputs(4).u = 0; 93 | 94 | % Input (5) - F16/lef 95 | % - Default model initial conditions are used to initialize optimization. 96 | opspec.Inputs(5).Known = false; 97 | opspec.Inputs(5).Min = control.lb(5); 98 | opspec.Inputs(5).Max = control.ub(5); 99 | 100 | % Input (6) - F16/gust 101 | % - Default model initial conditions are used to initialize optimization. 102 | opspec.Inputs(6).Known = [true;true;true]; 103 | opspec.Inputs(6).u = [0;0;0]; 104 | 105 | %% Set the constraints on the outputs in the model. 106 | % - The defaults for all outputs are Known = false, Min = -Inf, and 107 | % Max = Inf. 108 | 109 | % Output (1) - F16/X,Y, Z in inertial 110 | % - Default model initial conditions are used to initialize optimization. 111 | 112 | % Output (2) - F16/Xd,Yd, Zd in inertial 113 | % - Default model initial conditions are used to initialize optimization. 114 | 115 | % Output (3) - F16/total velocity 116 | opspec.Outputs(3).y = Vt0; 117 | opspec.Outputs(3).Known = true; 118 | 119 | % Output (4) - F16/angle of attack 120 | % - Default model initial conditions are used to initialize optimization. 121 | opspec.Outputs(4).Known = false; 122 | opspec.Outputs(4).y = 0; 123 | opspec.Outputs(4).Min = -20*d2r; 124 | opspec.Outputs(4).Max = 45*d2r; 125 | 126 | % Output (5) - F16/side slip angle 127 | % - Default model initial conditions are used to initialize optimization. 128 | opspec.Outputs(5).Known = true; 129 | opspec.Outputs(5).y = 0; 130 | 131 | % Output (6) - F16/euler angles 132 | % - Default model initial conditions are used to initialize optimization. 133 | opspec.Outputs(6).Known = [true;false;true]; 134 | opspec.Outputs(6).y = [0;0;0]; 135 | 136 | % Output (7) - F16/flight path angle 137 | % - Default model initial conditions are used to initialize optimization. 138 | opspec.Outputs(7).Known = true; 139 | opspec.Outputs(7).y = 0; 140 | 141 | % Output (8) - F16/angular velocity vector (expressed in body) 142 | % - Default model initial conditions are used to initialize optimization. 143 | opspec.Outputs(8).Known = [true;true;true]; 144 | opspec.Outputs(8).y = [0;0;0]; 145 | 146 | % Output (9) - F16/linear acceleration vector (expressed in body) 147 | % - Default model initial conditions are used to initialize optimization. 148 | opspec.Outputs(9).Known = [true;true;true]; 149 | opspec.Outputs(9).y = [0;0;0]; 150 | 151 | % Output (10) - F16/angular acceleration vector 152 | % - Default model initial conditions are used to initialize optimization. 153 | opspec.Outputs(10).Known = [true;true;true]; 154 | opspec.Outputs(10).y = [0;0;0]; 155 | 156 | % Output (11) - F16/Mach 157 | % - Default model initial conditions are used to initialize optimization. 158 | 159 | % Output (12) - F16/Faero 160 | % - Default model initial conditions are used to initialize optimization. 161 | 162 | % Output (13) - F16/Maero 163 | % - Default model initial conditions are used to initialize optimization. 164 | 165 | 166 | %% Create the options 167 | opt = findopOptions('OptimizerType','graddescent',... 168 | 'DisplayReport','iter'); 169 | opt.OptimizationOptions.Algorithm = 'active-set'; 170 | opt.OptimizationOptions.MaxFunEvals = 4000; 171 | opt.OptimizationOptions.MaxIter = 2000; 172 | 173 | %% Perform the operating point search. 174 | [op,opreport] = findop(model,opspec,opt); 175 | -------------------------------------------------------------------------------- /conversion.m: -------------------------------------------------------------------------------- 1 | ft2m = 0.3048; 2 | d2r = pi/180; 3 | r2d = 180/pi; 4 | lbf2N = 4.44822; -------------------------------------------------------------------------------- /load_F16_params.m: -------------------------------------------------------------------------------- 1 | % ========================== 2 | % Developed by 3 | % Raktim Bhattacharya, 4 | % Professor 5 | % Aerospace Engineering, 6 | % Texas A&M University. 7 | % ========================== 8 | 9 | function Param = load_F16_params() 10 | % Inertia and geometry data for F16. 11 | % All parameters are in SI Units. 12 | 13 | slugs2kg = 14.5939; 14 | ft2m = 0.3048; 15 | 16 | Param.S = 300*ft2m^2; % Reference Area, m^2 17 | Param.b = 30*ft2m; % Wing Span, m 18 | Param.cbar = 11.32*ft2m; % Aerodynamic Mean Chord, m 19 | Param.rho = 1.293; % Air Density, kg/m^3 20 | Param.xcgr = 0.35; % reference center of gravity as a fraction of cbar 21 | Param.xcg = 0.30; % center of gravity as a fraction of cbar. 22 | 23 | 24 | % Moment of Inertial 25 | Ixx = 9496.0; % Principle Moment of Intertia around X-axis, slugs*ft^2 26 | Iyy = 55814.0; % Principle Moment of Intertia around Y-axis, slugs*ft^2 27 | Izz = 63100.0; % Principle Moment of Intertia around Z-axis, slugs*ft^2 28 | Ixz = 982.0; % Principle Moment of Intertia around XZ-axis,slugs*ft^2 29 | Param.moi = [Ixx 0 Ixz; 30 | 0 Iyy 0 31 | Ixz 0 Izz]*slugs2kg*(ft2m)^2; % Convert to Kg*m^2 32 | 33 | Param.mass = 636.94*slugs2kg; % kg 34 | Param.g = 9.806; % m/s^2 35 | end -------------------------------------------------------------------------------- /load_aerodynamics.m: -------------------------------------------------------------------------------- 1 | % ========================== 2 | % Developed by 3 | % Raktim Bhattacharya, 4 | % Professor 5 | % Aerospace Engineering, 6 | % Texas A&M University. 7 | % ========================== 8 | 9 | function F16AeroData = load_aerodynamics() 10 | Data = load('F16AeroDataInterpolants.mat'); 11 | F16AeroData = Data.F16AeroData; 12 | end -------------------------------------------------------------------------------- /plot_trajectories.m: -------------------------------------------------------------------------------- 1 | % ========================== 2 | % Developed by 3 | % Raktim Bhattacharya, 4 | % Professor 5 | % Aerospace Engineering, 6 | % Texas A&M University. 7 | % ========================== 8 | 9 | 10 | function plot_trajectories(simOut) 11 | r2d = 180/pi; 12 | set(0, 'DefaultLineLineWidth', 1); 13 | 14 | yout = horzcat(simOut.yout.signals.values); 15 | tout = simOut.tout; 16 | 17 | figure(1); clf; 18 | % Plot position in inertial 19 | subplot(4,3,1); plot(tout,yout(:,1)); title('$X$ Inertial Position (m)', 'interpreter', 'latex'); xlabel('Time (s)'); 20 | subplot(4,3,2); plot(tout,yout(:,2)); title('$Y$ Inertial Position (m)', 'interpreter', 'latex'); xlabel('Time (s)'); 21 | subplot(4,3,3); plot(tout,yout(:,3)); title('$Z$ Inertial Position (m)', 'interpreter', 'latex'); xlabel('Time (s)'); 22 | set(gca,'YDir','reverse'); 23 | 24 | % Plot velocity in inertial 25 | subplot(4,3,4); plot(tout,yout(:,4)); title('Inertial Velocity $\dot{X}$ (m)', 'interpreter','latex'); xlabel('Time (s)'); 26 | subplot(4,3,5); plot(tout,yout(:,5)); title('Ineritial Velocity $\dot{Y}$ (m)', 'interpreter','latex'); xlabel('Time (s)'); 27 | subplot(4,3,6); plot(tout,yout(:,6)); title('Inertial Velocity $\dot{Z}$ (m)', 'interpreter','latex'); xlabel('Time (s)'); 28 | 29 | % Plot total velocity, angle of attack, and side slip angle 30 | subplot(4,3,7); plot(tout,yout(:,7)); title('Total Velocity $V_t$ (m/s)', 'interpreter','latex'); xlabel('Time (s)'); 31 | subplot(4,3,8); plot(tout,yout(:,8)*r2d); title('Angle of Attack $\alpha$ (deg)', 'interpreter','latex'); xlabel('Time (s)'); 32 | subplot(4,3,9); plot(tout,yout(:,9)*r2d); title('Side-slip Angle $\beta$ (deg)', 'interpreter','latex'); xlabel('Time (s)'); 33 | 34 | % Plot body acceleration 35 | subplot(4,3,10); plot(tout,yout(:,17)); title('Body Accleration $\ddot{x}_b$ (m/s$^2$)', 'interpreter','latex'); xlabel('Time (s)'); 36 | subplot(4,3,11); plot(tout,yout(:,18)); title('Body Accleration $\ddot{y}_b$ (m/s$^2$)', 'interpreter','latex'); xlabel('Time (s)'); 37 | subplot(4,3,12); plot(tout,yout(:,19)); title('Body Accleration $\ddot{z}_b$ (m/s$^2$)', 'interpreter','latex'); xlabel('Time (s)'); 38 | 39 | 40 | figure(2); clf; 41 | % Plot Euler angels 42 | subplot(4,3,1); plot(tout,yout(:,10)*r2d); title('Roll Angle $\phi$ (deg)', 'interpreter', 'latex'); xlabel('Time (s)'); 43 | subplot(4,3,2); plot(tout,yout(:,11)*r2d); title('Pitch Angle $\theta$ (deg)', 'interpreter', 'latex'); xlabel('Time (s)'); 44 | subplot(4,3,3); plot(tout,yout(:,12)*r2d); title('Yaw Angle $\psi$ (deg)', 'interpreter', 'latex'); xlabel('Time (s)'); 45 | 46 | % Plot angular velocity 47 | subplot(4,3,4); plot(tout,yout(:,14)*r2d); title('Roll Rate $p$ (deg/s)', 'interpreter','latex'); xlabel('Time (s)'); 48 | subplot(4,3,5); plot(tout,yout(:,15)*r2d); title('Pitch Rate $q$ (deg/s)', 'interpreter','latex'); xlabel('Time (s)'); 49 | subplot(4,3,6); plot(tout,yout(:,16)*r2d); title('Yaw Rate $r$ (deg/s)', 'interpreter','latex'); xlabel('Time (s)'); 50 | 51 | % Plot angular acceleration 52 | subplot(4,3,7); plot(tout,yout(:,20)*r2d); title('Roll Acceleration $\dot{p}$ (deg/s)', 'interpreter','latex'); xlabel('Time (s)'); 53 | subplot(4,3,8); plot(tout,yout(:,21)*r2d); title('Pitch Acceleration $\dot{q}$ (deg/s)', 'interpreter','latex'); xlabel('Time (s)'); 54 | subplot(4,3,9); plot(tout,yout(:,22)*r2d); title('Yaw Acceleration $\dot{r}$ (deg/s)', 'interpreter','latex'); xlabel('Time (s)'); 55 | 56 | 57 | % Plot Mach and flight path angle 58 | subplot(4,3,10); plot(tout,yout(:,23)); title('Mach Number $M$', 'interpreter','latex'); xlabel('Time (s)'); 59 | subplot(4,3,11); plot(tout,yout(:,13)*r2d); title('Flight Path Angle $\gamma$ (deg)', 'interpreter','latex'); xlabel('Time (s)'); 60 | %subplot(4,3,9); plot(tout,yout{5}*r2d); title('Side-slip Angle $\beta$ (deg)', 'interpreter','latex'); xlabel('Time (s)'); 61 | 62 | end -------------------------------------------------------------------------------- /preprocess_F16_AeroData.m: -------------------------------------------------------------------------------- 1 | clc; clear all; 2 | 3 | d2r = pi/180; 4 | % Read independent variables 5 | alpha1 = h5read('F16AeroData.h5','/alpha1'); 6 | alpha2 = h5read('F16AeroData.h5','/alpha2'); 7 | beta1 = h5read('F16AeroData.h5','/beta1'); 8 | dh1 = h5read('F16AeroData.h5','/dh1'); 9 | dh2 = h5read('F16AeroData.h5','/dh2'); 10 | 11 | % Force coefficients 12 | F16AeroData.Cx = createAeroFunction(h5read('F16AeroData.h5','/_Cx'),alpha1,beta1,dh1); 13 | F16AeroData.Cy = createAeroFunction(h5read('F16AeroData.h5','/_Cy'),alpha1,beta1); 14 | F16AeroData.Cz = createAeroFunction(h5read('F16AeroData.h5','/_Cz'),alpha1,beta1,dh1); 15 | 16 | % Moment coefficients 17 | F16AeroData.Cl = createAeroFunction(h5read('F16AeroData.h5','/_Cl'),alpha1,beta1,dh2); 18 | F16AeroData.Cm = createAeroFunction(h5read('F16AeroData.h5','/_Cm'),alpha1,beta1,dh1); 19 | F16AeroData.Cn = createAeroFunction(h5read('F16AeroData.h5','/_Cn'),alpha1,beta1,dh2); 20 | 21 | % Leading edge influences 22 | F16AeroData.Cx_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cx_lef'),alpha2,beta1); 23 | F16AeroData.Cy_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cy_lef'),alpha2,beta1); 24 | F16AeroData.Cz_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cz_lef'),alpha2,beta1); 25 | 26 | F16AeroData.Cl_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cl_lef'),alpha2,beta1); 27 | F16AeroData.Cm_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cm_lef'),alpha2,beta1); 28 | F16AeroData.Cn_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cn_lef'),alpha2,beta1); 29 | 30 | % Stability Derivatives 31 | F16AeroData.Cxq = createAeroFunction(h5read('F16AeroData.h5','/_Cxq'),alpha1); 32 | F16AeroData.Cyp = createAeroFunction(h5read('F16AeroData.h5','/_Cyp'),alpha1); 33 | F16AeroData.Czq = createAeroFunction(h5read('F16AeroData.h5','/_Czq'),alpha1); 34 | F16AeroData.Cmq = createAeroFunction(h5read('F16AeroData.h5','/_Cmq'),alpha1); 35 | 36 | F16AeroData.Cyr = createAeroFunction(h5read('F16AeroData.h5','/_Cyr'),alpha1); 37 | F16AeroData.Cnr = createAeroFunction(h5read('F16AeroData.h5','/_Cnr'),alpha1); 38 | 39 | F16AeroData.Cnp = createAeroFunction(h5read('F16AeroData.h5','/_Cnp'),alpha1); 40 | F16AeroData.Clp = createAeroFunction(h5read('F16AeroData.h5','/_Clp'),alpha1); 41 | F16AeroData.Clr = createAeroFunction(h5read('F16AeroData.h5','/_Clr'),alpha1); 42 | 43 | F16AeroData.deltaCxq_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaCxq_lef'),alpha2); 44 | F16AeroData.deltaCyr_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaCyr_lef'),alpha2); 45 | F16AeroData.deltaCyp_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaCyp_lef'),alpha2); 46 | 47 | F16AeroData.deltaCzq_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaCzq_lef'),alpha2); 48 | F16AeroData.deltaClr_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaClr_lef'),alpha2); 49 | F16AeroData.deltaClp_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaClp_lef'),alpha2); 50 | 51 | F16AeroData.deltaCmq_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaCmq_lef'),alpha2); 52 | F16AeroData.deltaCnr_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaCnr_lef'),alpha2); 53 | F16AeroData.deltaCnp_lef = createAeroFunction(h5read('F16AeroData.h5','/_deltaCnp_lef'),alpha2); 54 | 55 | % Other data 56 | F16AeroData.Cy_r30 = createAeroFunction(h5read('F16AeroData.h5','/_Cy_r30'),alpha1,beta1); 57 | F16AeroData.Cn_r30 = createAeroFunction(h5read('F16AeroData.h5','/_Cn_r30'),alpha1,beta1); 58 | F16AeroData.Cl_r30 = createAeroFunction(h5read('F16AeroData.h5','/_Cl_r30'),alpha1,beta1); 59 | 60 | F16AeroData.Cy_a20 = createAeroFunction(h5read('F16AeroData.h5','/_Cy_a20'),alpha1,beta1); 61 | F16AeroData.Cy_a20_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cy_a20_lef'),alpha2,beta1); 62 | 63 | F16AeroData.Cn_a20 = createAeroFunction(h5read('F16AeroData.h5','/_Cn_a20'),alpha1,beta1); 64 | F16AeroData.Cn_a20_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cn_a20_lef'),alpha2,beta1); 65 | 66 | F16AeroData.Cl_a20 = createAeroFunction(h5read('F16AeroData.h5','/_Cl_a20'),alpha1,beta1); 67 | F16AeroData.Cl_a20_lef = createAeroFunction(h5read('F16AeroData.h5','/_Cl_a20_lef'),alpha2,beta1); 68 | 69 | F16AeroData.deltaCnbeta = createAeroFunction(h5read('F16AeroData.h5','/_deltaCnbeta'),alpha1); 70 | F16AeroData.deltaClbeta = createAeroFunction(h5read('F16AeroData.h5','/_deltaClbeta'),alpha1); 71 | F16AeroData.deltaCm = createAeroFunction(h5read('F16AeroData.h5','/_deltaCm'),alpha1); 72 | 73 | F16AeroData.eta_el = createAeroFunction(h5read('F16AeroData.h5','/_eta_el'),dh1); 74 | 75 | save F16AeroDataInterpolants F16AeroData 76 | 77 | function fcn = createAeroFunction(data,varargin) 78 | n = length(varargin); 79 | L = zeros(1,n); 80 | for i = 1:n 81 | L(i) = length(varargin{i}); 82 | end 83 | 84 | if n == 1 85 | fcn = griddedInterpolant(varargin,data,'linear','none'); 86 | else 87 | fcn = griddedInterpolant(varargin,reshape(data,L),'linear','none'); 88 | end 89 | 90 | end -------------------------------------------------------------------------------- /runF16.m: -------------------------------------------------------------------------------- 1 | clc; clear; 2 | 3 | conversion % loads conversion constants. see conversion.m for defintions. 4 | 5 | Param = load_F16_params(); % System Parameters 6 | 7 | % Simulate with Arbitrary Initial Conditions 8 | % ========================================== 9 | h0 = -10000*ft2m; % 10 ft altitude 10 | Vt0 = 300*ft2m; 11 | 12 | % Need to specify IC to initialize simulink. 13 | IC.inertial_position = [0,0,h0]; % At 10 Km altitude. 14 | IC.body_velocity = [Vt0,0,0]; % We may need to get this from Mach, alpha, beta 15 | IC.euler_angles = [0,0,0]*d2r; % Euler angles 16 | IC.omega = [0,0,0] ; % Angular velocity in body coordinate system 17 | t0 = 0; 18 | 19 | x0 = [IC.inertial_position, IC.euler_angles, IC.body_velocity, IC.omega]; 20 | u0 = [9000*lbf2N,0,0,0,0,0,0]; 21 | 22 | % [sys,x01,str,ts] = F16([],[],[],'compile'); % Uses x0 as initial condition. x01 and x0 should be the same. 23 | % y0 = F16(t0, x0, u0, 'outputs'); % Need this to update the dynamics with current state values 24 | % xdot = F16(t0,x0,u0,'derivs'); 25 | % F16([],[],[],'term'); 26 | % disp(xdot) 27 | 28 | Tend = 5; 29 | simout = sim('F16Testing'); 30 | plot_trajectories(simout); 31 | -------------------------------------------------------------------------------- /test_with_julia.m: -------------------------------------------------------------------------------- 1 | clc; clear; 2 | 3 | conversion % loads conversion constants. see conversion.m for defintions. 4 | 5 | Param = load_F16_params(); % System Parameters 6 | 7 | % Simulate with Arbitrary Initial Conditions 8 | % ========================================== 9 | h0 = -10000*ft2m; % 10 ft altitude 10 | Vt0 = 300*ft2m; 11 | 12 | % Need to specify IC to initialize simulink. 13 | IC.inertial_position = [0,0,h0]; % At 10 Km altitude. 14 | IC.body_velocity = [Vt0,0,0]; % We may need to get this from Mach, alpha, beta 15 | IC.euler_angles = [0,0,0]*d2r; % Euler angles 16 | IC.omega = [0,0,0] ; % Angular velocity in body coordinate system 17 | t0 = 0; 18 | 19 | x0 = [IC.inertial_position, IC.euler_angles, IC.body_velocity, IC.omega]; 20 | u0 = [9000*lbf2N,2*d2r,2*d2r,2*d2r,2*d2r,0,0]; 21 | 22 | % [sys,x01,str,ts] = F16([],[],[],'compile'); % Uses x0 as initial condition. x01 and x0 should be the same. 23 | % y0 = F16(t0, x0, u0, 'outputs'); % Need this to update the dynamics with current state values 24 | % xdot = F16(t0,x0,u0,'derivs'); 25 | % F16([],[],[],'term'); 26 | % disp(xdot) 27 | 28 | Tend = 10; 29 | simout = sim('F16Testing'); 30 | 31 | 32 | %% 33 | plot_trajectories(simout); 34 | 35 | % Load data from Julia implementation. 36 | data = load('F16_Julia_Dump.mat'); 37 | 38 | figure(1); 39 | subplot(4,3,1); hold on; plot(data.tout,data.xout(1,:)*ft2m,"r"); 40 | subplot(4,3,2); hold on; plot(data.tout,data.xout(2,:)*ft2m,"r"); 41 | subplot(4,3,3); hold on; plot(data.tout,-data.xout(3,:)*ft2m,"r"); 42 | 43 | subplot(4,3,7); hold on; plot(data.tout,data.xout(7,:)*ft2m,"r"); 44 | subplot(4,3,8); hold on; plot(data.tout,data.xout(8,:)*r2d,"r"); 45 | subplot(4,3,9); hold on; plot(data.tout,data.xout(9,:)*r2d,"r"); 46 | 47 | 48 | figure(2); 49 | subplot(4,3,1); hold on; plot(data.tout,data.xout(4,:)*r2d,"r"); 50 | subplot(4,3,2); hold on; plot(data.tout,data.xout(5,:)*r2d,"r"); 51 | subplot(4,3,3); hold on; plot(data.tout,data.xout(6,:)*r2d,"r"); 52 | subplot(4,3,4); hold on; plot(data.tout,data.xout(10,:)*r2d,"r"); 53 | subplot(4,3,5); hold on; plot(data.tout,data.xout(11,:)*r2d,"r"); 54 | subplot(4,3,6); hold on; plot(data.tout,data.xout(12,:)*r2d,"r"); -------------------------------------------------------------------------------- /trim_and_linearize.m: -------------------------------------------------------------------------------- 1 | % ========================================================================= 2 | % Model of the F-16 Aircraft model. 3 | % 4 | % References: 5 | % NASA Technical Report 1538, Simulator Study of Stall/Post-Stall Characteristics of a Fighter Airplane with Relaxed Longitudinal Static Stability, 6 | % by Nguyen, Ogburn, Gilbert, Kibler, Brown, and Deal, Dec 1979. 7 | % 8 | % The model is based on Aircraft Control and Simulations, by Brian Stevens and Frank Lewis, Wiley Inter-Science, New York, 1992. 9 | % 10 | % All units in this model are in SI SYSTEM. 11 | % 12 | % Model developed by 13 | % Raktim Bhattacharya, 14 | % Professor 15 | % Aerospace Engineering, 16 | % Texas A&M University. 17 | % 18 | % ========================================================================= 19 | 20 | % ============================= Model Details ============================= 21 | % The 12 states of the system are as follows: 22 | % 23 | % N: North position in ft 24 | % E: East position in ft 25 | % h: Altitude in ft, min: 5000 ft, max: 40000 ft 26 | % phi: Roll angle in rad 27 | % theta: Pitch angle in rad 28 | % psi: Yaw angle in rad 29 | % Vt: Magnitude of total velocity in ft/s, min: 300 ft/s, max: 900 ft/s 30 | % alpha: Angle of attack in rad, min: -20 deg, max: 45 deg 31 | % beta: Side slip angle in rad, min: -30 deg, max: 30 deg 32 | % p: Roll rate in rad/s 33 | % q: Pitch rate in rad/s 34 | % r: Yaw rate in rad/s 35 | % The 5 control variables are: 36 | % 37 | % T: Thrust in lbf, min: 1000, max: 19000 38 | % dele: Elevator angle in deg, min:-25, max: 25 39 | % dail: Aileron angle in deg, min:-21.5, max: 21.5 40 | % drud: Rudder angle in deg, min: -30, max: 30 41 | % dlef: Leading edge flap in deg, min: 0, max: 25 42 | % Actuator models are defined as: 43 | % 44 | % T: max |rate|: 10,000 lbs/s 45 | % dele: max |rate|: 60 deg/s 46 | % dail: max |rate|: 80 deg/s 47 | % drud: max |rate|: 120 deg/s 48 | % dlef: max |rate|: 25 deg/s 49 | % ========================================================================= 50 | clear; 51 | 52 | conversion % loads conversion constants. see conversion.m for defintions. 53 | 54 | Param = load_F16_params(); % System Parameters 55 | 56 | % Simulate with Arbitrary Initial Conditions 57 | % ========================================== 58 | h0 = -10000*ft2m; % 10 ft altitude 59 | Vt0 = 300*ft2m; 60 | 61 | % Need to specify IC to initialize simulink. 62 | IC.inertial_position = [0,0,h0]; % At 10 Km altitude. 63 | IC.body_velocity = [Vt0,0,0]; % We may need to get this from Mach, alpha, beta 64 | IC.euler_angles = [0,0,0]*d2r; % Euler angles 65 | IC.omega = [0,0,0] ; % Angular velocity in body coordinate system 66 | Tend = 2.0; % Simulation time in seconds. 67 | 68 | % Trim F16. 69 | TrimF16; % Creates op, opreport 70 | linsys = linearize('F16',op); % Linearize about operating point op. 71 | 72 | % Indices for states, inputs, and outputs for longitudinal model. 73 | % States are: 74 | ix = [5,7,9,11]; % th, U, w, q 75 | iu = [1,2,5,6,8]; % T, dele, lef, dx, dz (last two are dist in longi plane) 76 | iy = [7,8,13,15,17,19]; % Vt, alp, q, xbdd, zbdd 77 | 78 | 79 | A = linsys.A(ix,ix); 80 | eig(A) % Check eigen values and determine properties of Phugoid/SP modes 81 | 82 | 83 | --------------------------------------------------------------------------------