求助,如何定义变量类型为 正奇数。
mathematica吧
全部回复
仅看楼主
level 9
ID0577775606 楼主
如图,图中把n定义成整数了,如何定义成为正奇数,试过2n-1,数列什么的,输出都是奇奇怪怪的,最后答案也是Sqrt[1/a]。
ClearAll[n];
f[x_] := Cos[(n*Pi*x)/(2*a)];
A = Assuming[
n \[Element] Integers &&
a \[Element] Reals, {Sqrt[1/Integrate[(f[x])^2, {x, -a, a}]]}]
2015年10月29日 10点10分 1
吧务
level 15
这样?:
Clear[n, x, a, f];
f[x_, n_] = Cos[(n Pi x)/(2 a)];
Assuming[n ∈ Integers && a ∈ Reals && n >= 1, Sqrt[1/Integrate[(f[x, 2 n - 1])^2, {x, -a, a}]]]
2015年11月07日 10点11分 2
level 3
$Assumptions = n \[Element] PositiveIntegers && Mod[n, 2] == 1
2021年06月28日 07点06分 3
1