Skip to content

Commit

Permalink
bring in line with stewart re t_stage
Browse files Browse the repository at this point in the history
  • Loading branch information
apozharski committed Jun 19, 2024
1 parent 115a3ad commit 28f826f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions +nosnoc/+discrete_time_problem/Cls.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,7 @@ function generate_direct_transcription_constraints(obj)

x_prev = obj.w.x(0,0,opts.n_s);
for ii=1:opts.N_stages
if obj.opts.use_fesd
t_stage = obj.p.T()/opts.N_stages;
h0 = obj.p.T().val/(opts.N_stages*opts.N_finite_elements(ii));
else
h0 = obj.p.T().val/(opts.N_stages*opts.N_finite_elements(ii));
end
h0 = obj.p.T().val/(opts.N_stages*opts.N_finite_elements(ii));

ui = obj.w.u(ii);
p_stage = obj.p.p_time_var(ii);
Expand All @@ -272,6 +267,13 @@ function generate_direct_transcription_constraints(obj)
else
s_sot = 1;
end
if opts.time_optimal_problem && ~opts.use_speed_of_time_variables
t_stage = obj.w.T_final()/(opts.N_stages*opts.N_finite_elements(ii));
elseif opts.time_optimal_problem
t_stage = s_sot*obj.p.T()/opts.N_stages;
else
t_stage = obj.p.T()/opts.N_stages;
end

sum_h = 0;
for jj=1:opts.N_finite_elements(ii)
Expand Down

0 comments on commit 28f826f

Please sign in to comment.