Print

Index

Simple example

using CTModels, Plots
import CTParser: @def

t0, tf, x0 = 0.0, 1.0, -1.0

ocp = @def begin
    t ∈ [t0, tf], time
    x ∈ R, state
    u ∈ R, control
    x(t0) == x0
    -Inf ≤ x(t) + u(t) ≤ 0, (mixed_con)
    ẋ(t) == u(t)
    ∫(0.5u(t)^2) → min
end
Abstract definition:

    t ∈ [t0, tf], time
    x ∈ R, state
    u ∈ R, control
    x(t0) == x0
    -Inf ≤ x(t) + u(t) ≤ 0, mixed_con
    ẋ(t) == u(t)
    ∫(0.5 * u(t) ^ 2) → min

The (autonomous) optimal control problem is of the form:

    minimize  J(x, u) = ∫ f⁰(x(t), u(t)) dt, over [0.0, 1.0]

    subject to

        ẋ(t) = f(x(t), u(t)), t in [0.0, 1.0] a.e.,

        ψ₋ ≤ ψ(x(t), u(t)) ≤ ψ₊, 
        ϕ₋ ≤ ϕ(x(0.0), x(1.0)) ≤ ϕ₊, 

    where x(t) ∈ R and u(t) ∈ R.

Documentation

Base.showMethod
show(
    io::IO,
    _::MIME{Symbol("text/plain")},
    ocp::CTModels.Model
)

Print the optimal control problem.

Base.showMethod
show(
    io::IO,
    _::MIME{Symbol("text/plain")},
    ocp::CTModels.PreModel
)

Print the optimal control problem.