Ribeye
Ribeye

Reputation: 2177

Examples of apache math optimization

I have a simple optimization problem and am looking for java software for that.

The Apache math optimization software looks just like what I want but I cant find documentation to suit my needs (where those needs are to useful to a beginner / non maths professional!)

Does anyone know of a worked, simple, example?

In case it helps, the problem is that I want to find the max r where

r1 = s1 * m1

r2 = s2 * m2

and there are some constraints and formula for defining the relationship between the variables. The Excel Solver works fine for this problem. I got LPSolve working great, but this problem requires a multiplication of s and m, so I understand LPSolve cant help as this makes the problem non linear.

Upvotes: 1

Views: 1963

Answers (2)

Anders Gustafsson
Anders Gustafsson

Reputation: 15971

I recently ported the derivative-free non-linear constrained optimization code COBYLA2 to Java. Since it does not explicitly rely on derivatives, the algorithm may require quite a few iterations for larger problems. Nonetheless, you are able to formulate your problem with both a non-linear objective function and (potentially) non-linear constraints.

You can read more about it and download the source code from here.

Upvotes: 1

Ram Narasimhan
Ram Narasimhan

Reputation: 22496

I am not aware of a simple Java-based NLP solver. (I did find an example of Quadratic programming (QP) in Apache Math Works, but it doesn't qualify since you asked for a non-math professional example.)

I have two suggestions for you to solve your non-linear program:

1.. Excel's Solver does have the ability to tackle non-linear problems. (Don't use LPSOLVE.) In fact, NLP is the default mode in Solver.

Here are two links to using Excel to solve NLPs: Example 1 - Step by step Solver walk-through that covers NLP and Example 2 - A General Neural network example in Excel

Also for Excel, I like Paul Jensen's (utexas) ORMM Add-in's. He has a module called Teach NLP. Chapter 10 of his book deals with NLP and is available from his site.

2.. If you are going to be doing even some amount of data analysis, then I recommend investing a few hours to download and learn the basics of R. R has numerous packages and libraries for optimization. optim() and nlme are relavant for solving non-linear programs.

Just for completeness, I mention SAS, MATLAB and CPLEX as other options. If you have access to any of these, they all do a very good job with solving non-linear programs.

Hope these pointers help.

Upvotes: 0

Related Questions