Skip to content

Commit

Permalink
error estimation now uses appropriate timeseries prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
robfalck committed Jun 30, 2023
1 parent 2f48d8e commit 487f916
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dymos/grid_refinement/error_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,11 @@ def eval_ode_on_grid(phase, transcription):
if t_duration_targets:
p_refine.set_val(f't_duration', t_duration)

state_prefix = 'states:' if phase.timeseries_options['use_prefix'] else ''
control_prefix = 'controls:' if phase.timeseries_options['use_prefix'] else ''

for name, options in phase.state_options.items():
x_prev = phase.get_val(f'timeseries.states:{name}', units=options['units'])
x_prev = phase.get_val(f'timeseries.{state_prefix}{name}', units=options['units'])
x[name] = np.dot(L, x_prev)
targets = get_targets(ode, name, options['targets'])
if targets:
Expand All @@ -178,7 +181,7 @@ def eval_ode_on_grid(phase, transcription):
rate_targets = get_targets(ode, f'{name}_rate', options['rate_targets'])
rate2_targets = get_targets(ode, f'{name}_rate12', options['rate2_targets'])

u_prev = phase.get_val(f'timeseries.controls:{name}', units=options['units'])
u_prev = phase.get_val(f'timeseries.{control_prefix}{name}', units=options['units'])
u[name] = np.dot(L, u_prev)
if targets:
p_refine.set_val(f'controls:{name}', u[name])
Expand Down

0 comments on commit 487f916

Please sign in to comment.