From 98e1a3bc15560a206eb31f02dd2fcacf51ff19b8 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 29 Mar 2024 21:17:40 +0100 Subject: Add MATLAB code --- midterm.m | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 midterm.m (limited to 'midterm.m') diff --git a/midterm.m b/midterm.m new file mode 100644 index 0000000..8f8e5e1 --- /dev/null +++ b/midterm.m @@ -0,0 +1,41 @@ +% Copyright (c) 2024, Naoki Sean Pross, ETH Zürich + +%% ------------------------------------------------------------------------ +% Clear environment and generate parameters + +clear; clc; close all; +params = uav_params(); + +%% ------------------------------------------------------------------------ +% Create nominal plant and controller + +% Generate nominal model +model = uav_model(params); +ctrl = uav_ctrl_nominal(params, model); + +% Model dimensions +nx = model.linear.Nx; + +% Open loop path +L = model.linear.StateSpace * ctrl.K; + +% Closed loop path under unitary negative gain +G = feedback(L, eye(nx, nx)); + +%% ------------------------------------------------------------------------ +% Simulate nominal controller + +%% ------------------------------------------------------------------------ +% Define performance goals + +%% ------------------------------------------------------------------------ +% Create uncertain model + +%% ------------------------------------------------------------------------ +% Define stability goals + +%% ------------------------------------------------------------------------ +% Perform H-infinity design + +%% ------------------------------------------------------------------------ +% Perform mu-Analysis \ No newline at end of file -- cgit v1.2.1