# Homework Help: Help constructing state-space model of a system

1. Feb 8, 2010

### tehipwn

1. The problem statement, all variables and given/known data

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] '

2. Relevant equations

dpx/dt = v*cos($$\theta$$)

dpy/dt = v*sin($$\theta$$)

d$$\theta$$/dt = $$\omega$$

3. 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?

2. Feb 8, 2010

### tehipwn

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);