TwoStageOptimalControl.ObjectValueFunction
ObjectValue( Con::Array{Float64,3}, 
             Stat::Array{Float64,3}, 
             Con_dist::Array{Float64,3}, 
             Stat_dist::Array{Float64,3},  
             Stat_agg::Array{Float64,3}, 
             Para::Dict )

Calculate the aggregated objective value of the optimal control problem for the current solutions of control and state variables

source
TwoStageOptimalControl.AggregateFunction
Aggregate(Con_dist::Array{Float64,3},
          Stat_dist::Array{Float64,3},
          Stat_agg::Array{Float64,3},
          Para::Dict )

Calculate the aggregated variables over all vintage in the second stage

source
TwoStageOptimalControl.ShockTransitionFunction
ShockTransition(Con::Array{Float64,3},
                Stat::Array{Float64,3},
                Stat_dist::Array{Float64,3},
                Para::Dict )

Calculate the starting values for all vintages given the state profiles of the first stage.

source
TwoStageOptimalControl.f_ODEFunction
f_ODE( tt::Int64, 
       Con::Array{Float64,3}, 
       Stat::Array{Float64,3}, 
       Dt::Array{Float64,1}, 
       Para::Dict )

Right hand side of the ODE for the state variables in the first stage at time index tt.

source
TwoStageOptimalControl.f_ODE_interstepFunction
f_ODE_interstep( t::Float64, Con, Stat, Para::Dict)

Right hand side of the ODE for the state variables in the first stage. Only used for the 4th order RK-method where the Control variables have to be interpolated.

source
TwoStageOptimalControl.f_PDEFunction
f_PDE( tt::Int64, ss::Int64, 
       Con_dist::Array{Float64,3}, 
       Stat_dist::Array{Float64,3}, 
       Dt::Array{Float64,1},
       Para::Dict )

Right hand side of the PDE for the state variables in the second stage at time index tt and vintage ss.

source
TwoStageOptimalControl.f_ODE_coFunction
f_ODE_co( tt::Int64,
          Con::Array{Float64,3},
          Stat::Array{Float64,3},
          CoStat::Array{Float64,3},
          CoStat_dist::Array{Float64,3},
          Dt::Array{Float64,1},
          Para::Dict )

Right hand side of the PDE for the costate variables in the first stage at time index tt.

source
TwoStageOptimalControl.f_PDE_coFunction
f_PDE_co( tt::Int64, ss::Int64,
          Con_dist::Array{Float64,3},
          Stat_dist::Array{Float64,3},
          CoStat_dist::Array{Float64,3},
          Dt::Array{Float64,1},
          Para::Dict )

Right hand side of the PDE for the costate variables in the second stage at time index tt and vintage ss.

source
TwoStageOptimalControl.HamiltonianFunction
Hamiltonian(Con, Stat, CoStat, CoStat_dist, 
            t::Float64, Para::Dict )

Definition of the Hamiltonian with all terms relevant for the calculations including first stage variables.

source
TwoStageOptimalControl.Hamiltonian_distFunction
Hamiltonian_dist(Con_dist, 
                 Stat_dist, 
                 CoStat_dist, 
                 t::Float64, 
                 s::Float64, 
                 Para::Dict )

Definition of the Hamiltonian with all terms relevant for the calculations including second stage variables.

source
TwoStageOptimalControl.GradHamiltonianFunction
GradHamiltonian(Con::Array{Float64,3},
                Stat::Array{Float64,3},
                Con_dist::Array{Float64,3},
                Stat_dist::Array{Float64,3},
                Stat_agg::Array{Float64,3},
                CoStat::Array{Float64,3},
                CoStat_dist::Array{Float64,3},
                dHam::Array{Float64,3},
                dHam_dist::Array{Float64,3},
                Para::Dict)

Calculation of the gradient of the Hamiltonian for both stages.

source
TwoStageOptimalControl.NewDirectionFunction
NewDirection(Con::Array{Float64,3},
             Stat::Array{Float64,3},
             Con_dist::Array{Float64,3},
             Stat_dist::Array{Float64,3},
             Stat_agg::Array{Float64,3},
             CoStat::Array{Float64,3},
             CoStat_dist::Array{Float64,3},
             dHam::Array{Float64,3},
             dHam_dist::Array{Float64,3},
             Para::Dict)

Adjustment of the gradient of the Hamiltonian depending on the optimisation type chosen. Available types are:

  • "Gradient" -> Uses the gradient without adjustments
  • "ProbAdjust" -> Adjusts the gradient for the weighting of the vintage in the second stage and the survival probability in the first stage
  • "Newton-Raphson" -> Adjusts the gradient as described in the Newton-Raphson method using the Hessian of the Hamiltonian
source
TwoStageOptimalControl.ConMappingFunction
ConMapping( Con::Array{Float64,3}, Para )

Map control variables in the first stage into the feasible region described by the lower and upper bounds of the controls.

source
TwoStageOptimalControl.ConMapping_distFunction
ConMapping_dist( Con_dist::Array{Float64,3}, ii, Para )

Map control variables in the second stage into the feasible region described by the lower and upper bounds of the controls.

source
TwoStageOptimalControl.EndConstraintCoStatFunction
EndConstraintCoStat(Stat::Array{Float64,3}, CoStat::Array{Float64,3}, Para::Dict)

Define the endconstraint for the first stage costate variables using the derivative of the salvage-function.

source
TwoStageOptimalControl.EndConstraintCoStat_distFunction
EndConstraintCoStat_dist(Stat_dist::Array{Float64,3}, CoStat_dist::Array{Float64,3}, Para::Dict)

Define the endconstraint for the second stage costate variables using the derivative of the salvage-function.

source