Skip to content

Commit

Permalink
Ref #127 Made brachistochrone example use reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
msparapa committed Oct 29, 2019
1 parent dc66060 commit d50d661
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Features
* Phaseless construction.
* Discontinuous function modeling.
* Hamiltonian "indirect" methods and definition of co-states.
* Automated Noether's theorem and symplectic reduction.
* Hermite-Simpson Collocation and Multiple Shooting methods.
* Automated scaling.
* Lots of examples and open-source.
Expand Down
11 changes: 6 additions & 5 deletions examples/Classic/Brachistochrone/Brachistochrone.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
.state('y', 'v*sin(theta)', 'm') \
.state('v', 'g*sin(theta)', 'm/s')

ocp.constant_of_motion('c1', 'lamX', 's/m')
ocp.constant_of_motion('c2', 'lamY', 's/m')
ocp.symmetry(['1', '0', '0'], 'm')
ocp.symmetry(['0', '1', '0'], 'm')

# Define controls
ocp.control('theta', 'rad')
Expand All @@ -38,7 +38,7 @@

ocp.scale(m='y', s='y/v', kg=1, rad=1, nd=1)

bvp_solver = beluga.bvp_algorithm('Shooting', algorithm='SLSQP')
bvp_solver = beluga.bvp_algorithm('Shooting')

guess_maker = beluga.guess_generator(
'auto',
Expand All @@ -59,10 +59,11 @@

sol_set = beluga.solve(
ocp=ocp,
method='indirect',
method='diffyg',
optim_options={'reduction': True},
bvp_algorithm=bvp_solver,
steps=continuation_steps,
guess_generator=guess_maker,
autoscale=True,
autoscale=False,
initial_helper=True
)

0 comments on commit d50d661

Please sign in to comment.