Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Feb 8, 2010 #1
    1. The problem statement, all variables and given/known data

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


    2. Relevant equations

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

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

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


    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. jcsd
  3. Feb 8, 2010 #2
    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)
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook