Skip to content

What to do (if anything) about the first point of a backward Euler solution being discontinuous? #412

Open
@moorepants

Description

@moorepants

If you have N nodes, then you only get N-1 constraints for the equations of motion due to the discretization:

$\frac{d\mathbf{y}}{dt} \approx \frac{\mathbf{y}i - \mathbf{y}{i-1}}{h}$

dy   y_i - y_{i-1}
-- = -----------------
dt   t_i - t_{i-1}

So for i = 2, ..., N we make N-1 constraint equations. When n = 1 there is no n-1=0 point to make a constraint with. Thus the n=1 node does not have to abide by the equations of motion relative to the prior non-existent node.

Examples:

https://opty.readthedocs.io/latest/examples/beginner/plot_betts_10_7.html

Image

https://opty.readthedocs.io/latest/examples/beginner/plot_pendulum_swing_up_fixed_duration.html

Only on the input:

Image

https://opty.readthedocs.io/latest/examples/beginner/plot_betts_10_50.html

Image

What can we do:

  1. We could return a solution for only n=1, ..., N.
  2. Don't plot the first node.
  3. Add an extra node when formulating the problem, but they remove it in the solution so the user gets the expected results back.
  4. Use forward Euler on the first node.
  5. other?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions