Skip to content

LSU‑05 NG — Longitudinal Dynamics

The LAPAN Surveillance Aircraft (LSU)‑05 NG is a UAV for observation and research. This page mirrors the ELV layout: quick start, math model, derivatives, and API.

  • Quick start

    Launch the environment or the model within minutes.

    See example

  • Model API

    Python class documentation for the LSU‑05 longitudinal dynamics.

    Go to API

  • Gymnasium environment

    Ready environment for RL agents.

    Explore

  • Theory

    State equations and numerical parameters.

    Learn more

Control object structure

\[\dot{x} = A x + B u, \quad y = C x + D u\]
\[ x = \begin{bmatrix} u & w & q & \theta \end{bmatrix}^{\top}, \quad u_{in} = \eta \]

The plant is modeled in the state space, consistent with other systems in the library. The state-space matrices are taken from the reference below. Because the system lacks internal disturbance processes, the output \(y\) is not used during simulation (\(C\) is diagonal, \(D\) is zero).

Mathematical model

\[ \dot{x} = A x + B u, \qquad y = C x + D u \]
\[ \begin{bmatrix} \dot{u} \\ \dot{w} \\ \dot{q} \\ \dot{\theta} \end{bmatrix} = \begin{bmatrix} -0.00271615 & 0.248462 & 0 & -9.81 \\ -0.257616 & -11.3097 & 68.9497 & 0\\ 0.0576336 & -7.23232 & -11.3237 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} \begin{bmatrix} u \\ w \\ q \\ \theta \end{bmatrix} + \begin{bmatrix} 1.959083 \\ -73.99448 \\ -188.4752 \\ 0.0 \end{bmatrix} \eta \]

Derivatives (numerical values)

  • Matrix A (derivatives):
Coefficient Value
x_u -0.00271615
x_w 0.248462
x_q 0
x_θ -9.81
z_u -0.257616
z_w -11.3097
z_q 68.9497
z_θ 0
m_u 0.0576336
m_w -7.23232
m_q -11.3237
m_θ 0
  • Input η (column B):
Coefficient Value
x_η 1.959083
z_η -73.99448
m_η -188.4752

where

  • \(u\) — longitudinal speed [m/s]
  • \(w\) — normal speed [m/s]
  • \(q\) — pitch rate [deg/s]
  • \(\theta\) — pitch angle [deg]
  • \(\eta\) — stabilizer deflection angle [deg]
  • \(x_u\) — partial derivative of longitudinal force with respect to longitudinal speed
  • \(x_w\) — partial derivative of longitudinal force with respect to normal speed
  • \(x_q\) — partial derivative of longitudinal force with respect to pitch rate
  • \(x_{\theta}\) — partial derivative of longitudinal force with respect to pitch angle
  • \(z_u\) — partial derivative of vertical force with respect to longitudinal speed
  • \(z_w\) — partial derivative of vertical force with respect to normal speed
  • \(z_q\) — partial derivative of vertical force with respect to pitch rate
  • \(z_{\theta}\) — partial derivative of vertical force with respect to pitch angle
  • \(m_u\) — partial derivative of pitch moment with respect to longitudinal speed
  • \(m_w\) — partial derivative of pitch moment with respect to normal speed
  • \(m_q\) — partial derivative of pitch moment with respect to pitch rate
  • \(m_{\theta}\) — partial derivative of pitch moment with respect to pitch angle

Sources

    1. Lembaga, D.O., Antariksa, P.D., Septiyana, A., Hidayat, K., Rizaldi, A., Suseno, P.A., Jayanti, E.B., Atmasari, N., Ramadiansyah, M.L., Ramadhan, R.A., Suryo, V.N., Grüter, B., Diepolder, J., Holzapfel, F., Wijaya, Y.G., Dewan, S., Jurnal, P., Dirgantara, T., Wibowo, H., Panas, P., Septanto, H., Harno, A., Syah, N.A., Angkasa, R., Satelit, M.D., Irwanto, H.Y., Avionik, M.E., Hakim, A.N., Utama, A.B., Wahyudi, A.H., Kurniawati, F., Putro, I.E., & Astuti, R.A. STABILITY AND CONTROLLABILITY ANALYSIS ON LINEARIZED DYNAMIC SYSTEM EQUATION OF MOTION OF LSU 05-NG USING KALMAN RANK CONDITION METHOD. - Jurnal Teknologi Dirgantara Vol. 18 No. 2 Desember 2020 : hal 81 – 92 – 2020

Reward

The default reward function returns the negative absolute tracking error for the pitch angle:

\[r_t = -|\theta(t) - \theta_{\text{ref}}(t)|\]

Higher reward (closer to 0) indicates better tracking performance. A custom reward function can be passed via the reward_func parameter.

Quick start

```python

import gymnasium as gym import numpy as np from tqdm import tqdm

from tensoraerospace.envs import LinearLongitudinalLAPAN from tensoraerospace.utils import generate_time_period, convert_tp_to_sec_tp from tensoraerospace.signals.standard import unit_step

dt = 0.01 tp = generate_time_period(tn=20, dt=dt) tps = convert_tp_to_sec_tp(tp, dt=dt) number_time_steps = len(tp) reference_signals = np.reshape(unit_step(degree=5, tp=tp, time_step=10, output_rad=True), [1, -1])

env = gym.make( 'LinearLongitudinalLAPAN-v0', number_time_steps=number_time_steps, initial_state=[[0],[0],[0],[0]], reference_signal=reference_signals, ) state, info = env.reset() for _ in range(200): action = np.array([[0.1]]) state, reward, terminated, truncated, info = env.step(action) if terminated or truncated: break

Python API

LAPAN(x0, number_time_steps, selected_state_output=None, t0=0, dt=0.01)

Bases: ModelBase

LAPAN Surveillance Aircraft (LSU)-05 NG in longitudinal control channel.

Parameters:

Name Type Description Default
x0 ndarray | list[float]

Initial state of the control object.

required
number_time_steps int

Number of time steps.

required
selected_state_output optional

Selected states of the control object. Defaults to None.

None
t0 int

Initial time. Defaults to 0.

0
dt float

Discretization frequency. Defaults to 0.01.

0.01
Action space

ele: elevator [rad]

State space

u: Longitudinal aircraft velocity [m/s] w: Normal aircraft velocity [m/s] q: Pitch angular velocity [rad/s] theta: Pitch [rad]

Output space

u: Longitudinal aircraft velocity [m/s] w: Normal aircraft velocity [m/s] q: Pitch angular velocity [rad/s] theta: Pitch [rad]

Initialize LAPAN instance.

Parameters:

Name Type Description Default
x0 ndarray | list[float]

Initial state of the control object.

required
number_time_steps int

Number of time steps.

required
selected_state_output list[str] | None

Selected states of the control object. Defaults to None.

None
t0 float

Initial time. Defaults to 0.

0
dt float

Discretization frequency. Defaults to 0.01.

0.01

import_linear_system()

Load (set) stored linearized system matrices.

initialise_system(x0, number_time_steps)

Initialize the system and allocate history buffers.

Parameters:

Name Type Description Default
x0 ndarray | list[float]

Initial state.

required
number_time_steps int

Number of simulation steps.

required

run_step(ut_0)

Run one discrete-time simulation step.

Parameters:

Name Type Description Default
ut_0 ndarray

Control vector.

required

Returns:

Type Description
ndarray

np.ndarray: Next state at time t+1.

update_system_attributes()

Update time-dependent attributes after each simulation step.

get_state(state_name, to_deg=False, to_rad=False)

Return the time history of a state.

Parameters:

Name Type Description Default
state_name str

State name.

required
to_deg bool

Convert radians to degrees.

False
to_rad bool

Convert degrees to radians.

False

Returns:

Type Description
ndarray

np.ndarray: State history array.

get_control(control_name, to_deg=False, to_rad=False)

Return the time history of a control input.

Parameters:

Name Type Description Default
control_name str

Control signal name.

required
to_deg bool

Convert radians to degrees.

False
to_rad bool

Convert degrees to radians.

False

Returns:

Type Description
ndarray

np.ndarray: Control history array.

get_output(state_name, to_deg=False, to_rad=False)

Return the time history of an output signal.

Parameters:

Name Type Description Default
state_name str

Output name.

required
to_deg bool

Convert radians to degrees.

False
to_rad bool

Convert degrees to radians.

False

Returns:

Type Description
ndarray

np.ndarray: Output history array.

plot_output(output_name, time, lang='rus', to_deg=False, to_rad=False, figsize=(10, 10))

Plot an output signal over time.

Parameters:

Name Type Description Default
output_name str

Output name.

required
time ndarray

Time vector.

required
lang str

Axis label language ('rus' or 'eng').

'rus'
to_deg bool

Convert radians to degrees.

False
to_rad bool

Convert degrees to radians.

False
figsize tuple

Figure size.

(10, 10)

Returns:

Type Description
Figure

matplotlib.figure.Figure: Figure object.

LinearLongitudinalLAPAN(initial_state, reference_signal, number_time_steps, tracking_states=None, state_space=None, control_space=None, output_space=None, reward_func=None)

Bases: Env

Legacy LAPAN longitudinal-control environment.

Parameters:

Name Type Description Default
initial_state ndarray

Initial state vector.

required
reference_signal ndarray

Reference (target) signal array.

required
number_time_steps int

Number of simulation steps.

required
tracking_states list[str] | None

Names of tracked states used for reward computation.

None
state_space list[str] | None

Names of state variables exposed in observations.

None
control_space list[str] | None

Names of control inputs.

None
output_space list[str] | None

Names of model outputs returned by the plant.

None
reward_func Callable[[ndarray, ndarray, int], float] | None

Optional custom reward function.

None

Initialize legacy LAPAN longitudinal environment.

reward(state, ref_signal, ts) staticmethod

Compute tracking reward for the current step.

Parameters:

Name Type Description Default
state ndarray

Current tracked state vector.

required
ref_signal ndarray

Reference signal array.

required
ts int

Current time step index.

required

Returns:

Name Type Description
float float

Reward value (lower is better in the legacy formulation).

step(action)

Run one simulation step.

Parameters:

Name Type Description Default
action ndarray

Control input(s).

required

Returns:

Name Type Description
tuple ndarray

(observation, reward, terminated, truncated, info) in the

float

Gymnasium API format.

reset(seed=None, options=None)

Reset environment state to the initial conditions.

Parameters:

Name Type Description Default
seed int | None

Random seed (Gymnasium).

None
options dict | None

Optional reset options (unused).

None

Returns:

Name Type Description
tuple tuple[ndarray, dict[str, float]]

(observation, info).

render()

Render the environment (not implemented).

Raises:

Type Description
NotImplementedError

Rendering is not available.