dynamics_controls Module


Uses


Contents


Interfaces

public interface operator(*)

  • private function tf_tf_mult(x, y) result(rst)

    Multiplies two transfer functions.

    Arguments

    Type IntentOptional Attributes Name
    class(transfer_function), intent(in) :: x

    The left-hand-side argument.

    class(transfer_function), intent(in) :: y

    The right-hand-side argument.

    Return Value type(transfer_function)

    The resulting transfer function.

  • private function poly_tf_mult(x, y) result(rst)

    Multiplies a polynomial and a transfer function to result in a new transfer function.

    Arguments

    Type IntentOptional Attributes Name
    class(polynomial), intent(in) :: x

    The left-hand-side argument.

    class(transfer_function), intent(in) :: y

    The right-hand-side argument.

    Return Value type(transfer_function)

    The resulting transfer function.

  • private function tf_poly_mult(x, y) result(rst)

    Multiplies a transfer function and a polynomial to result in a new transfer function.

    Arguments

    Type IntentOptional Attributes Name
    class(transfer_function), intent(in) :: x

    The left-hand-side argument.

    class(polynomial), intent(in) :: y

    The right-hand-side argument.

    Return Value type(transfer_function)

    The resulting transfer function.

  • private function tf_scalar_mult(x, y) result(rst)

    Multiplies a transfer function by a scalar value.

    Arguments

    Type IntentOptional Attributes Name
    class(transfer_function), intent(in) :: x

    The left-hand-side argument.

    real(kind=real64), intent(in) :: y

    The right-hand-side argument.

    Return Value type(transfer_function)

    The resulting transfer function.

  • private function scalar_tf_mult(x, y) result(rst)

    Multiplies a transfer function by a scalar value.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in) :: x

    The left-hand-side argument.

    class(transfer_function), intent(in) :: y

    The right-hand-side argument.

    Return Value type(transfer_function)

    The resulting transfer function.

interface

  • public subroutine ss_excitation(t, u, args)

    A routine for computing the excitation vector for a state-space model.

    Arguments

    Type IntentOptional 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.


Derived Types

type, public ::  state_space

Defines a state-space representation of a dynamic system. This implementation takes the form:

Read more…

Components

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.

type, public ::  transfer_function

Defines a transfer function for a continuous system of the form .

Components

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 .

Type-Bound Procedures

generic, public :: evaluate => tf_eval_omega, tf_eval_s
generic, public :: initialize => tf_init_poly, tf_init_array
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

Functions

public function lti_solve(mdl, u, t, ic, solver, args, err) result(rst)

Solves the LTI system given by the specified state space model.

Arguments

Type IntentOptional Attributes Name
class(state_space), intent(in) :: 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.

Return Value real(kind=real64), allocatable, dimension(:,:)

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).