lqg/lqg_as1.py
author Puneeth Chaganti <punchagan@fossee.in>
Fri, 27 May 2011 14:24:59 +0530
changeset 0 0efde00f9229
permissions -rw-r--r--
Initial commit.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     1
#!/usr/bin/python
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     2
# 13.8
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     3
# Solves Example 3.1 of Ahlen and Sternad in Hunt's book
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     4
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     5
import scipy as sp
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     6
from lqg import lqg
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     7
from cl import cl
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     8
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
     9
A, dA = sp.array([1, -0.9]), 1
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    10
B, dB = sp.array([0.1, 0.08]), 1
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    11
F, dF = 1, 0
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    12
C, dC = 1, 0
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    13
k = 2
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    14
V, dV = 1, 0
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    15
W, dW = sp.array([1, -1]), 1
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    16
rho = 0.1
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    17
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    18
R1,dR1,Sc,dSc = lqg_simple(A,dA,B,dB,C,dC,k,rho,V,dV,W,dW,F,dF)
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    19
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    20
print "R1", R1
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    21
print "dR1", dR1
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    22
print "Sc", Sc
0efde00f9229 Initial commit.
Puneeth Chaganti <punchagan@fossee.in>
parents:
diff changeset
    23
print "dSc", dSc