Infinite horizon trivial

This tutorial was generated using Literate.jl. Download the source as a .jl file. Download the source as a .ipynb file.

using SDDP, HiGHS, Testfunction infinite_trivial()    graph = SDDP.Graph(        :root_node,        [:week],        [(:root_node => :week, 1.0), (:week => :week, 0.9)],    )    model = SDDP.PolicyGraph(        graph;        lower_bound = 0.0,        optimizer = HiGHS.Optimizer,    ) do subproblem, node        @variable(subproblem, state, SDDP.State, initial_value = 0)        @constraint(subproblem, state.in == state.out)        @stageobjective(subproblem, 2.0)    end    SDDP.train(model; log_frequency = 10)    @test SDDP.calculate_bound(model)  2.0 / (1 - 0.9) atol = 1e-3    returnendinfinite_trivial()
-------------------------------------------------------------------
         SDDP.jl (c) Oscar Dowson and contributors, 2017-26
-------------------------------------------------------------------
problem
  nodes           : 1
  state variables : 1
  scenarios       : Inf
  existing cuts   : false
options
  solver          : serial mode
  risk measure    : SDDP.Expectation()
  sampling scheme : SDDP.InSampleMonteCarlo
subproblem structure
  VariableRef                             : [3, 3]
  AffExpr in MOI.EqualTo{Float64}         : [1, 1]
  VariableRef in MOI.GreaterThan{Float64} : [1, 1]
numerical stability report
  matrix range     [1e+00, 1e+00]
  objective range  [1e+00, 1e+00]
  bounds range     [0e+00, 0e+00]
  rhs range        [0e+00, 0e+00]
-------------------------------------------------------------------
 iteration    simulation      bound        time (s)     solves  pid
-------------------------------------------------------------------
        10   4.000000e+00  1.997089e+01  3.134394e-02      1204   1
        20   8.000000e+00  2.000000e+01  3.757501e-02      1420   1
        30   1.600000e+01  2.000000e+01  6.633091e-02      2628   1
        40   8.000000e+00  2.000000e+01  7.315397e-02      2834   1
-------------------------------------------------------------------
status         : simulation_stopping
total time (s) : 7.315397e-02
total solves   : 2834
best bound     :  2.000000e+01
numeric issues : 0
-------------------------------------------------------------------