用Octave求三重积分
广告
{{v.name}}
设\(\Omega=\{(x, y, z)|(x, y)\in D, (x+y)\leq z\leq (x+y)^3\}\),设\(D=\{(x, y)|1\leq x\leq10, {\rm ln}x\leq y\leq x^3\}\),求\(\iiint_{\Omega}{(x^2+y^2+z^2)}{\rm d}x{\rm d}y{\rm d}z\).
程序代码如下
function [text_result, numeric_result] = func82()
    pkg load symbolic;
    x = sym('x');
    y = sym('y');
    z = sym('z');
    result = x^2 + y^2 + z^2;
    % result = int(result, z, log(x + y), (x + y)^3);
    result = int(result, z, x + y, (x + y)^3);
    result = int(result, y, log(x), x^3);
    result = int(result, x, 1, 10);
    text_result = ["\n", disp(result)];
    numeric_result = eval(result);
endfunction
结果如下
>> [text_result, numeric_result] = func82()
text_result =
                       2                                                3                    4                   5 ↪
      4783622525525⋅log (10)    399208553515591⋅log(10)   50763562495⋅log (10)    487172945⋅log (10)   11206060⋅log (10) ↪
    - ────────────────────── - ─────────────────────── - ──────────────────── - ────────────────── - ───────────────── ↪
            31752                    1333584                   1134                   54                   9 ↪

    ↪               6                7                            9          10 ↪
    ↪    1136185⋅log (10)    26180⋅log (10)          8       40⋅log (10)   log  (10)   11846982568338335428134810034100 ↪
    ↪  - ──────────────── - ────────────── - 455⋅log (10) - ─────────── - ───────── + ──────────────────────────────── ↪
    ↪           9                 3                              3            3                     990608372850096000 ↪

    ↪
    ↪ 255843899376745277
    ↪ ──────────────────
    ↪ 000

numeric_result = 1.1959e+28
友链