Documentation

step

System object: phased.Platform
Package: phased

Output current position, velocity, and orientation axes of platform

Syntax

[P,V] = step(H,T)
[P,V,AX] = step(H,T)

Description

[P,V] = step(H,T) returns the current position, P, and the current velocity, V, of the platform. The method then updates the position and velocity using the equation P = P + VT where T specifies the elapsed time (in seconds) for the current step.

[P,V,AX] = step(H,T) returns the additional output AX as the platform's orientation axes when you set the OrientationAxesOutputPort property to true.

    Note:   The object performs an initialization the first time the step method is executed. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object™ issues an error. To change nontunable properties or inputs, you must first call the release method to unlock the object.

Examples

collapse all

Simulate motion of two platforms

Create two moving platforms. The first starts at the origin has a velocity of (100,100,0) meters per second. The other starts at (1000,0,0) meters and has a velocity of (0,200,0) meters per second. Finally, specify different local coordinate axes for each platform defined by rotation matrices. Setting the OrientationAxesOutputPort property to true lets you retrieve the local coordinate axes at each step.

Set up the plaform object.

pos0 = [[0;0;0],[1000;0;0]];
vel0 = [[100;100;0],[0;200;0]];
R1 = rotx(30);
R2 = roty(45);
laxes(:,:,1) = R1;
laxes(:,:,2) = R2;
sPlat = phased.Platform(pos0,vel0,...
    'OrientationAxes',laxes,...
    'OrientationAxesOutputPort',true);

Simulate the motion of the platform for two time steps, assuming the time elapsed for each step is one second. The position of the platform is updated after each step.

T = 1;

At the first step, the position and velocity equal the initial values.

[pos,v,lax] = step(sPlat,T);
pos
lax
pos =

           0        1000
           0           0
           0           0


lax(:,:,1) =

    1.0000         0         0
         0    0.8660   -0.5000
         0    0.5000    0.8660


lax(:,:,2) =

    0.7071         0    0.7071
         0    1.0000         0
   -0.7071         0    0.7071

At the second step, the position is updated.

[pos,v,lax] = step(sPlat,T);
pos
lax
pos =

         100        1000
         100         200
           0           0


lax(:,:,1) =

    1.0000         0         0
         0    0.8660   -0.5000
         0    0.5000    0.8660


lax(:,:,2) =

    0.7071         0    0.7071
         0    1.0000         0
   -0.7071         0    0.7071

Was this topic helpful?