Main Content

constaccjac

Jacobian of state transition function based on constant-acceleration motion model

Description

Jx = constaccjac(state) returns the Jacobian of the state transition function based on the constant-acceleration motion model. The default time step is 1 second. By default, constaccjac returns the Jacobian Jx with respect to the input state, state.

example

Jx = constaccjac(state,dt) also specifies the time step, dt.

example

[Jx,Jw] = constaccjac(state,w,dt) specifies the state noise, w, and returns the Jacobian, Jw, of the state with respect to the noise.

Examples

collapse all

Compute the state Jacobian for two-dimensional constant-acceleration motion.

Define an initial state and compute the state Jacobian for a one second update time.

state = [1,1,1,2,1,0];
jacobian = constaccjac(state)
jacobian = 6×6

    1.0000    1.0000    0.5000         0         0         0
         0    1.0000    1.0000         0         0         0
         0         0    1.0000         0         0         0
         0         0         0    1.0000    1.0000    0.5000
         0         0         0         0    1.0000    1.0000
         0         0         0         0         0    1.0000

Compute the state Jacobian for two-dimensional constant-acceleration motion. Set the step time to 0.5 seconds.

state = [1,1,1,2,1,0].';
jacobian = constaccjac(state,0.5)
jacobian = 6×6

    1.0000    0.5000    0.1250         0         0         0
         0    1.0000    0.5000         0         0         0
         0         0    1.0000         0         0         0
         0         0         0    1.0000    0.5000    0.1250
         0         0         0         0    1.0000    0.5000
         0         0         0         0         0    1.0000

Input Arguments

collapse all

State vector for constant-acceleration motion, specified as a real-valued 3N-element vector. N is the number of spatial degrees of freedom of motion. For each spatial degree of motion, the state vector takes the form shown in this table.

Spatial DimensionsState Vector Structure
1-D[x;vx;ax]
2-D[x;vx;ax;y;vy;ay]
3-D[x;vx;ax;y;vy;ay;z;vz;az]

For example, x represents the x-coordinate, vx represents the velocity in the x-direction, and ax represents the acceleration in the x-direction. If the motion model is in one-dimensional space, the y- and z-axes are assumed to be zero. If the motion model is in two-dimensional space, values along the z-axis are assumed to be zero. Position coordinates are in meters. Velocity coordinates are in meters/second. Acceleration coordinates are in meters/second2.

Example: [5;0.1;0.01;0;-0.2;-0.01;-3;0.05;0]

Data Types: single | double

Time step interval, specified as a positive scalar. Time units are in seconds.

Example: 0.5

Data Types: single | double

State noise, specified as a scalar or real-valued real valued N-by-1 vector. N is the number of motion dimensions. For example, N = 2 for the 2-D motion. If specified as a scalar, the scalar value is expanded to a N-by-1 vector.

Data Types: single | double

Output Arguments

collapse all

Jacobian of the state transition function with respect to the input state, returned as a real-valued 3N-by-3N matrix. The function constructs the Jacobian from the partial derivatives of the state at the updated time step with respect to the state at the input time step.

Jacobian of the state transition function with respect to the noise, returned as a real-valued 3N-by-N matrix. N is the number of spatial degrees of motion. For example, N = 2 for the 2-D motion. The function constructs the Jacobian from the partial derivatives of the state at the updated time step with respect to the noise components.

Algorithms

For a two-dimensional constant-acceleration process, the Jacobian matrix after a time step, T, is block diagonal:

[1T12T200001T0000010000001T12T200001T000001]

The block for each spatial dimension has this form:

[1T12T201T001]

For each additional spatial dimension, add an identical block.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2018b