rcnl-org/nmsm-core

[REQUEST] Determine number of B-spline nodes for TO derivatives from cutoff frequency

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe.
Treatment Optimization tools currently use 10 B-spline nodes to calculate initial state derivatives. This prevents longer or more complex states from working well with the tool in the initial guess.

Describe the solution you'd like
Treatment Optimization should use a cutoff frequency to determine the number of nodes needed to spline the states, similar to how GCP works. This could include defining a function that calculates an appropriate number of nodes from a cutoff frequency and the derivatives in one step, as a function called calcBSplineDerivativeFromFrequency() might work. The cutoff frequency may be hard-coded.

Describe alternatives you've considered
Using a hard-coded value of 10 nodes has worked for trials we have used so far, but we know from using GCP that the number of nodes needed to represent the data well will vary.

Implemented on dev (29a3164). Did not use a function to calculate a number of nodes and derivatives in one step due to the node number being needed multiple times.