You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Phil Steitz <ph...@steitz.com> on 2003/05/31 08:31:48 UTC

[math] Solving equations without functions -- "bean equations"

It occurs to me now that we might be able to support an alternative 
"bean-oriented" interface for rootfinding by using bean introspection. 
Using BeanUtils' MethodUtils and PropertyUtils, we should be able to 
support solving "bean equations", roughly as as in the following example:

double breakEven = 
beanSolver.solve(revenueBean,"estimateRevenue",costBean,"constraint",lower,upper);

The idea here is that we solve the "bean equation"

    revenueBean.estimateRevenue(x) = costBean.getConstraint();

for x, using lower and upper as initial brackets.  We could of course 
allow just one initial value as well and expand it to a bracket.  I 
suppose that we could also solve

    revenueBean.estimateRevenue(x) = costBean.getConstraint(x);

but we would obviously need a way to distinguish these. I have not 
actually implemented any of this, so I might be missing something 
crucial; but it seems to me that we should be able to dynamically 
construct the equivalent of a RealUnivariateFunction to use in 
rootfinding by using method and property introspection on the beans.

The more I think about it, the more I think that Tim's idea of using 
BeanUtils to enable math functionality for beans without forcing the 
beans to implement special interfaces is going to be very important to us.

Just as I think we still need to provide the array-based Univariate 
implementations, along with BeanListUnivariateImpl, I think we still 
need to provide the RealUnivariateFunction interface as well for 
rootfinding, for the applications that fit more nicely into that 
structure or for the users who are squeamish about so much introspection 
(almost never an real issue, but often a religious one). I suspect that 
the bean-oriented interface would be more convenient to use, however, 
for many applications.

Thoughts? Does this make sense? Am I missing something obvious? I will 
play with it a little once we have the core rootfinding framework in place.

Phil


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org