使用 R 求解方程 [英] Using R to solve equations

查看:66
本文介绍了使用 R 求解方程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在 R 中以数值方式求解以下形式的方程的根:

How might I solve for the roots of an equation of the following form numerically in R:

f(r)=r*c+1-B*c-exp(-M(B-r))

其中 M、B 和 c 是已知常数.

Where M, B and c are known constants.

提前致谢.

推荐答案

由于 R 无法完成此功能,您可能需要使用像 Sage 这样的超集包.Sage 包含 R 和许多其他包,可以使用网络浏览器界面执行您想要的操作.该网站是 http://www.sagemath.org/

Since R can not do this functionality you might want to use a superset package like Sage. Sage includes R and many other packages and can do what you want using a webbrowser interface. The site is http://www.sagemath.org/

示例位于:http://www.sagemath.org/doc/reference/sage/symbolic/relation.html

您可以尝试以下内容:http://www.sagenb.org/>

You can try stuff like the following at: http://www.sagenb.org/

var('r', 'c', 'B', 'M')
f = r*c+1-B*c-exp(-M(B-r))
print solve(f, r)

这样做的结果是:

r == (B*c + e^(-B + r) - 1)/c

r == (B*c + e^(-B + r) - 1)/c

这篇关于使用 R 求解方程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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