Skip to content

Commit

Permalink
Merge pull request #164 from moorepants/cycling-leg
Browse files Browse the repository at this point in the history
One-legged Cycling Time Trial Example
  • Loading branch information
moorepants committed Jul 6, 2024
2 parents 82db878 + 657cdf2 commit 0bc99d2
Show file tree
Hide file tree
Showing 5 changed files with 868 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Build Docs
run: |
# TODO : Remove when SymPy 1.13 comes out.
python -m pip install --no-deps git+https://github.com/sympy/sympy.git
cd docs
make html
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
'examples_dirs': os.path.join(REPO_DIR, 'examples-gallery'),
'gallery_dirs': 'examples',
'matplotlib_animations': True,
'copyfile_regex': r'.*\.svg',
'remove_config_comments': True,
}

# -- Options for HTML output ----------------------------------------------
Expand Down
14 changes: 11 additions & 3 deletions examples-gallery/plot_drone.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@
initial_guess[2*num_nodes:3*num_nodes] = xyz_guess
initial_guess[-4*num_nodes:] = 10.0 # constant thrust

prob.plot_trajectories(initial_guess)
fig, axes = plt.subplots(18, 1, sharex=True,
figsize=(6.4, 0.8*18),
layout='compressed')
prob.plot_trajectories(initial_guess, axes=axes)

# %%
# Find an optimal solution.
Expand All @@ -221,11 +224,16 @@

# %%
# Plot the optimal state and input trajectories.
prob.plot_trajectories(solution)
fig, axes = plt.subplots(18, 1, sharex=True,
figsize=(6.4, 0.8*18),
layout='compressed')
prob.plot_trajectories(solution, axes=axes)

# %%
# Plot the constraint violations.
prob.plot_constraint_violations(solution)
fig, axes = plt.subplots(2, figsize=(12.8, 9.6),
layout='constrained')
prob.plot_constraint_violations(solution, axes=axes)

# %%
# Plot the objective function as a function of optimizer iteration.
Expand Down
Loading

0 comments on commit 0bc99d2

Please sign in to comment.