function dotq = car (t, q)
% Ž©“®ŽÔ‚Ì‰^“®•û’öŽ®
    global mass;
    global inertia;
    global damping;
    global angulardamping;
    global gamma;

    x = q(1); y = q(2); theta = q(3);
    vx = q(4); vy = q(5); omega = q(6);

    dotx = vx; doty = vy; dottheta = omega;

    Ctheta = cos(theta); Stheta = sin(theta);

    if (t <= 10)
        f = 3000; tau = 0;
    elseif (t <= 20)
        f = 3000; tau = -50;
    elseif (t <= 50)
        f = 3000; tau = 50;
    elseif (t <= 60)
        f =  0; tau = 0;
    elseif (t <= 90)
        f = -1200; tau = 0;
    else
        f = 0; tau = 0;
    end
    
    A = [ mass, 0, 0, -Stheta; ...
          0, mass, 0,  Ctheta; ...
          0, 0, inertia, 0; ...
          -Stheta, Ctheta, 0, 0 ];
    b = [ -damping*vx + f*Ctheta;
          -damping*vy + f*Stheta;
          -angulardamping*omega + tau;
          vx*Ctheta*omega + vy*Stheta*omega + gamma*(vx*Stheta - vy*Ctheta) ];
      d = A\b;
      dotvx = d(1); dotvy = d(2); dotomega = d(3);

      dotq = [ dotx; doty; dottheta; dotvx; dotvy; dotomega ];
end
