您如何在PHP中求解方程式? [英] How can you solve equations in PHP?

查看:323
本文介绍了您如何在PHP中求解方程式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找PHP中的广义方程求解器.这可以是内置功能,库的形式,甚至可以是与另一种语言集成的形式.我什至对涉及以上内容的联合解决方案感到满意.我需要在我正在工作的教育网站上使用它.

I'm looking for a generalized equation solver in PHP. This could either be in the form of in-built functionality, a library, or even integration with another language if it comes to it. I am even comfortable with a joint solution that involves some combination of the above. I need this for an educational website on which I am working.

让我给出一系列方程,我理想地希望这样的求解器能够处理:

Let me give a series of equations that I would ideally expect such a solver to deal with:

x+5=8 => x=3
x^2=5 => x=+/-sqrt(5) [exact solution in terms of sqrt, ln, or whatever] AND
         x=+/-2.236 [approximate solution to certain number of digits]
x+y=-3 [solve in terms of y] => y=-x-3
x^2=-5 => x=+/5i
x+y=3 and x-y=3 => x=3, y=0

我希望这不是一座桥梁.如果是这样,我会在每个问题都内部解决时就构建功能,但是如果有人知道适合此类问题的库,我将不胜感激.

I hope this is not a bridge too far. If so, I'll build the functionality as each problem comes in-house, but if anyone knows of the proper library for such a set of problems, I would greatly appreciate it.

推荐答案

从其网站上查看 Sage :

Sage是根据GPL许可的免费开源数学软件系统.它将许多现有的开放源代码软件包的功能组合到基于Python的通用界面中. 任务:创建可行的免费开源替代Magma,Maple,Mathematica和Matlab.

Sage is a free open-source mathematics software system licensed under the GPL. It combines the power of many existing open-source packages into a common Python-based interface. Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab.

Sage具有基于AJAX的笔记本界面 ,这可能与您可以从PHP使用的API一样好.

Sage has an AJAX-based notebook interface, that is probably as good as an API that you can use from PHP.

这篇关于您如何在PHP中求解方程式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆