Help constructing state-space model of a system

AI Thread Summary
The discussion focuses on constructing a state-space model for a single wheel cat system defined by its nonlinear dynamics. The user attempts to derive the state-space model by differentiating the system's equations with respect to time but struggles with the time dependency of the velocity and acceleration functions. They share MATLAB code to illustrate their approach, which includes symbolic integration and differentiation of the state variables. The community is invited to review the code and provide feedback on its correctness. The thread emphasizes the importance of correctly applying derivatives in the context of state-space modeling.
tehipwn
Messages
16
Reaction score
0

Homework Statement



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

dpx/dt = v*cos(\theta)

dpy/dt = v*sin(\theta)

d\theta/dt = \omega

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

Construct a state-space model for this system with state

*note: These are both 3x1 matrixes.

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

and output y = [x1 x2] '


Homework Equations



dpx/dt = v*cos(\theta)

dpy/dt = v*sin(\theta)

d\theta/dt = \omega


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)
 
Back
Top