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 20, 2024
1 parent a06f02f commit 52243ee
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions +nosnoc/+discrete_time_problem/Gcs.m
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,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 @@ -149,6 +144,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 52243ee

Please sign in to comment.