Reference

OptimalTrainControl.EETCProblemType
prob = EETCProblem(; T, train, track, <keyword arguments>)

Formulate an energy-efficient train control problem.

Arguments

  • T::Real: total time of the trip.
  • train::Train: train specification for the problem.
  • track::Track: track specification for the problem.
  • current_phase::Mode = MaxP: (mainly for internal purposes) starting control mode.
  • initial_speed::Real = 1.: starting speed; $1$ m/s is regarded as a stop.
  • Es::Vector{Real} = []: (internal) vector of shifting constants used for calculation of the adjoint variable trajectory.
source
OptimalTrainControl.ModeType

An Enum useful for specifying the five possible control modes:

  • MaxP: Maximum power; usually takes place at the start.
  • HoldP: Cruising; holding constant speed with positive input.
  • HoldR: Regenerative braking; holding constant speed with negative input, can only take place on steep downhill segments.
  • Coast: Coasting; neither applying power or braking.
  • MaxB: Maximum braking; usually takes place at the end.
source
OptimalTrainControl.OTCSolutionType
sol1::OTCSolution = solve(p1::TOTCProblem)
sol2::OTCSolution = solve(p2::EETCProblem)

Is returned as a result of solving a TOTCProblem or a EETCProblem.

Fields

  • odesol::SciMLBase.ODESolution: solution of the differential equation coming from DifferentialEquations.jl package. The states are [time, speed] and are accessed with e.g. sol1.u. The distances along the track are accessed via e.g. sol1.t. The interpolation functionality should behave as expected although this is not guaranteed since the problem has multiple phases.
  • x_phases::Vector{Real}: sequence of positions at which control modes (see Mode) changes.
  • phases::Vector{Mode}: sequence of control modes (see Mode).
  • control::Function: optimal control as a function of distance along the track.
  • η::Vector{Real}: trajectory of the adjoint variable determining the current control mode (see Mode).

See also TOTCProblem, EETCProblem, Mode.

source
OptimalTrainControl.TOTCProblemType
prob = TOTCProblem(;train::Train, track::Track, <keyword arguments>)

Formulate a time-optimal train control problem to be solved.

Arguments

  • train::Train: vehicle specification for the problem.
  • track::Track: track specification for the problem
  • current_phase::Mode = MaxP: (mainly for internal purposes) starting control mode.
  • initial_speed::Real = 1.: starting speed; $1 \mathrm{m/s}$ is regarded as a stop.
source
OptimalTrainControl.TrackType
track = Track(;length <keyword arguments>)

Defines a track to be used in TOTCProblem or EETCProblem construction

Arguments

  • altitude::Real: altitude of the start of the track.
  • x_gradient::Vector{Real}: vector of positions at which the gradient changes.
  • gradient::Vector{Real}: vector of grade values in rise/run, positive means uphill.
  • x_speedlimit::Vector{Real}: vector of positions at which the speed limit changes.
  • speedlimit::Vector{Real}: vector of speed limit values in $\mathrm{m/s}$.

Examples

# Flat track
flat_track = Track(length = 1e3)
# Hilly track
hilly_track = Track(
    length = 3e3,
    altitude = 100.,
    x_gradient = [0.0, 1e3, 1.7e3],
    gradient = [2e-3, 0., 1e-3]
)

See also TOTCProblem, EETCProblem.

source
OptimalTrainControl.TrainType
train = Train(U̅, U̲, r, ρ = 0)

Defines a train to be used in TOTCProblem or EETCProblem construction

Arguments

  • U̅::Function: maximum traction specific force (per unit mass, i.e. acceleration) as a function of speed.
  • U̲::Function: minimum traction specific force (braking, per unit mass, i.e. acceleration) as a function of speed.
  • r::Tuple: triplet of coefficients defining resistance of the train as a quadratic function of the speed resistance(v) = r[1] + r[2]v + r[3]v^2.
  • ρ::Real = 0: regeneration coefficient $ρ ∈ [0,1]$ specifying proportion of braking speed recovered (0 means no regeneration, 1 means all braking energy regenerated).

Example

train = Train(
    U̅ = v ->  1/v,
    U̲ = v -> -1/v,
    r = (1e-2, 0., 1.5e-5),
    ρ = 0.3
)

See also TOTCProblem, EETCProblem.

source
OptimalTrainControl.gMethod
g(track::Track, position::Real)

Return gravitational acceleration component at position regarding the gradient of track.

source
OptimalTrainControl.gradientMethod
gradient(track::Track, position::Real)

Return gradient (in rise over run) at position on track. For example, a gradient of a segment which rises 10 metres over 100 metres of distance has gradient of 0.1.

source
OptimalTrainControl.load_ttobench_trackMethod
load_ttobench_track(filename; which_stops = (1, 2))

Load a track from a file in the TTOBench format.

Arguments

  • filename::AbstractString: path to the file containing the track.
  • which_stops::Tuple{Int, Int} = (1, 2): tuple of indices of the stops to consider (only journey between two stops is currently possible).
source
OptimalTrainControl.rMethod
r(train::Train, speed:Real)

Return resistance specific force of train at given speed.

The resistance specific force (per unit mass, i.e. acceleration) is positive and calculated as train.r[1] + train.r[2] * v + train.r[3] * v^2.

source
OptimalTrainControl.segmentize!Method
segmentize!(track::Track)

Modify track.x_segments such that its elements mark starts of track parts on which both gradient and speed limit are constant.

source