Peter’s Mechanics Examples

Mechanics examples created using various scientific Python tools: SymPy, PyDy, Opty, SciPy, Matplotlib, etc.

Contents:

Mechanics Animations

Comparisons

John T. Betts’ book Practical Methods for Optimal Control Using Nonlinear Programming is considered to be a foundational text in the field of optimal control using nonlinear programming. In its section 10 it gives a number of example problems with solutions. The solutions were calculated by SOS, a Fortran 95 proprietary code written by Dr. Betts and collaborators, and maintained by ASTOS GmbH.

We solved a number of them using opty. They may be found at these locations:

Notes:

  • The number of the examples, e.g. 10.58 refers to the numbering in the a.m. book, 3rd edition, 2020.

  • Dr. John Betts was always very helpful and answered any questions I had regarding the examples.

  • While most of the examples we tried to solve with opty converged easily to a result close to that given in the book, a few did not converge.

  • By accuracy is meant the deviation from the solution given in the book.

List of Examples Solved with opty

Number

Name

Location

Remarks

10.1

Stiff Set of DAEs

3

Differential equation designed to be very stiff. Accuracy 1.05%

10.6

Underwater Vehicle

3

Accuracy 0.095%

10.7

Hypersensitive Control

1

Accuracy 0.143%

10.43

Free Flying Robot

3

Accuracy 2.77%

10.47

Singular Arc Problem

2

Three Phase Problem. While SOS solved it simultaneously, opty had to solve it in separate stages. Overall accuracy < 0.95%

10.50

Delay Equation

1

Accuracy 0.027%

10.57

Heat Diffusion Process with Inequality

3

Accuracy 1.17%

10.58

Heat Equation

3

This deals with the discretization of a PDE. opty converged, but the accuracy was not good.

10.73 10.74

Linear Tangent Steering

3

The same physical problem, formulated in two different ways. Accuracy 0.00012%

10.90

Nonconvex delay

3

Accuracy 0.004%

10.103 10.104

Compare DAE vs. ODE Formulation

1

The same physical problem formulated in two different ways. Accuracy 2.49%

10.113

Mixed State-Control Constraints

3

Accuracy 0.03%

10.133

Two-Strain Tuberculosis Model

3

Accuracy 0.16%

10.141

Tumor Anti angiogenesis

3

Accuracy 1.45% / 0.1975%

10.144 10.145

Van der Pol Oscillator

3

Two different formulations of the same problem. Accuracy 0.017%

10.148

Zermelo’s Problem

3

Accuracy 0.023%

Parameter Identification Betts & Huffmann 2003

1

Accuracy 0.021%

Brachistochrone with Obstruction

3

As per section 4.16.2 of the a.m. book this can be difficult. opty solved it with no problems.