Multiplies two transfer functions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transfer_function), | intent(in) | :: | x |
The left-hand-side argument. |
||
| class(transfer_function), | intent(in) | :: | y |
The right-hand-side argument. |
The resulting transfer function.
Multiplies a polynomial and a transfer function to result in a new transfer function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | x |
The left-hand-side argument. |
||
| class(transfer_function), | intent(in) | :: | y |
The right-hand-side argument. |
The resulting transfer function.
Multiplies a transfer function and a polynomial to result in a new transfer function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transfer_function), | intent(in) | :: | x |
The left-hand-side argument. |
||
| class(polynomial), | intent(in) | :: | y |
The right-hand-side argument. |
The resulting transfer function.
Multiplies a transfer function by a scalar value.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(transfer_function), | intent(in) | :: | x |
The left-hand-side argument. |
||
| real(kind=real64), | intent(in) | :: | y |
The right-hand-side argument. |
The resulting transfer function.
Multiplies a transfer function by a scalar value.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x |
The left-hand-side argument. |
||
| class(transfer_function), | intent(in) | :: | y |
The right-hand-side argument. |
The resulting transfer function.
A routine for computing the excitation vector for a state-space model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | t |
The time value at which to compute the excitation. |
||
| real(kind=real64), | intent(out), | dimension(:) | :: | u |
The excitation vector. |
|
| class(*), | intent(inout), | optional | :: | args |
An optional argument used to pass objects in and out of the routine. |
Initializes the state space model.
The output matrix is initialized to one, and the feedthrough matrix is initialized to zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | m |
The N-by-N mass matrix. |
|
| real(kind=real64), | intent(in), | dimension(size(m, 1), size(m, 2)) | :: | b |
The N-by-N damping matrix. |
|
| real(kind=real64), | intent(in), | dimension(size(m, 1), size(m, 2)) | :: | k |
The N-by-N stiffness matrix. |
|
| integer(kind=int32), | intent(in), | optional | :: | n_out |
The number of outputs. The default is 1. |
The [[state_space]] model.
Initializes the state space model.
The output matrix is initialized to one, and the feedthrough matrix is initialized to zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | m |
The mass. |
||
| real(kind=real64), | intent(in) | :: | b |
The damping. |
||
| real(kind=real64), | intent(in) | :: | k |
The stiffness. |
The [[state_space]] model.
Initializes the state space model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The N-by-N dynamics matrix. |
|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | b |
The N-by-M input matrix. |
|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | c |
The P-by-N output matrix. |
|
| real(kind=real64), | intent(in), | dimension(:,:) | :: | d |
The P-by-M feedthrough matrix. |
The resulting [[state_space]] object.
Initializes a state-space model that employs a closed-loop PID controller.
The PID model is augmented into the plant model as follows.
Where the augmented matrices are as follows.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | kp |
The proportional gain term. |
||
| real(kind=real64), | intent(in) | :: | ki |
The integral gain term. |
||
| real(kind=real64), | intent(in) | :: | kd |
The derivative gain term. |
||
| real(kind=real64), | intent(in) | :: | tau |
The time constant of the first order derivative filter . |
||
| real(kind=real64), | intent(in), | dimension(:,:) | :: | a |
The N-by-N dynamics matrix for the plant. |
|
| real(kind=real64), | intent(in), | dimension(size(a, 1), 1) | :: | b |
The N-by-1 input matrix for the plant. |
|
| real(kind=real64), | intent(in), | dimension(1, size(a, 1)) | :: | c |
The 1-by-N output matrix for the plant. |
|
| real(kind=real64), | intent(in), | dimension(1, 1) | :: | d |
The 1-by-1 feedthrough matrix for the plant. |
The resulting [[state_space]] object.
Initializes a state-space model that employs a closed-loop PID controller.
The PID model is augmented into the plant model as follows.
Where the augmented matrices are as follows.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | kp |
The proportional gain term. |
||
| real(kind=real64), | intent(in) | :: | ki |
The integral gain term. |
||
| real(kind=real64), | intent(in) | :: | kd |
The derivative gain term. |
||
| real(kind=real64), | intent(in) | :: | tau |
The time constant of the first order derivative filter . |
||
| class(state_space), | intent(in) | :: | plant |
The plant model. |
The resulting [[state_space]] object.
Initializes a new transfer function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:) | :: | y |
The numerator polynomial in . The polynomial coefficients are stored in acending order such that . |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
The denominator polynomial in . The polynomial coefficients are stored in acending order such that . |
The resulting [[transfer_function]].
Initializes a new transfer function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | y |
The numerator polynomial in . |
||
| class(polynomial), | intent(in) | :: | x |
The denominator polynomial in . |
The resulting [[transfer_function]].
Defines a state-space representation of a dynamic system. This implementation takes the form:
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | A |
The N-by-N dynamics matrix, where N is the number of state variables. |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | B |
The N-by-M input matrix, where M is the number of inputs. |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | C |
The P-by-N output matrix, where P is the number of outputs. |
||
| real(kind=real64), | public, | allocatable, dimension(:,:) | :: | D |
The P-by-M feedthrough matrix. |
| private pure function state_space_init (m, b, k, n_out) | Initializes the state space model. The output matrix is initialized to one, and the feedthrough matrix is initialized to zero. |
| private pure function state_space_init_scalar (m, b, k) | Initializes the state space model. The output matrix is initialized to one, and the feedthrough matrix is initialized to zero. |
| private pure function state_space_init_matrices (a, b, c, d) | Initializes the state space model. |
| private pure function state_space_init_pid (kp, ki, kd, tau, a, b, c, d) | Initializes a state-space model that employs a closed-loop PID controller. The PID model is augmented into the plant model as follows.
Where the augmented matrices are as follows.
|
| private pure function state_space_init_pid_plant (kp, ki, kd, tau, plant) | Initializes a state-space model that employs a closed-loop PID controller. The PID model is augmented into the plant model as follows.
Where the augmented matrices are as follows.
|
| procedure , public :: evaluate_derivatives => ss_eval_deriv Function | |
| procedure , public :: evaluate_output => ss_eval_output Function | |
| procedure , public :: poles => ss_poles Function | |
| generic, public :: transfer_function => ss_transfer_fcn, ss_transfer_fcn_omega, ss_transfer_fcn_array, ss_transfer_fcn_omega_array | |
| procedure , public :: zeros => ss_zeros Function |
Defines a transfer function for a continuous system of the form .
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(polynomial), | public | :: | X |
The denominator polynomial in . The polynomial coefficients are stored in acending order such that . |
|||
| type(polynomial), | public | :: | Y |
The numerator polynomial in . The polynomial coefficients are stored in acending order such that . |
| private function init_tf_array (y, x) | Initializes a new transfer function. |
| private function init_tf_poly (y, x) | Initializes a new transfer function. |
| generic, public :: evaluate => tf_eval_omega, tf_eval_s | |
| procedure , public :: poles => tf_poles Function | |
| procedure , public :: to_ccf_state_space => tf_to_ccf_statespace Function | |
| procedure , public :: to_ocf_state_space => tf_to_ocf_statespace Function | |
| procedure , public :: zeros => tf_zeros Function |
Solves the LTI system given by the specified state space model.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(state_space), | intent(in), | target | :: | mdl |
The state_space model to solve. |
|
| procedure(ss_excitation), | intent(in), | pointer | :: | u |
The routine used to compute the excitation vector. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | t |
The time points at which to compute the solution. The array must have at least 2 values; however, more may be specified. If only 2 values are specified, the integrator will compute the solution at those points, but it will also return any intermediate integration steps that may be required. However, if more than 2 points are given, the integrator will return the solution values only at the specified time points. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | ic |
The initial condition vector. This array must be the same size as the number of state variables. |
|
| class(ode_integrator), | intent(in), | optional, | target | :: | solver |
The ODE solver to utilize. If not specified, the default solver is a 4th/5th order Runge-Kutta integrator. |
| class(*), | intent(inout), | optional | :: | args |
An optional container for arguments to pass to the excitation routine. |
|
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |
The solution. The time points at which the solution was evaluated are stored in the first column and the output(s) are stored in the remaining column(s).