Skip to content

Latest commit

 

History

History
73 lines (46 loc) · 2.14 KB

examples.rst

File metadata and controls

73 lines (46 loc) · 2.14 KB

Examples

iPython Notebook Examples

More examples, including some in-depth and experimental models, can be seen on nbviewer.

A Trivial GP

The most trivial GP we can think of: minimize x subject to the constraint x ≥ 1.

examples/x_greaterthan_1.py

Of course, the optimal value is 1. Output:

examples/x_greaterthan_1_output.txt

Maximizing the Volume of a Box

This example comes from Section 2.4 of the GP tutorial, by S. Boyd et. al.

examples/simple_box.py

The output is

examples/simple_box_output.txt

Water Tank

Say we had a fixed mass of water we wanted to contain within a tank, but also wanted to minimize the cost of the material we had to purchase (i.e. the surface area of the tank):

examples/water_tank.py

The output is

examples/water_tank_output.txt

Simple Wing

This example comes from Section 3 of Geometric Programming for Aircraft Design Optimization, by W. Hoburg and P. Abbeel.

examples/simple_wing.py

The output is

examples/simple_wing_output.txt

Simple Beam

In this example we consider a beam subjected to a uniformly distributed transverse force along its length. The beam has fixed geometry so we are not optimizing its shape, rather we are simply solving a discretization of the Euler-Bernoulli beam bending equations using GP.

examples/beam.py

The output is

examples/beam_output.txt

By plotting the deflection, we can see that the agreement between the analytical solution and the GP solution is good.