Main Content

ctrvjac

Jacobian of state transition function based on constant turn-rate and velocity-magnitude motion model

Since R2024b

Description

Jx = ctrvjac(state) returns the Jacobian of the state transition function based on the constant turn-rate and velocity-magnitude motion model. The default time step is 1 second. By default, ctrvjac returns the Jacobian Jx with respect to the input state, state. Constant turn rate and velocity magnitude mean that motion in the xy-plane follows a constant angular velocity and motion in the vertical z directions follows a constant velocity model.

Note

ctrvjac represents velocity in the xy-plane with velocity magnitude and direction. For the constant turn-rate and velocity-magnitude motion model using Cartesian components, Vx and Vy, see constturnjac.

example

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

example

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

Examples

collapse all

Define an initial state for 3-D constant turn-rate motion. The turn-rate is 1 degree per second.

state = [1;2;2;30;1;4.7;1.8];

Compute the Jacobian assuming dt = 1 second.

dfdx = ctrvjac(state)
dfdx = 7×7

    1.0000         0    0.8616   -0.0177   -0.0089         0         0
         0    1.0000    0.5075    0.0301    0.0150         0         0
         0         0    1.0000         0         0         0         0
         0         0         0    1.0000    1.0000         0         0
         0         0         0         0    1.0000         0         0
         0         0         0         0         0    1.0000    1.0000
         0         0         0         0         0         0    1.0000

Compute the Jacobian given dt = 0.1 second.

dfdx = ctrvjac(state, 0.1)
dfdx = 7×7

    1.0000         0    0.0866   -0.0017   -0.0001         0         0
         0    1.0000    0.0501    0.0030    0.0002         0         0
         0         0    1.0000         0         0         0         0
         0         0         0    1.0000    0.1000         0         0
         0         0         0         0    1.0000         0         0
         0         0         0         0         0    1.0000    0.1000
         0         0         0         0         0         0    1.0000

Compute the Jacobian with respect to the noise terms.

[dfdx, dfdw] = ctrvjac(state, zeros(2,1), 0.1)
dfdx = 7×7

    1.0000         0    0.0866   -0.0017   -0.0001         0         0
         0    1.0000    0.0501    0.0030    0.0002         0         0
         0         0    1.0000         0         0         0         0
         0         0         0    1.0000    0.1000         0         0
         0         0         0         0    1.0000         0         0
         0         0         0         0         0    1.0000    0.1000
         0         0         0         0         0         0    1.0000

dfdw = 7×3

    0.0043         0         0
    0.0025         0         0
    0.1000         0         0
         0    0.0050         0
         0    0.1000         0
         0         0    0.0050
         0         0    0.1000

Input Arguments

collapse all

State vector for a constant turn-rate motion model in 2-D or 3-D, specified as a real-valued vector.

  • When you specify the input state as a five-element vector, the state vector describes 2-D motion in the xy-plane. You can specify the state vector as a row or column vector. The components of the state vector are [x;y;s;theta;omega], where:

    • x and y represent the x-coordinate and y-coordinate in meters.

    • s represents the velocity magnitude in meters/second.

    • theta represents the course direction in the xy-plane, counter-clockwise with respect to the x-axis, in degrees.

    • omega represents the turn-rate in degrees/second.

  • When you specify the input state as a seven-element vector, the state vector describes 3-D motion. You can specify the state vector as a row or column vector. The components of the state vector are [x;y;s;theta;omega;z;vz], where:

    • x and y represent the x-coordinate and y-coordinate in meters.

    • s represents the velocity magnitude in meters/second.

    • theta represents the course direction in the xy-plane, counter-clockwise with respect to the x-axis, in degrees.

    • omega represents the turn rate in degrees/second.

    • z represent the position in the vertical plane in meters.

    • vz represents velocity component in the vertical plane in meters/second.

Example: [0;300;15;40;0.5]

Data Types: 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 D-element vector. D is the number of motion dimensions. The vector components are [ah;ayaw] for 2-D motion or [ah;ayaw;az] for 3-D motion, where:

  • ah represents the process noise in horizontal plane acceleration, measured in meters/second2;

  • ayaw represents the process noise in yaw acceleration, measured in degrees/second2;

  • az represents the process noise in vertical plane acceleration, measured in meters/second2.

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 5-by-5 matrix or 7-by-7 matrix depending on the size of the state vector. 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 5-by-D matrix, where D is the number of motion dimensions. The function constructs the Jacobian from the partial derivatives of the state at the updated time step with respect to the noise components.

Extended Capabilities

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

Version History

Introduced in R2024b