我需要将变量描述为正数。 它用作分段函数中的参数,并且根据定义它是正数,但我不知道如何将其设置为未知正数。我需要像c ++中的unsigned一样,但是对于Maple。 有什么建议吗?
UPD:
例如: 我做了一些评估并得到了结果:
piecewise(h <= 0, 0, 0 < h, (1/3)*h) (1)
但由于某些原因,h> 0,所以我想简化(1)。如何将其设置为Maple?
答案 0 :(得分:3)
你不清楚自己想要什么,因为你用松散的术语描述了这个问题。你是什么意思,在技术上的Maple意义上,通过“描述”在这里?和“功能”?
f:=proc(x::positive) if x>1 then y else z end if end proc:
f(4);
y
f(-4);
Error, invalid input: f expects its 1st argument, x, to be of type positive,
but received -4
根据帖子的更新:也许你想要这样的东西,
f:=piecewise(h <= 0, 0, 0 < h, (1/3)*h):
simplify(f) assuming h>0;
1
- h
3
答案 1 :(得分:1)
要向Maple表明该值为正数,请使用
assume(h>0);