Home > mpt > examples > models > pwa_car.m

# pwa_car

## PURPOSE

PWA_CAR 2nd order PWA model of a car moving on road with different slopes

## SYNOPSIS

This is a script file.

## DESCRIPTION

```PWA_CAR 2nd order PWA model of a car moving on road with different slopes

---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------

Model of a friction-less car moving in a horizontal plane with different
slopes. The controller is required to steer the car to the origin (=zero
position, zero acceleration) as fast as possible. Dynamical behavior of the
system is defined by Newton's laws as follows:

dp/dt = v
m dv/dt = u - m g sin(alpha)

discretization of the above system with sampling time of 0.1 seconds yelds the
following affine system:

[ p(k+1) ]   [1 0.1] [p(k)]   [0.005]        [c              ]
[ v(k+1) ] = [0  1 ] [v(k)] + [0.1  ] u(k) + [-g sin(alpha_i)]

The track has 4 segments (x1 denotes the horizontal position):

x1 >= -0.1          ->    alpha = 0 degrees
-4 <= x1 <= -3     ->    alpha = 0 degrees
-3 <= x1 <= -0.1    ->    alpha = 10 degrees
x1 <= -4           ->    alpha = -5 degrees

The car is assumed to start from the 2nd region. Because of the constraints on
control input, it is not possible to climb up the hill towards the origin
directly, additional speed has to be gained by first moving the opposite
direction and even then fully accelerate to reach the origin.

USAGE:
pwa_car
ctrlStruct = mpt_control(sysStruct,probStruct)'

---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
none

---------------------------------------------------------------------------
OUTPUT
---------------------------------------------------------------------------
sysStruct, probStruct - system and problem definition structures stores
in the workspace```

## CROSS-REFERENCE INFORMATION

This function calls:
• polytope POLYTOPE Default constructor for the POLYTOPE object
This function is called by:

Generated on Thu 30-Mar-2006 10:26:47 by m2html © 2003