File tree 1 file changed +8
-6
lines changed
+nosnoc/+discrete_time_problem
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -255,12 +255,7 @@ function generate_direct_transcription_constraints(obj)
255
255
256
256
x_prev = obj .w .x(0 ,0 ,opts .n_s );
257
257
for ii= 1 : opts .N_stages
258
- if obj .opts .use_fesd
259
- t_stage = obj .p .T()/opts .N_stages ;
260
- h0 = obj .p .T().val/(opts .N_stages * opts .N_finite_elements(ii ));
261
- else
262
- h0 = obj .p .T().val/(opts .N_stages * opts .N_finite_elements(ii ));
263
- end
258
+ h0 = obj .p .T().val/(opts .N_stages * opts .N_finite_elements(ii ));
264
259
265
260
ui = obj .w .u(ii );
266
261
p_stage = obj .p .p_time_var(ii );
@@ -272,6 +267,13 @@ function generate_direct_transcription_constraints(obj)
272
267
else
273
268
s_sot = 1 ;
274
269
end
270
+ if opts .time_optimal_problem && ~opts .use_speed_of_time_variables
271
+ t_stage = obj .w .T_final()/(opts .N_stages * opts .N_finite_elements(ii ));
272
+ elseif opts .time_optimal_problem
273
+ t_stage = s_sot * obj .p .T()/opts .N_stages ;
274
+ else
275
+ t_stage = obj .p .T()/opts .N_stages ;
276
+ end
275
277
276
278
sum_h = 0 ;
277
279
for jj= 1 : opts .N_finite_elements(ii )
You can’t perform that action at this time.
0 commit comments