Help constructing state-space model of a system

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
tehipwn
Messages
16
Reaction score
0

Homework Statement



A single wheel cat moving on the plane with linear velocity v angular velocity [tex]\omega[/tex] can be modeled by the nonlinear system:

dpx/dt = v*cos([tex]\theta[/tex])

dpy/dt = v*sin([tex]\theta[/tex])

d[tex]\theta[/tex]/dt = [tex]\omega[/tex]

where (px,py) denote the cartesian coordinates of the wheel and [tex]\theta[/tex] its orientation. The system has input u=[v [tex]\omega[/tex]] '.

Construct a state-space model for this system with state

*note: These are both 3x1 matrixes.

[x1] = [[px*cos([tex]\theta[/tex]) + (py-1)*sin([tex]\theta[/tex])]
[x2] = [-px*sin([tex]\theta[/tex]) + (py-1)*cos([tex]\theta[/tex])]
[x3] = [[tex]\theta[/tex]]]

and output y = [x1 x2] '


Homework Equations



dpx/dt = v*cos([tex]\theta[/tex])

dpy/dt = v*sin([tex]\theta[/tex])

d[tex]\theta[/tex]/dt = [tex]\omega[/tex]


The Attempt at a Solution



I don't have much. I'm pretty sure to put the given state into a state-space model I will take the derivative of both sides of the system with respect to t. If that's the correct method, I guess I'm not sure of how to take the derivative of the right side with respect to t since I know the velocity and acceleration functions are functions of time, but the stated system doesn't explicitly show the variable t. Any ideas anyone?
 
Physics news on Phys.org
I have came up with the following MATLAB code, let me know if it looks corrects if anyone is checking this thread:

syms v theta omega t

pxdt = v*cos(theta); % System dynamics
pydt = v*sin(theta);
thetadt = omega;

px = int(pxdt,t);
py = int(pydt,t);
theta = int(omega,t);
% Given system state:
x = [px*cos(theta)+(py-1)*sin(theta); -px*sin(theta)+(py-1)*cos(theta); theta];
% State-Space Model: Part (a)
dxdt = diff(x,t)