用Octave计算若干项之积的极限
广告
{{v.name}}
计算\(\displaystyle\lim_{n \to \infty} \prod_{m=2}^{n} \frac{m^3 - 1}{m^3 + 1}\)
程序代码如下
function [text_result, numeric_result] = func6(n_value)
    pkg load symbolic;
    m = sym('m');
    n = sym('n');
    unit = (m^3 - 1) / (m^3 + 1);
    question = symprod(unit, m, [2, n]);
    lim = limit(question, n, n_value);
    text_result = ["\n", disp(lim)];
    numeric_result = eval(lim);
endfunction
令\(n \to \infty\),计算结果如下
>> [text_result, numeric_result] = func6(inf)
text_result =
        ⎛3   √3⋅ⅈ⎞  ⎛3   √3⋅ⅈ⎞
    2⋅Γ⎜─ - ────⎟⋅Γ⎜─ + ────⎟
        ⎝2    2  ⎠  ⎝2    2  ⎠
    ─────────────────────────
    ⎛5   √3⋅ⅈ⎞  ⎛5   √3⋅ⅈ⎞
    Γ⎜─ - ────⎟⋅Γ⎜─ + ────⎟
    ⎝2    2  ⎠  ⎝2    2  ⎠

numeric_result = 0.6667
友链