Apache数学优化的例子

发布于 2025-01-02 09:49:27 字数 341 浏览 4 评论 0原文

我有一个简单的优化问题,正在寻找 Java 软件来解决这个问题。

Apache 数学优化软件看起来就像我想要的,但我找不到满足我需求的文档(这些需求对初学者/非数学专业人士很有用!)

有谁知道一个有效的、简单的示例吗?

如果有帮助的话,问题是我想找到 max r

r1 = s1 * m1

r2 = s2 * m2

,其中有一些约束和公式用于定义变量之间的关系。 Excel Solver 可以很好地解决这个问题。我让 LPSolve 工作得很好,但是这个问题需要 s 和 m 的乘法,所以我知道 LPSolve 没有帮助,因为这使得问题非线性。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请别遗忘我 2025-01-09 09:49:27

我最近将无导数非线性约束优化代码 COBYLA2 移植到了 Java 中。由于它没有明确依赖导数,因此该算法可能需要多次迭代才能解决较大的问题。尽管如此,您可以使用非线性目标函数和(可能)非线性约束来制定您的问题。

您可以阅读有关它的更多信息并从此处下载源代码。

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.

心不设防 2025-01-09 09:49:27

我不知道有什么简单的基于 Java 的 NLP 求解器。 (我确实在Apache Math Works中找到了二次规划(QP)的示例,但它不符合条件,因为您要求非数学专业的示例。)

我有两个建议供您解决你的非线性程序:

1.. ExcelSolver确实有能力解决非线性问题。 (不要使用 LPSOLVE。)事实上,NLP 是 Solver 中的默认模式。

以下是使用 Excel 解决 NLP 问题的两个链接: 示例 1 - 步骤逐步解算器演练,涵盖 NLP
示例 2 - Excel 中的通用神经网络示例

对于 Excel,我喜欢 Paul Jensen 的 (utexas) ORMM 插件
他有一个名为 教授 NLP第 10 章他的书涉及 NLP,可以从他的网站获取。

2.. 如果您打算进行一定量的数据分析,那么我建议您花几个小时下载并学习 R 的基础知识
R 有许多用于优化的包和库optim()nlme 与求解非线性程序相关。

为了完整起见,我将 SASMATLABCPLEX 作为其他选项。如果您能够访问其中任何一个,它们都可以很好地解决非线性程序。

希望这些指示有所帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文