Hi @psuskin, welcome to the forum!
It isn’t clear to me what you mean by max_step_size.
Are you solving a single optimization problem indexed by time, or a different optimization problem for each time step?
As two options, you might do:
model = Model()
@variable(model, x)
@variable(model, x_last in Parameter(1.0))
@constraint(model, -0.01 <= x - x_last <= 0.1)
for t in 1:3
optimize!(model)
x_sol = value(x)
set_parameter_value(x_last, x_sol)
end
Or
model = Model()
@variable(model, x[1:T])
@constraint(model, [t in 2:T], -0.01 <= x[t] - x[t-1] <= 0.1)
optimize!(model)