-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcreate_ol_sys.m
More file actions
29 lines (28 loc) · 809 Bytes
/
create_ol_sys.m
File metadata and controls
29 lines (28 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%% create_ol_sys
% Creates open loop system for inverted pendulum
% Authorship:
% Scott Barnes
% The George Washington University
% MAE 6246: Electromechanical Control Systems
% Final Project: Inverted Pendulum
% Inputs
% m: Pendulum Mass
% M: Cart Mass
% l: Pendulum Length
% g: Gravity
% F: Noise Magnitude
% Outputs
% A: A matrix of Open Loop System
% B: B matrix of Open Loop System
% C: C matrix of Open Loop System
% D: D matrix of Open Loop System
% F1: Magnitude of Plant Noise
% F2: Magnitude of Measurement Noise
function [A, B, C, D, F1, F2] = create_ol_sys(m, M, l, g)
% Plant
A = [0 0 1 0; 0 -m*g/M 0 0; 0 0 0 1; 0 g*(M+m)/(m*l) 0 0];
B = [0; 1/M; 0; -1/(M*l)];
% Measurement
C = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1];
D = [0; 0; 0; 0];
end