使用 R 求解方程

编程入门 行业动态 更新时间:2024-10-12 03:17:50
本文介绍了使用 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 和许多其他包,可以使用网络浏览器界面执行您想要的操作.该网站是 www.sagemath/

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 www.sagemath/

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

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

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

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 求解方程

本文发布于:2023-11-29 18:38:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1647267.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方程

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!