Inverted Pendulum

H. G. Kwatny

Department of Mechanical Engineering & Mechanics
Drexel University

Introduction

<< ProPac`;

?ProPac`Dynamics`*

Model

Joint Data

r1 = {1}; q1 = {x}; p1 = {v};
H1 = {{0}, {0}, {0}, {1}, {0}, {0}};
r2 = {1}; q2 = {θ}; p2 = {ω};
H2 = {{0}, {1}, {0}, {0}, {0}, {0}};

JointLst = {{r1, H1, q1, p1}, {r2, H2, q2, p2}};

Body Data

cm1 = {0, 0, 0}; 
    out1 = {{2, {0, 0, 0}} } ;   I1 = {{Jxx, 0, Jxz}, {0, Jyy, 0}, {Jxz, 
          0, Jzz}}; m1 = 1;
cm2 = {0, 0, 1}; out2 = {{3, {0, 0, 1}}};
m2 = 1;
I2 = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};

BodyLst = {{cm1, out1, m1, I1}, {cm2, out2, m2, I2}};
TreeLst = {{{1, 1}, {2, 2}}};
q = Join[q1, q2];
p = Join[p1, p2];

Q = {F, 0};
\(\({V, X, H, M, Csys, Fsys, psys, qsys} = 
	
        CreateModel[JointLst, BodyLst, TreeLst, 1, 0, Q];\)\)

V // MatrixForm
FullSimplify[M] // MatrixForm
Simplify[Csys . psys + Fsys] // MatrixForm

FullSimplify[Inverse[M] . (Csys . psys + Fsys)]