Le 19/04/2012 18:43, Bernard GODARD a écrit :
>> Well, let's say you have a framework which requires solving
>> an equation deep down, and you want to pass a solver from the
>> outside. I admit this is exotic, and in all of the examples I've
>> seen the usage of a solver in such a framework was ultimately part
>> of a function evaluation, an should probably be encapsulated as
>> such.
> 
> This is exactly my problem. I have a module that computes a satellite
> orbit. The most useful method returns the satellite state at the
> desired time. To do so, it has to solve an equation deep down. The
> solver is passed to the constructor during initialization and can also
> be changed using setter/getter.

I understand your point, but in this case the solvers should either have
the same API or if you want to support both solvers that use only
function values and solvers that also use the derivative, you can use
two constructors, two setters and two fields for storing the solvers.
Only one of the fields would be non-null at any time.

> I could of course have a unique solver that is transparent to the user
> of my module (except for accuracy tuning that could be passed to the
> constructor) but then the user does not get as much freedom.

I would suggest something along this line, and especially using the Nth
order bracketing solver with a setting for 5th order. It does not need
derivatives, it is as fast (or faster) than Newton (higher order) and
provides the very interesting bracket selection feature at convergence.

best regards,
Luc

> 
>       Bernard
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

Reply via email to