~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to demos/robust/rob.dem

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright INRIA
2
 
mode(1)
3
 
s=poly(0,'s');
4
 
 
5
 
//MAC-FARLANE PROBLEM for G=1/s^3;
6
 
 
7
 
[P,r]=macglov(1/s^3);clean(P)
8
 
 
9
 
//Optimal controller K:
10
 
 
11
 
halt()
12
 
//K Optimal controller , ro = gamaopt^-2;
13
 
[K,ro]=h_inf(P,r,0,1,30);
14
 
K,gamaopt=1/sqrt(ro)
15
 
 
16
 
// Check internal stability:
17
 
 
18
 
halt()
19
 
 
20
 
Tzw=lft(tf2ss(P),tf2ss(K));
21
 
 
22
 
[Acl,Bcl,Ccl,Dcl]=abcd(Tzw); spec(Acl)
23
 
 
24
 
//Optimal gain:
25
 
 
26
 
halt()
27
 
 
28
 
ga=h_norm(Tzw)
29
 
 
30
 
//Compare with gamaopt
31
 
 
32
 
ga-gamaopt
33
 
 
34
 
//Compare with theory
35
 
 
36
 
halt()
37
 
 
38
 
[N,M]=lcf(tf2ss(1/s^3)); //Left coprime factorization of G.
39
 
 
40
 
nk=hankelsv([N,M]);
41
 
 
42
 
ro-( 1-nk(1) )
43