Skip to content

Commit

Permalink
added more accurate roots for collocation points
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiolucia committed Jun 28, 2018
1 parent 7f2f669 commit 85cc7df
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions code/setup_nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,9 @@ def setup_nlp(model, optimizer):

# Choose collocation points
if coll=='legendre': # Legendre collocation points
tau_root = (
[0,0.500000],
[0,0.211325,0.788675],
[0,0.112702,0.500000,0.887298],
[0,0.069432,0.330009,0.669991,0.930568],
[0,0.046910,0.230765,0.500000,0.769235,0.953090])[deg-1]
tau_root = [0]+collocation_points(deg, 'legendre')
elif coll=='radau': # Radau collocation points
tau_root = (
[0,1.000000],
[0,0.333333,1.000000],
[0,0.155051,0.644949,1.000000],
[0,0.088588,0.409467,0.787659,1.000000],
[0,0.057104,0.276843,0.583590,0.860240,1.000000])[deg-1]
tau_root = [0]+collocation_points(deg, 'radau')
else:
raise Exception('Unknown collocation scheme')

Expand Down

0 comments on commit 85cc7df

Please sign in to comment.