当前位置: 动力学知识库 > 问答 > 编程问答 >

wolfram mathematica - Assist "Solve[]" by Providing Variable Ranges

问题描述:

I am trying to solve a system of equations (5 unknown variables, 5 equations) but the Solve[] function just hangs and I have to abort the evaluation. I can understand as some of the equations are quite messy-- in my opinion at least (I'm not a mathematician).

I checked the equations used in Solve[] by substituting in "known/true" simulation values and they all work out.

So, my question is this: Is it possible to "help" Solve[] by saying, for example...

Solve[{eq1, eq2, eq3, eq4, eq5},{var1, var2, var3, var4, var5}, (*code here along the lines of { 0 < var1 < 10, var2 < 25, ...}*)]

I can provide more information if it would be of assistance.

Thanks!

网友答案:

The program Mathematica provides actually very simple solution inside the function Solve[]. You can add all kind of desired conditions as inequalities ConditionOnVar1, ConditionOnVar1:

Solve[{Eq1, Eq2, ConditionOnVar1, ConditionOnVar2},{Var1, Var2}]

Trivial 1D Example

Solve[Cos[theta]==1 && theta >= 0 && theta < 2\[Pi], theta]
分享给朋友:
您可能感兴趣的文章:
随机阅读: