|
DYNAMICS C API
C-compatible interface to the DYNAMICS library
|
Functions | |
| int | c_alloc_polynomial (int order, c_polynomial *p) |
| Allocate a polynomial. | |
| void | c_free_polynomial (c_polynomial *p) |
| Release a polynomial. | |
| int | c_alloc_transfer_function (int numer_order, int denom_order, c_transfer_function *tf) |
| Allocate a transfer function. | |
| void | c_free_transfer_function (c_transfer_function *tf) |
| Release a transfer function. | |
| int | c_alloc_state_space_model (int dimension, int n_inputs, int n_outputs, c_state_space_model *mdl) |
| Allocate a continuous state-space model. | |
| void | c_free_state_space_model (c_state_space_model *mdl) |
| Release a state-space model. | |
| void | c_evaluate_transfer_function (const c_transfer_function *tf, int n, const double complex *s, double complex *z) |
| Evaluate a transfer function at complex points. | |
| void | c_transfer_function_poles (const c_transfer_function *tf, int n, double complex *p) |
| Compute transfer-function poles. | |
| void | c_transfer_function_zeros (const c_transfer_function *tf, int n, double complex *z) |
| Compute transfer-function zeros. | |
| void | c_to_ccf_state_space (const c_transfer_function *tf, c_state_space_model *ss) |
| Convert a transfer function to controllable canonical state space. | |
| void | c_to_ocf_state_space (const c_transfer_function *tf, c_state_space_model *ss) |
| Convert a transfer function to observable canonical state space. | |
| void | c_create_state_space_model (int n, int n_out, const double *m, int ldm, const double *b, int ldb, const double *k, int ldk, c_state_space_model *mdl) |
| Create a state-space model from mass, damping, and stiffness matrices. | |
| void | c_create_pid_state_space_model (double kp, double ki, double kd, double tau, const c_state_space_model *plant, c_state_space_model *mdl) |
| Create a PID-controlled plant state-space model. | |
| void | c_transfer_function_multiply (const c_transfer_function *tf1, const c_transfer_function *tf2, c_transfer_function *tf) |
| Multiply two transfer functions. | |
| void | c_scale_transfer_function (double x, const c_transfer_function *tf1, c_transfer_function *tf) |
| Scale a transfer function. | |
| void | c_lti_solve (const c_state_space_model *mdl, const c_ss_excitation u, int n, const double *t, int ndof, const double *ic, int solver, int nout, double *y, int ldy, void *user_data) |
| Integrate a continuous state-space model. | |
| void | c_state_space_poles (const c_state_space_model *mdl, int n, double complex *p) |
| Compute state-space poles. | |
| void | c_state_space_zeros (const c_state_space_model *mdl, int n, double complex *z, int *nz) |
| Compute state-space zeros. | |
| void | c_state_space_transfer_function (const c_state_space_model *mdl, int nin, int nout, int n, const double complex *s, double complex *z, int ldz) |
| Evaluate the state-space transfer matrix. | |
| int c_alloc_polynomial | ( | int | order, |
| c_polynomial * | p | ||
| ) |
Allocate a polynomial.
| order | Polynomial order. |
| p | Polynomial initialized by the routine. |
| void c_free_polynomial | ( | c_polynomial * | p | ) |
Release a polynomial.
| p | Polynomial to release. |
| int c_alloc_transfer_function | ( | int | numer_order, |
| int | denom_order, | ||
| c_transfer_function * | tf | ||
| ) |
Allocate a transfer function.
| numer_order | Numerator order. |
| denom_order | Denominator order. |
| tf | Transfer function initialized by the routine. |
| void c_free_transfer_function | ( | c_transfer_function * | tf | ) |
Release a transfer function.
| tf | Transfer function to release. |
| int c_alloc_state_space_model | ( | int | dimension, |
| int | n_inputs, | ||
| int | n_outputs, | ||
| c_state_space_model * | mdl | ||
| ) |
Allocate a continuous state-space model.
| dimension | State dimension. |
| n_inputs | Input count. |
| n_outputs | Output count. |
| mdl | Model initialized by the routine. |
| void c_free_state_space_model | ( | c_state_space_model * | mdl | ) |
Release a state-space model.
| mdl | Model to release. |
| void c_evaluate_transfer_function | ( | const c_transfer_function * | tf, |
| int | n, | ||
| const double complex * | s, | ||
| double complex * | z | ||
| ) |
Evaluate a transfer function at complex points.
| tf | Transfer function. |
| n | Evaluation count. |
| s | Complex evaluation points. |
| z | Output complex values. |
| void c_transfer_function_poles | ( | const c_transfer_function * | tf, |
| int | n, | ||
| double complex * | p | ||
| ) |
Compute transfer-function poles.
| tf | Transfer function. |
| n | Pole count. |
| p | Output poles. |
| void c_transfer_function_zeros | ( | const c_transfer_function * | tf, |
| int | n, | ||
| double complex * | z | ||
| ) |
Compute transfer-function zeros.
| tf | Transfer function. |
| n | Zero count. |
| z | Output zeros. |
| void c_to_ccf_state_space | ( | const c_transfer_function * | tf, |
| c_state_space_model * | ss | ||
| ) |
Convert a transfer function to controllable canonical state space.
| tf | Transfer function. |
| ss | Output state-space model. |
| void c_to_ocf_state_space | ( | const c_transfer_function * | tf, |
| c_state_space_model * | ss | ||
| ) |
Convert a transfer function to observable canonical state space.
| tf | Transfer function. |
| ss | Output state-space model. |
| void c_create_state_space_model | ( | int | n, |
| int | n_out, | ||
| const double * | m, | ||
| int | ldm, | ||
| const double * | b, | ||
| int | ldb, | ||
| const double * | k, | ||
| int | ldk, | ||
| c_state_space_model * | mdl | ||
| ) |
Create a state-space model from mass, damping, and stiffness matrices.
| n | State dimension. |
| n_out | Output count. |
| m | Mass matrix. |
| ldm | Leading dimension of m. |
| b | Damping matrix. |
| ldb | Leading dimension of b. |
| k | Stiffness matrix. |
| ldk | Leading dimension of k. |
| mdl | Output model. |
| void c_create_pid_state_space_model | ( | double | kp, |
| double | ki, | ||
| double | kd, | ||
| double | tau, | ||
| const c_state_space_model * | plant, | ||
| c_state_space_model * | mdl | ||
| ) |
Create a PID-controlled plant state-space model.
| kp | Proportional gain. |
| ki | Integral gain. |
| kd | Derivative gain. |
| tau | Derivative filter time constant. |
| plant | Plant model. |
| mdl | Output model. |
| void c_transfer_function_multiply | ( | const c_transfer_function * | tf1, |
| const c_transfer_function * | tf2, | ||
| c_transfer_function * | tf | ||
| ) |
Multiply two transfer functions.
| tf1 | First transfer function. |
| tf2 | Second transfer function. |
| tf | Output product. |
| void c_scale_transfer_function | ( | double | x, |
| const c_transfer_function * | tf1, | ||
| c_transfer_function * | tf | ||
| ) |
Scale a transfer function.
| x | Scale factor. |
| tf1 | Input transfer function. |
| tf | Output scaled transfer function. |
| void c_lti_solve | ( | const c_state_space_model * | mdl, |
| const c_ss_excitation | u, | ||
| int | n, | ||
| const double * | t, | ||
| int | ndof, | ||
| const double * | ic, | ||
| int | solver, | ||
| int | nout, | ||
| double * | y, | ||
| int | ldy, | ||
| void * | user_data | ||
| ) |
Integrate a continuous state-space model.
| mdl | State-space model. |
| u | Input callback. |
| n | Time-sample count. |
| t | Time samples. |
| ndof | Input degrees of freedom. |
| ic | Initial state. |
| solver | Integration method. |
| nout | Output count. |
| y | Output samples. |
| ldy | Leading dimension of y. |
| user_data | Opaque caller data forwarded to u. |
| void c_state_space_poles | ( | const c_state_space_model * | mdl, |
| int | n, | ||
| double complex * | p | ||
| ) |
Compute state-space poles.
| mdl | State-space model. |
| n | Pole count. |
| p | Output poles. |
| void c_state_space_zeros | ( | const c_state_space_model * | mdl, |
| int | n, | ||
| double complex * | z, | ||
| int * | nz | ||
| ) |
Compute state-space zeros.
| mdl | State-space model. |
| n | Zero count. |
| z | Output zeros. |
| nz | Output number of zeros. |
| void c_state_space_transfer_function | ( | const c_state_space_model * | mdl, |
| int | nin, | ||
| int | nout, | ||
| int | n, | ||
| const double complex * | s, | ||
| double complex * | z, | ||
| int | ldz | ||
| ) |
Evaluate the state-space transfer matrix.
| mdl | State-space model. |
| nin | Input count. |
| nout | Output count. |
| n | Evaluation count. |
| s | Complex evaluation points. |
| z | Output transfer values. |
| ldz | Leading dimension of z. |