summaryrefslogtreecommitdiff
path: root/3432/CH7/EX7.16/Ex7_16.sce
blob: 36e32f8053eba6a5c0bd3f15d236518e21091c9e (plain)
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
//Example 7.16
//Ackermann's formula for undamped oscillator.

xdel(winsid())//close all graphics Windows
clear;
clc;
//------------------------------------------------------------------
//undamped oscillator (Pendulum) state model;
w0=1;

F=[0 1;-w0^2 0];
G=[0 1]';
H=eye(2,2); //representing x1 and x2 states as outputs
J=[0 0]';
//------------------------------------------------------------------
//Ackermann's formula for feedback gain computation

pc=[-2 -2];   //desired poles
exec('./acker_dk.sci', -1);
[K,eig]=acker_dk(F,G,pc)
disp(K,"Feedback gain K=")
disp(eig,"Closed loop eigen values are ")
//------------------------------------------------------------------