commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <>
Subject [jira] Commented: (MATH-250) Solver for rational and other equations
Date Thu, 19 Mar 2009 06:33:50 GMT


Luc Maisonobe commented on MATH-250:

This comment may be slightly out of scope, but aside from commons-math, we have a project
in the commons sandbox which is dedicated to derivatives computations : Nabla [].
The project is not ready for production use and cannot handle some constructs properly yet
like temporary variables or loops. But a straightforward implementation of your rational function
like the following one is differentiated properly:

public class MyRationalFunction implements UnivariateDifferentiable {
            public double f(double t) {
                return Math.pow(1 - t, 2) / Math.pow(1 + t, 2) - 1;

This would also work with embedded Math.sin, Math.exp ... 

There have been no work on Nabla since months as I was much busy with commons math. I expect
to work on it again very soon.

> Solver for rational and other equations
> ---------------------------------------
>                 Key: MATH-250
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 2.0
>            Reporter: Bernhard Gr├╝newaldt
>            Priority: Minor
>             Fix For: 2.0
> In addition to the existing PolynomialFunction class a RationalFunction class would be
a good idea.
> For package:
> The goal should be to calculate derivates of functions like:
> f(x) = [ x + 2*x^3 ] / [ x -1]
> or 
> f(x) = [ e^x + 2*x ] / [ cos(x) ]
> Therefore it would be best to have classes for all the inner equations like "e", "sin,cos,tan
...", "sqrt", a.s.o
> These inner equations would then be put together to an outer equation. 
> This outer equation can then be derived using the "chain rule", "product rule" and all
other rules for getting the derivative.
> One of this inner classes is the existing PolynomialFunction class from the analysis
> For easy rational functions the outer equation is of the form:
> f(x) = PolynomialFunction / PolynomialFunction
> Now just use the rule to derive it:
> f(x) = g(x) / h(x)   =>  f'(x) = [h(x) * g'(x) - g(x) * h'(x) ] / [ h(x) ]^2
> Here we can use the inner derivate of the PolynomialFunction by calling PolynomialFunction.derivative()
> That's the idea, now the topics that have to be discussed:
> 1. We should have a parser that can parse the "standard mathematical notation" into a
tree of function classes.
> 2. A class for every type of function should be implemented with an interface that has
the common methods like:
>     add(Object o)
>     subtract(Object o)
>     multiply(Object o)
>     divide(Object o)
>     derivative(Object o)
>     a.s.o
> 3. We need to implement Excptions that are thrown for sqrt(-1) a.s.o
> 4. We need a mother class that implements all the complex derivation rules like:
>     a.s.o.
>     the sub classes the PolynomialFunction or the RationalFunction just implement their
derivation rules, but the mother class implements the complex rules to derivate a complex
structure of any type of equation by using the inner derivation rules and the complex chain
rules a.s.o

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message