The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Controllability Matrix on HP50G and CAS exemples
Message #1 Posted by Gilles Carpentier on 15 Apr 2012, 4:37 p.m.

Unless i'm wrong, there is no integrated command in the 50G to calculate a controllability matrix.

This can be done for example in Matlab with the 'ctrb' command. Here is a general Rpl program to do this :

« -> a b « « a n ^ b * TRN » 'n' 0 a SIZE HEAD 1 - 1 SEQ

« AUGMENT » STREAM TRN » »

'Ctrb' STO

This new command works either in exact, approx or symbolic mode. But perhaps is there another way to do this ?

Here are interesting explanations and exercices about controllability : http://www.control.utoronto.ca/~broucke/ece557f/Lectures/ch3.pdf

My examples are taken from the prévious link ( University of Toronto) and 3.1.3 case is interesting about the 50G Cas power

(exact mode, Real) :

3.1.1 -----

[[ 0 1 0 0 ] ['-K/M1' 0 'K/M1' 0 ] [ 0 0 0 1 ] [ 'K/M2' 0 '-K/M2' 0 ]]

[[ 0 0 ] ['1/M1' 0 ] [ 0 0 ] [ 0 '1/M2']]

Ctrb

->

[[ 0 0 '1/M1' 0 0 0 '-(K/M1^2)' 'K/(M2*M1)' ] [ '1/M1' 0 0 0 '-(K/M1^2)' 'K/(M2*M1)' 0 0 ] [ 0 0 0 '1/M2' 0 0 'K/(M2*M1)' '-(K/M2^2)' ] [ 0 '1/M2' 0 0 'K/(M2*M1)' '-(K/M2^2)' 0 0 ]]

RANK

-> 4 @ The system is controllable (Rank = n)

3.1.2 -----

[[0 1 0 0] ['-K/M1' 0 'K/M1' 0] [ 0 0 0 1] ['K/M2' 0 '-K/M2' 0] ]

[[0] ['-1/M1'] [ 0] ['1/M2']]

Ctrb

->

[[ 0 '-1/M1' 0 '(K*(M1*M1)+K*(M2*M1))/(M2*M1*(M1*M1))' ] [ '-1/M1' 0 '(K*(M1*M1)+K*(M2*M1))/(M2*M1*(M1*M1))' 0 ] [ 0 '1/M2' 0 '(-(K*(M1*M2))-K*(M2*M2))/(M2*M2*(M1*M2))' ] [ '1/M2' 0 '(-(K*(M1*M2))-K*(M2*M2))/(M2*M2*(M1*M2))' 0 ]]

RANK

-> 2 @ The system is not controllable (Rank <> 4)

3.1.3 -----

[[-1 1] [0 -2]] 'A' STO @ use Matrix writer

[[0] [1]] 'B' STO

A IDN 's' * A - 1/x @ (s.I -A)^(-1) FACTOR @ Factorise

->

[[ '1/(s+1)' '1/((s+2)*(s+1))' ] [ 0 '1/(s+2)' ]]

A 't' * << EXP >> DIAGMAP @ e^(At)

->

[[ '1/EXP(t)' '(-EXP(t)+EXP(2*t))/(EXP(2*t)*EXP(t))' ] [ 0 '1/EXP(2*t)' ]]

'eAt' STO @ or use DUP/ SWAP after

eAt B * B TRN * eAt TRN * @ Wc(t)

-> [[ '(-EXP(t)+EXP(2*t))*(-EXP(t)+EXP(2*t))/(EXP(2*t)*EXP(t)*(EXP(2*t)*EXP(t)))' '(-EXP(t)+EXP(2*t))/(EXP(2*t)*(EXP(2*t)*EXP(t)))' ] [ '(-EXP(t)+EXP(2*t))/(EXP(2*t)*EXP(t)*EXP(2*t))' '1/(EXP(2*t)*EXP(2*t))' ]]

<< {'t' 'T'} | >> MAP @ change t by T

<< 0 SWAP 't' SWAP 'T' Integrate >> MAP @ (*) integrate = symbol Shift TAN LIN @ Linearize

->

[[ '1/12+-1/2*EXP(-(2*t))+2/3*EXP(-(3*t))+-1/4*EXP(-(4*t))' 12+-1/3*EXP(-(3*t))+1/4*EXP(-(4*t))' ] [ '1/12+-1/3*EXP(-(3*t))+1/4*EXP(-(4*t))' '1/4+-1/4*EXP(-(4*t))' ]]

(*) or, if you don't want to use 'blind' stack manipulation : << -> f 'Integrate(0,t,f,T)' >> MAP

Edited: 15 Apr 2012, 4:39 p.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall