Mathematica:如何使用具有多个参数的单个方程来计算任何参数
目前,我使用具有已知/未知参数的不同组合的单个方程。由于我没有任何花哨的计算器,因此在 Mathematica 中定义方程并传递已知参数来计算未知值会容易得多。
如果你们中的任何人都可以给出示例解决方案(如果可能的话使用给定的方程),我将非常感激。
假设我们有椭圆轨道上给定点的卫星速度方程:
v = sqrt(u(2/r - 1/a))
其中
v = 速度 u = 常数 3.986 * 10^14 m^3/s^2 r = 半径(距地球中心的距离) a = 椭圆的半长轴
该方程可用于计算速度,或者例如我们知道将货物移动到其他轨道所需的速度,并且必须在给定半径( r)
谢谢!
Currently I use a single equation with different combination of known/unknown parameters. As I don't have any fancy calculator it would be much easier to define the equation in Mathematica and passing known parameters to calculate unknown values.
I would be very thankful if anyone of you could give an example solution (if possible using given equation).
Let's say we have an equation of satellite speed at given point in the elliptical orbit:
v = sqrt(u(2/r - 1/a))
where
v = speed
u = constant 3.986 * 10^14 m^3/s^2
r = radius (distance from the center of the Earth)
a = semi major axis of the ellipse
This equation can be used to calculate the speed or for example we know what is the speed needed for a manoeuvre to move the cargo to other orbit and have to model the orbit (a) at given radius (r)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用“:=”运算符在 Mathematica 中定义方程。定义示例方程:
我不确定如何推广它来解决任何未知数......如果我弄清楚了,我会回复你。
您可能想尝试类似的方法:
假设您知道 v、u 和 a,这将求解 r...然后您可以更改未知的每个参数...
You can define equations in Mathematica using the ":=" operator. To define the example equation:
I'm not sure how to generalize it to solve for any unknown...If I figure it out I'll get back to you.
You may want to try something like:
that will solve for r assuming you know v, u, and a... you can then change each of the paramaters for the unknown...
有点晚了:) ...但是Reduce[] 做了你想要的。我们定义一个函数:
并使用任何有效的分配组合来调用它。例如:
输出为:
HTH! ...
A little bit late :) ... but Reduce[] does what you want. We define a function:
and invoke it with any valid combination for the assignments. For example:
The output is :
HTH! ...