# constvelmscjac

Jacobian of constant velocity (CV) motion model in MSC frame

## Syntax

``[jacobianState,jacobianNoise] = constvelmscjac(state,vNoise)``
``[jacobianState,jacobianNoise] = constvelmscjac(state,vNoise,dt)``
``[jacobianState,jacobianNoise] = constvelmscjac(state,vNoise,dt,u)``

## Description

````[jacobianState,jacobianNoise] = constvelmscjac(state,vNoise)` calculates the Jacobian matrix of the motion model with respect to the state vector and the noise. The input `state` defines the current state, and `vNoise` defines the target acceleration noise in the observer's Cartesian frame. The function assumes a time interval, `dt`, of one second, and zero observer acceleration in all dimensions.The `trackingEKF` object allows you to specify the `StateTransitionJacobianFcn` property. The function can be used as a `StateTransitionJacobianFcn` when the `HasAdditiveProcessNoise` is set to `false`.```
````[jacobianState,jacobianNoise] = constvelmscjac(state,vNoise,dt)` specifies the time interval, `dt`. The function assumes zero observer acceleration in all dimensions.```

example

````[jacobianState,jacobianNoise] = constvelmscjac(state,vNoise,dt,u)` specifies the observer input, `u`, during the time interval, `dt`.```

## Examples

collapse all

Define a state vector for 2-D MSC.

`state = [0.5;0.01;0.001;0.01];`

Calculate the Jacobian matrix assuming dt = 1 second, no observer maneuver, and zero target acceleration noise.

`[jacobianState,jacobianNoise] = constvelmscjac(state,zeros(2,1)) %#ok`
```jacobianState = 4×4 1.0000 0.9900 -0.0000 -0.0098 -0.0000 0.9800 0 -0.0194 0.0000 -0.0000 0.9901 -0.0010 -0.0000 0.0194 -0.0000 0.9800 ```
```jacobianNoise = 4×2 10-3 × -0.2416 0.4321 -0.4851 0.8574 -0.0004 -0.0002 0.8574 0.4851 ```

Calculate the Jacobian matrix, given dt = 0.1 seconds, no observer maneuver, and a unit standard deviation target acceleration noise.

`[jacobianState,jacobianNoise] = constvelmscjac(state,randn(2,1),0.1) %#ok`
```jacobianState = 4×4 1.0000 0.0999 0.0067 -0.0001 -0.0001 0.9980 0.1348 -0.0020 -0.0000 -0.0000 0.9990 -0.0001 0.0001 0.0020 0.1351 0.9980 ```
```jacobianNoise = 4×2 10-4 × -0.0240 0.0438 -0.4800 0.8755 -0.0000 -0.0000 0.8755 0.4800 ```

Calculate the Jacobian matrix, given dt = 0.1 seconds and observer acceleration = [0.1 0.3] in the 2-D observer's Cartesian coordinates.

`[jacobianState,jacobianNoise] = constvelmscjac(state,randn(2,1),0.1,[0.1;0.3])`
```jacobianState = 4×4 1.0000 0.0999 0.0081 -0.0001 0.0002 0.9980 0.1625 -0.0020 -0.0000 -0.0000 0.9990 -0.0001 0.0002 0.0020 -0.1795 0.9980 ```
```jacobianNoise = 4×2 10-4 × -0.0240 0.0438 -0.4800 0.8756 -0.0000 -0.0000 0.8756 0.4800 ```

## Input Arguments

collapse all

State that is defined relative to an observer in modified spherical coordinates, specified as a vector. For example, if there is a constant velocity target state, xT, and a constant velocity observer state, xO, then the `state` is defined as xT - xO transformed in modified spherical coordinates.

The two-dimensional version of modified spherical coordinates (MSC) is also referred to as the modified polar coordinates (MPC).

In case the motion is in:

• 2-D space –– State is equal to [az azRate 1/r vr/r]

• 3-D space –– State is equal to [az omega el elRate 1/r vr/r]

The variables used in the convention are:

• az –– Azimuth angle (rad)

• el –– Elevation angle (rad)

• azRate –– Azimuth rate (rad/s)

• elRate –– Elevation rate (rad/s)

• omega –– azRate × cos(el) (rad/s)

• 1/r –– 1/range (1/m)

• vr/r –– range-rate/range or inverse time-to-go (1/s)

Data Types: `single` | `double`

Target acceleration noise in scenario, specified as a vector of 2 or 3 elements.

Data Types: `double`

Time difference between the current state and the time at which the state is to be calculated, specified as a real finite numeric scalar.

Data Types: `single` | `double`

Observer input, specified as a vector or a matrix. The observer input can have the following impact on state-prediction based on its dimensions:

• When the number of elements in `u` equals the number of elements in `state`, the input `u` is assumed to be the maneuver performed by the observer during the time interval, `dt`. A maneuver is defined as motion of the observer higher than first order (or constant velocity).

• When the number of elements in `u` equals half the number of elements in `state`, the input `u` is assumed to be constant acceleration of the observer, specified in the scenario frame during the time interval, `dt`.

Data Types: `double`

## Output Arguments

collapse all

Jacobian of the predicted state with respect to the previous state, returned as an n-by-n matrix, where n is the number of states in the state vector.

Data Types: `double`

Jacobian of the predicted state with respect to the noise elements, returned as an n-by-m matrix. The variable n is the number of states in the state vector, and the variable m is the number of process noise terms. That is, m = 2 for state in 2-D space, and m = 3 for state in 3-D space.

For example, if the state vector is a 4-by-1 vector in a 2-D space, `vNoise` must be a 2-by-1 vector, and `jacobianNoise` is a 4-by-2 matrix.

If the state vector is a 6-by-1 vector in 3-D space, `vNoise` must be a 3-by-1 vector, and `jacobianNoise` is a 6-by-3 matrix.

Data Types: `double`

## Version History

Introduced in R2018b