用Octave求弧微分(2)
广告
{{v.name}}
弧微分公式(2)
设\( L:\cases{ x=\phi(t) \\ y=\psi(t) } (t \in [a,b])\),则\(ds=\sqrt{\phi'^{2} (t) + \psi'^{2} (t)}dt\)
求\( \cases{ x=sin(t) \\ y=cos(t) }(t \in [1,2]) \)的弧长.
程序代码如下
function [text_result, numeric_result] = func49(limit1, limit2)
    pkg load symbolic;
    t = sym('t');
    x = sin(t);
    y = cos(t);
    d = sqrt(power(diff(x, t), 2) + power(diff(y, t), 2));
    result = int(d, t, [limit1, limit2]);
    text_result = ["\n", disp(result)];
    numeric_result = eval(result);
endfunction
结果如下
>> [text_result, numeric_result] = func49(1,2)
text_result =
         ___________________        ___________________
        ╱    2         2           ╱    2         2
    - ╲╱  cos (1) + sin (1)  + 2⋅╲╱  cos (2) + sin (2)

numeric_result = 1
友链