【发布时间】:2014-04-08 10:42:07
【问题描述】:
假设在求解某个方程后需要选择真正的解。
这是正确和最佳的方法吗,还是有更好的方法?
restart;
mu := 3.986*10^5; T:= 8*60*60:
eq := T = 2*Pi*sqrt(a^3/mu):
sol := solve(eq,a);
select(x->type(x,'realcons'),[sol]);
我找不到 real 作为类型。所以我使用了realcons。一开始我是这样做的:
select(x->not(type(x,'complex')),[sol]);
这不起作用,因为在 Maple 中 5 被认为是 complex!所以最终没有解决方案。
type(5,'complex');
(* true *)
我也找不到isreal() 类型的函数。 (除非我错过了一个)
有没有更好的方法可以使用?
更新: 回答下面关于 5 在枫树中不应该是复杂的评论。
restart;
type(5,complex);
true
type(5,'complex');
true
interface(version);
Standard Worksheet Interface, Maple 18.00, Windows 7, February
来自帮助
The type(x, complex) function returns true if x is an expression of the form
a + I b, where a (if present) and b (if present) are finite and of type realcons.
【问题讨论】:
标签: maple