Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove state rates, control rates, and t_phase from the timeseries by default, and remove type prefix. #935

Merged
merged 22 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c83c84f
Remove state rates, control rates, and t_phase from the timeseries by…
robfalck May 31, 2023
daa1b84
No longer apply variable type prefix to timeseries output, by default.
robfalck May 31, 2023
b807b1c
Merge branch 'master' of https://github.com/OpenMDAO/dymos into times…
robfalck May 31, 2023
ef6b132
when requesting rate source values in timeseries but without prefixes…
robfalck Jun 1, 2023
5beb3f9
more fixes for timeseries change
robfalck Jun 1, 2023
3206a2b
more changes to accommodate removal of timeseries prefixes.
robfalck Jun 1, 2023
a5b1715
more timeseries change accommodations
robfalck Jun 1, 2023
a738a38
more changes from the timeseries output renaming
robfalck Jun 1, 2023
0e924ff
fixes for no_pyoptsparse tests
robfalck Jun 2, 2023
bfcdb28
continued progress on the timeseries name output change.
robfalck Jun 2, 2023
23fa42a
Make dymos options temporary in tests to avoid sticky issues.
robfalck Jun 2, 2023
bd03189
fixed tandem phase documents that relied on timeseries prefixes
robfalck Jun 2, 2023
5a427e7
BACKWARDS INCOMPATIBILITY: Changed dymos global use_timeseries_prefix…
robfalck Jun 2, 2023
22f9a22
Continuing to cleanup tests.
robfalck Jun 2, 2023
5e4415e
Merge branch 'master' of https://github.com/OpenMDAO/dymos into times…
robfalck Jun 8, 2023
7b39555
adapt balanced field length doc test to the timeseries changes
robfalck Jun 8, 2023
b42190c
Merge branch 'master' of https://github.com/OpenMDAO/dymos into times…
robfalck Jun 23, 2023
f53b725
Merge branch 'master' of https://github.com/OpenMDAO/dymos into times…
robfalck Jun 28, 2023
b6c1521
add duration timings to testflo since latest is running considerably …
robfalck Jun 28, 2023
e513cab
apply timeseries name changing to the implciit t_duration tests
robfalck Jun 28, 2023
c1e3215
updated implicit duration docs for new timeseries updates
robfalck Jun 28, 2023
f45e18a
another timeseries prefix usage fixed in test
robfalck Jun 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions benchmark/benchmark_brachistochrone.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ def run_asserts(self, p):
t_initial = p.get_val('phase0.timeseries.time')[0]
tf = p.get_val('phase0.timeseries.time')[-1]

x0 = p.get_val('phase0.timeseries.states:x')[0]
xf = p.get_val('phase0.timeseries.states:x')[-1]
x0 = p.get_val('phase0.timeseries.x')[0]
xf = p.get_val('phase0.timeseries.x')[-1]

y0 = p.get_val('phase0.timeseries.states:y')[0]
yf = p.get_val('phase0.timeseries.states:y')[-1]
y0 = p.get_val('phase0.timeseries.y')[0]
yf = p.get_val('phase0.timeseries.y')[-1]

v0 = p.get_val('phase0.timeseries.states:v')[0]
vf = p.get_val('phase0.timeseries.states:v')[-1]
v0 = p.get_val('phase0.timeseries.v')[0]
vf = p.get_val('phase0.timeseries.v')[-1]

g = p.get_val('phase0.parameter_vals:g')[0]

thetaf = p.get_val('phase0.timeseries.controls:theta')[-1]
thetaf = p.get_val('phase0.timeseries.theta')[-1]

assert_near_equal(t_initial, 0.0)
assert_near_equal(x0, 0.0)
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark_racecar.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _run_racecar_problem(transcription, timeseries=False, make_plots=False):
dm.run_problem(p, run_driver=True, simulate=False, make_plots=make_plots)
print('Optimization finished')

t = p.get_val('traj.phase0.timeseries.states:t')
t = p.get_val('traj.phase0.timeseries.t')
assert_near_equal(t[-1], 22.2657, tolerance=0.01)


Expand Down
8 changes: 4 additions & 4 deletions docs/dymos_book/examples/balanced_field/balanced_field.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,8 @@
"\n",
"fig, axes = plt.subplots(2, 1, sharex=True, gridspec_kw={'top': 0.92}, figsize=(12,6))\n",
"for phase in ['br_to_v1', 'rto', 'v1_to_vr', 'rotate', 'climb']:\n",
" r = sim_case.get_val(f'traj.{phase}.timeseries.states:r', units='ft')\n",
" v = sim_case.get_val(f'traj.{phase}.timeseries.states:v', units='kn')\n",
" r = sim_case.get_val(f'traj.{phase}.timeseries.r', units='ft')\n",
" v = sim_case.get_val(f'traj.{phase}.timeseries.v', units='kn')\n",
" t = sim_case.get_val(f'traj.{phase}.timeseries.time', units='s')\n",
" axes[0].plot(t, r, '-', label=phase)\n",
" axes[1].plot(t, v, '-', label=phase)\n",
Expand All @@ -727,10 +727,10 @@
"axes[1].grid(True)\n",
"\n",
"tv1 = sim_case.get_val('traj.br_to_v1.timeseries.time', units='s')[-1, 0]\n",
"v1 = sim_case.get_val('traj.br_to_v1.timeseries.states:v', units='kn')[-1, 0]\n",
"v1 = sim_case.get_val('traj.br_to_v1.timeseries.v', units='kn')[-1, 0]\n",
"\n",
"tf_rto = sim_case.get_val('traj.rto.timeseries.time', units='s')[-1, 0]\n",
"rf_rto = sim_case.get_val('traj.rto.timeseries.states:r', units='ft')[-1, 0]\n",
"rf_rto = sim_case.get_val('traj.rto.timeseries.r', units='ft')[-1, 0]\n",
"\n",
"axes[0].annotate(f'field length = {r[-1, 0]:5.1f} ft', xy=(t[-1, 0], r[-1, 0]),\n",
" xycoords='data', xytext=(0.7, 0.5),\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@
"\n",
"fig, axes = plt.subplots(2, 1, sharex=True, gridspec_kw={'top': 0.92}, figsize=(12, 6))\n",
"for phase in ['br_to_v1', 'rto', 'v1_to_vr', 'rotate', 'climb']:\n",
" r = sim_case.get_val(f'traj.{phase}.timeseries.states:r', units='ft')\n",
" v = sim_case.get_val(f'traj.{phase}.timeseries.states:v', units='kn')\n",
" r = sim_case.get_val(f'traj.{phase}.timeseries.r', units='ft')\n",
" v = sim_case.get_val(f'traj.{phase}.timeseries.v', units='kn')\n",
" t = sim_case.get_val(f'traj.{phase}.timeseries.time', units='s')\n",
" axes[0].plot(t, r, '-', label=phase)\n",
" axes[1].plot(t, v, '-', label=phase)\n",
Expand All @@ -464,10 +464,10 @@
"axes[1].grid(True)\n",
"\n",
"tv1 = sim_case.get_val('traj.br_to_v1.timeseries.time', units='s')[-1, 0]\n",
"v1 = sim_case.get_val('traj.br_to_v1.timeseries.states:v', units='kn')[-1, 0]\n",
"v1 = sim_case.get_val('traj.br_to_v1.timeseries.v', units='kn')[-1, 0]\n",
"\n",
"tf_rto = sim_case.get_val('traj.rto.timeseries.time', units='s')[-1, 0]\n",
"rf_rto = sim_case.get_val('traj.rto.timeseries.states:r', units='ft')[-1, 0]\n",
"rf_rto = sim_case.get_val('traj.rto.timeseries.r', units='ft')[-1, 0]\n",
"\n",
"axes[0].annotate(f'field length = {r[-1, 0]:5.1f} ft', xy=(t[-1, 0], r[-1, 0]),\n",
" xycoords='data', xytext=(0.7, 0.5),\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,9 @@
"# Generate the explicitly simulated trajectory\n",
"exp_out = traj.simulate()\n",
"\n",
"plot_results([('traj.phase0.timeseries.states:x', 'traj.phase0.timeseries.states:y',\n",
"plot_results([('traj.phase0.timeseries.x', 'traj.phase0.timeseries.y',\n",
" 'x (m)', 'y (m)'),\n",
" ('traj.phase0.timeseries.time', 'traj.phase0.timeseries.controls:theta',\n",
" ('traj.phase0.timeseries.time', 'traj.phase0.timeseries.theta',\n",
" 'time (s)', 'theta (deg)')],\n",
" title='Brachistochrone Solution\\nHigh-Order Gauss-Lobatto Method',\n",
" p_sol=p, p_sim=exp_out)\n",
Expand Down Expand Up @@ -649,9 +649,9 @@
},
"outputs": [],
"source": [
"plot_results([('traj.phase0.timeseries.states:x', 'traj.phase0.timeseries.states:y',\n",
"plot_results([('traj.phase0.timeseries.x', 'traj.phase0.timeseries.y',\n",
" 'x (m)', 'y (m)'),\n",
" ('traj.phase0.timeseries.time', 'traj.phase0.timeseries.controls:theta',\n",
" ('traj.phase0.timeseries.time', 'traj.phase0.timeseries.theta',\n",
" 'time (s)', 'theta (deg)')],\n",
" title='Brachistochrone Solution\\nExplicit Shooting Method',\n",
" p_sol=p)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@
"#\n",
"p.model.connect('phase0.t_duration', 'phase1.t_duration')\n",
"\n",
"p.model.connect('phase0.timeseries2.controls:theta', 'phase1.controls:theta')\n",
"p.model.connect('phase0.timeseries2.states:v', 'phase1.controls:v')\n",
"p.model.connect('phase0.timeseries2.theta', 'phase1.controls:theta')\n",
"p.model.connect('phase0.timeseries2.v', 'phase1.controls:v')\n",
"\n",
"# Minimize time\n",
"phase1.add_objective('time', loc='final', ref=1)\n",
Expand Down Expand Up @@ -308,12 +308,12 @@
"\n",
"sol_case = om.CaseReader('dymos_solution.db').get_case('final')\n",
"\n",
"sol_x = sol_case.get_val('phase0.timeseries.states:x')\n",
"sol_y = sol_case.get_val('phase0.timeseries.states:y')\n",
"sol_v = sol_case.get_val('phase0.timeseries.states:v')\n",
"sol_x = sol_case.get_val('phase0.timeseries.x')\n",
"sol_y = sol_case.get_val('phase0.timeseries.y')\n",
"sol_v = sol_case.get_val('phase0.timeseries.v')\n",
"sol_t0 = sol_case.get_val('phase0.timeseries.time')\n",
"sol_t1 = sol_case.get_val('phase1.timeseries.time')\n",
"sol_s = sol_case.get_val('phase1.timeseries.states:S')\n",
"sol_s = sol_case.get_val('phase1.timeseries.S')\n",
"\n",
"def add_plot(p, x, y, label, i):\n",
" circle = p.circle(x.ravel(), y.ravel(), color=c[i], size=5)\n",
Expand Down Expand Up @@ -357,7 +357,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.5"
"version": "3.11.0"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@
"# Plot the results\n",
"fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12, 4.5))\n",
"\n",
"axes[0].plot(p.get_val('traj.phase0.timeseries.states:x'),\n",
" p.get_val('traj.phase0.timeseries.states:y'),\n",
"axes[0].plot(p.get_val('traj.phase0.timeseries.x'),\n",
" p.get_val('traj.phase0.timeseries.y'),\n",
" 'ro', label='solution')\n",
"\n",
"axes[0].plot(sim_out.get_val('traj.phase0.timeseries.states:x'),\n",
" sim_out.get_val('traj.phase0.timeseries.states:y'),\n",
"axes[0].plot(sim_out.get_val('traj.phase0.timeseries.x'),\n",
" sim_out.get_val('traj.phase0.timeseries.y'),\n",
" 'b-', label='simulation')\n",
"\n",
"axes[0].set_xlabel('x (m)')\n",
Expand All @@ -199,11 +199,11 @@
"axes[0].grid()\n",
"\n",
"axes[1].plot(p.get_val('traj.phase0.timeseries.time'),\n",
" p.get_val('traj.phase0.timeseries.controls:theta', units='deg'),\n",
" p.get_val('traj.phase0.timeseries.theta', units='deg'),\n",
" 'ro', label='solution')\n",
"\n",
"axes[1].plot(sim_out.get_val('traj.phase0.timeseries.time'),\n",
" sim_out.get_val('traj.phase0.timeseries.controls:theta', units='deg'),\n",
" sim_out.get_val('traj.phase0.timeseries.theta', units='deg'),\n",
" 'b-', label='simulation')\n",
"\n",
"axes[1].set_xlabel('time (s)')\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"# Connect x0 to the state error component so we can constrain the given value of x0\n",
"# to be equal to the value chosen in the phase.\n",
"# p.model.connect('x0', 'state_error_comp.x0_target')\n",
"# p.model.connect('traj.phase0.timeseries.states:x', 'state_error_comp.x0_actual',\n",
"# p.model.connect('traj.phase0.timeseries.x', 'state_error_comp.x0_actual',\n",
"# src_indices=[0])\n",
"p.model.connect('t_initial', 'traj.phase0.t_initial')\n",
"p.model.connect('t_duration', 'traj.phase0.t_duration')\n",
Expand Down Expand Up @@ -188,21 +188,21 @@
"\n",
"# Plot the results\n",
"fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12, 4.5))\n",
"axes[0].plot(sol.get_val('traj.phase0.timeseries.states:x'),\n",
" sol.get_val('traj.phase0.timeseries.states:y'),\n",
"axes[0].plot(sol.get_val('traj.phase0.timeseries.x'),\n",
" sol.get_val('traj.phase0.timeseries.y'),\n",
" 'ro', label='solution')\n",
"axes[0].plot(sim.get_val('traj.phase0.timeseries.states:x'),\n",
" sim.get_val('traj.phase0.timeseries.states:y'),\n",
"axes[0].plot(sim.get_val('traj.phase0.timeseries.x'),\n",
" sim.get_val('traj.phase0.timeseries.y'),\n",
" 'b-', label='simulation')\n",
"axes[0].set_xlabel('x (m)')\n",
"axes[0].set_ylabel('y (m/s)')\n",
"axes[0].legend()\n",
"axes[0].grid()\n",
"axes[1].plot(sol.get_val('traj.phase0.timeseries.time'),\n",
" sol.get_val('traj.phase0.timeseries.controls:theta', units='deg'),\n",
" sol.get_val('traj.phase0.timeseries.theta', units='deg'),\n",
" 'ro', label='solution')\n",
"axes[1].plot(sim.get_val('traj.phase0.timeseries.time'),\n",
" sim.get_val('traj.phase0.timeseries.controls:theta', units='deg'),\n",
" sim.get_val('traj.phase0.timeseries.theta', units='deg'),\n",
" 'b-', label='simulation')\n",
"axes[1].set_xlabel('time (s)')\n",
"axes[1].set_ylabel(r'$\\theta$ (deg)')\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"# Connect x0 to the state error component so we can constrain the given value of x0\n",
"# to be equal to the value chosen in the phase.\n",
"p.model.connect('x0', 'state_error_comp.x0_target')\n",
"p.model.connect('traj.phase0.timeseries.states:x', 'state_error_comp.x0_actual', src_indices=[0])\n",
"p.model.connect('traj.phase0.timeseries.x', 'state_error_comp.x0_actual', src_indices=[0])\n",
"\n",
"#\n",
"# Define a Trajectory object\n",
Expand Down Expand Up @@ -203,12 +203,12 @@
"# Plot the results\n",
"fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12, 4.5))\n",
"\n",
"axes[0].plot(p.get_val('traj.phase0.timeseries.states:x'),\n",
" p.get_val('traj.phase0.timeseries.states:y'),\n",
"axes[0].plot(p.get_val('traj.phase0.timeseries.x'),\n",
" p.get_val('traj.phase0.timeseries.y'),\n",
" 'ro', label='solution')\n",
"\n",
"axes[0].plot(sim_out.get_val('traj.phase0.timeseries.states:x'),\n",
" sim_out.get_val('traj.phase0.timeseries.states:y'),\n",
"axes[0].plot(sim_out.get_val('traj.phase0.timeseries.x'),\n",
" sim_out.get_val('traj.phase0.timeseries.y'),\n",
" 'b-', label='simulation')\n",
"\n",
"axes[0].set_xlabel('x (m)')\n",
Expand All @@ -217,11 +217,11 @@
"axes[0].grid()\n",
"\n",
"axes[1].plot(p.get_val('traj.phase0.timeseries.time'),\n",
" p.get_val('traj.phase0.timeseries.controls:theta', units='deg'),\n",
" p.get_val('traj.phase0.timeseries.theta', units='deg'),\n",
" 'ro', label='solution')\n",
"\n",
"axes[1].plot(sim_out.get_val('traj.phase0.timeseries.time'),\n",
" sim_out.get_val('traj.phase0.timeseries.controls:theta', units='deg'),\n",
" sim_out.get_val('traj.phase0.timeseries.theta', units='deg'),\n",
" 'b-', label='simulation')\n",
"\n",
"axes[1].set_xlabel('time (s)')\n",
Expand Down
16 changes: 8 additions & 8 deletions docs/dymos_book/examples/bryson_denham/bryson_denham.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,17 @@
"sim = om.CaseReader('dymos_simulation.db').get_case('final')\n",
"\n",
"t = sol.get_val('traj.phase0.timeseries.time')\n",
"x = sol.get_val('traj.phase0.timeseries.states:x')\n",
"v = sol.get_val('traj.phase0.timeseries.states:v')\n",
"J = sol.get_val('traj.phase0.timeseries.states:J')\n",
"u = sol.get_val('traj.phase0.timeseries.controls:u')\n",
"x = sol.get_val('traj.phase0.timeseries.x')\n",
"v = sol.get_val('traj.phase0.timeseries.v')\n",
"J = sol.get_val('traj.phase0.timeseries.J')\n",
"u = sol.get_val('traj.phase0.timeseries.u')\n",
"h = np.sin(3 * x) / 3\n",
"\n",
"t_sim = sim.get_val('traj.phase0.timeseries.time')\n",
"x_sim = sim.get_val('traj.phase0.timeseries.states:x')\n",
"v_sim = sim.get_val('traj.phase0.timeseries.states:v')\n",
"J_sim = sim.get_val('traj.phase0.timeseries.states:J')\n",
"u_sim = sim.get_val('traj.phase0.timeseries.controls:u')\n",
"x_sim = sim.get_val('traj.phase0.timeseries.x')\n",
"v_sim = sim.get_val('traj.phase0.timeseries.v')\n",
"J_sim = sim.get_val('traj.phase0.timeseries.J')\n",
"u_sim = sim.get_val('traj.phase0.timeseries.u')\n",
"h_sim = np.sin(3 * x_sim) / 3\n",
"\n",
"fig = plt.figure(constrained_layout=True, figsize=(12, 4))\n",
Expand Down
16 changes: 8 additions & 8 deletions docs/dymos_book/examples/cart_pole/cart_pole.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,17 @@
"sim = om.CaseReader('dymos_simulation.db').get_case('final')\n",
"\n",
"# plot time histories of x, x_dot, theta, theta_dot\n",
"plot_results([('traj.phase.timeseries.time', 'traj.phase.timeseries.states:x', 'time (s)', 'x (m)'),\n",
" ('traj.phase.timeseries.time', 'traj.phase.timeseries.states:x_dot', 'time (s)', 'vx (m/s)'),\n",
" ('traj.phase.timeseries.time', 'traj.phase.timeseries.states:theta', 'time (s)', 'theta (rad)'),\n",
" ('traj.phase.timeseries.time', 'traj.phase.timeseries.states:theta_dot', 'time (s)', 'theta_dot (rad/s)'),\n",
" ('traj.phase.timeseries.time', 'traj.phase.timeseries.controls:f', 'time (s)', 'control (N)')],\n",
"plot_results([('traj.phase.timeseries.time', 'traj.phase.timeseries.x', 'time (s)', 'x (m)'),\n",
" ('traj.phase.timeseries.time', 'traj.phase.timeseries.x_dot', 'time (s)', 'vx (m/s)'),\n",
" ('traj.phase.timeseries.time', 'traj.phase.timeseries.theta', 'time (s)', 'theta (rad)'),\n",
" ('traj.phase.timeseries.time', 'traj.phase.timeseries.theta_dot', 'time (s)', 'theta_dot (rad/s)'),\n",
" ('traj.phase.timeseries.time', 'traj.phase.timeseries.f', 'time (s)', 'control (N)')],\n",
" title='Cart-Pole Problem', p_sol=sol, p_sim=sim)\n",
"\n",
"# uncomment the following lines to show the cart-pole animation\n",
"### x = sol.get_val('traj.phase.timeseries.states:x', units='m')\n",
"### theta = sol.get_val('traj.phase.timeseries.states:theta', units='rad')\n",
"### force = sol.get_val('traj.phase.timeseries.controls:f', units='N')\n",
"### x = sol.get_val('traj.phase.timeseries.x', units='m')\n",
"### theta = sol.get_val('traj.phase.timeseries.theta', units='rad')\n",
"### force = sol.get_val('traj.phase.timeseries.f', units='N')\n",
"### npts = len(x)\n",
"\n",
"### from dymos.examples.cart_pole.animate_cartpole import animate_cartpole\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@
"source": [
"from openmdao.utils.assert_utils import assert_near_equal\n",
"\n",
"assert_near_equal(p.get_val('traj.phase0.timeseries.states:range', units='NM')[-1],\n",
"assert_near_equal(p.get_val('traj.phase0.timeseries.range', units='NM')[-1],\n",
" 726.85, tolerance=1.0E-2)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@
"sol = om.CaseReader('dymos_solution.db').get_case('final')\n",
"sim = om.CaseReader('dymos_simulation.db').get_case('final')\n",
"\n",
"plot_results([('traj.phase0.timeseries.time', 'traj.phase0.timeseries.states:x',\n",
"plot_results([('traj.phase0.timeseries.time', 'traj.phase0.timeseries.x',\n",
" 'time (s)', 'x $(m)$'),\n",
" ('traj.phase0.timeseries.time', 'traj.phase0.timeseries.states:v',\n",
" ('traj.phase0.timeseries.time', 'traj.phase0.timeseries.v',\n",
" 'time (s)', 'v $(m/s)$'),\n",
" ('traj.phase0.timeseries.time', 'traj.phase0.timeseries.controls:u',\n",
" ('traj.phase0.timeseries.time', 'traj.phase0.timeseries.u',\n",
" 'time (s)', 'u $(m/s^2)$')],\n",
" title='Double Integrator Solution\\nRadau Pseudospectral Method',\n",
" p_sol=sol, p_sim=sim)\n",
Expand All @@ -236,8 +236,8 @@
"source": [
"from openmdao.utils.assert_utils import assert_near_equal\n",
"\n",
"x = p.get_val('traj.phase0.timeseries.states:x')\n",
"v = p.get_val('traj.phase0.timeseries.states:v')\n",
"x = p.get_val('traj.phase0.timeseries.x')\n",
"v = p.get_val('traj.phase0.timeseries.v')\n",
"\n",
"assert_near_equal(x[0], 0.0, tolerance=1.0E-4)\n",
"assert_near_equal(x[-1], 0.25, tolerance=1.0E-4)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@
" for phs in ['burn1', 'coast', 'burn2'])\n",
"y_sol = dict((phs, sol.get_val(f'traj.{phs}.timeseries.pos_y'.format(phs)))\n",
" for phs in ['burn1', 'coast', 'burn2'])\n",
"dv_sol = dict((phs, sol.get_val(f'traj.{phs}.timeseries.states:deltav'.format(phs)))\n",
"dv_sol = dict((phs, sol.get_val(f'traj.{phs}.timeseries.deltav'.format(phs)))\n",
" for phs in ['burn1', 'coast', 'burn2'])\n",
"u1_sol = dict((phs, sol.get_val(f'traj.{phs}.timeseries.controls:u1'.format(phs), units='deg'))\n",
"u1_sol = dict((phs, sol.get_val(f'traj.{phs}.timeseries.u1'.format(phs), units='deg'))\n",
" for phs in ['burn1', 'burn2'])\n",
"\n",
"t_exp = dict((phs, sim.get_val(f'traj.{phs}.timeseries.time'))\n",
Expand All @@ -342,9 +342,9 @@
" for phs in ['burn1', 'coast', 'burn2'])\n",
"y_exp = dict((phs, sim.get_val(f'traj.{phs}.timeseries.pos_y'))\n",
" for phs in ['burn1', 'coast', 'burn2'])\n",
"dv_exp = dict((phs, sim.get_val(f'traj.{phs}.timeseries.states:deltav'))\n",
"dv_exp = dict((phs, sim.get_val(f'traj.{phs}.timeseries.deltav'))\n",
" for phs in ['burn1', 'coast', 'burn2'])\n",
"u1_exp = dict((phs, sim.get_val(f'traj.{phs}.timeseries.controls:u1',\n",
"u1_exp = dict((phs, sim.get_val(f'traj.{phs}.timeseries.u1',\n",
" units='deg'))\n",
" for phs in ['burn1', 'burn2'])\n",
"\n",
Expand Down
Loading