<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><tt>Hello,</tt></p>
    <p><tt>You can use intg, once you have forged the correct function
        of the parameter:</tt></p>
    <div class="moz-cite-prefix">
      <pre style="font-style: normal; font-size: 12px;"><span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(131,67,16);font-weight:bold;">out</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);text-decoration:underline;">parabola</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">t</span><span style="color:rgb(74,85,219);">)</span>
    <span style="color:rgb(131,67,16);font-weight:bold;">out</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(131,67,16);font-weight:bold;">t</span><span style="color:rgb(92,92,92);">/</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(0,0,0);">;</span><span style="color:rgb(131,67,16);font-weight:bold;">t</span><span style="color:rgb(92,92,92);">^</span><span style="color:rgb(188,143,143);">2</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(176,24,19);">endfunction</span>

<span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(131,67,16);font-weight:bold;">out</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);text-decoration:underline;">my_f</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">M</span><span style="color:rgb(74,85,219);">)</span>
    <span style="color:rgb(131,67,16);font-weight:bold;">out</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">2</span><span style="color:rgb(92,92,92);">*</span><span style="color:rgb(131,67,16);font-weight:bold;">M</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(176,24,19);">endfunction</span>

<span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(131,67,16);font-weight:bold;">out</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);text-decoration:underline;">line_int</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">a</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">b</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">curve</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">f</span><span style="color:rgb(74,85,219);">)</span>
    <span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(131,67,16);font-weight:bold;">out</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);text-decoration:underline;">fun</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">t</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">f</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">curve</span><span style="color:rgb(74,85,219);">)</span>
        <span style="color:rgb(0,0,0);">dcurve</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">imag</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">curve</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">t</span><span style="color:rgb(92,92,92);">+</span><span style="color:rgb(218,112,214);">%eps</span><span style="color:rgb(92,92,92);">*</span><span style="color:rgb(218,112,214);">%i</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">/</span><span style="color:rgb(218,112,214);">%eps</span><span style="color:rgb(0,0,0);">;</span>
        <span style="color:rgb(131,67,16);font-weight:bold;">out</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(131,67,16);font-weight:bold;">f</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">curve</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">t</span><span style="color:rgb(74,85,219);">))</span><span style="color:rgb(92,92,92);">*</span><span style="color:rgb(50,185,185);">norm</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">dcurve</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);"></span>
     <span style="color:rgb(160,32,240);">end</span>
     <span style="color:rgb(131,67,16);font-weight:bold;">out</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">intg</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">a</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(131,67,16);font-weight:bold;">b</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(50,185,185);">list</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);text-decoration:underline;">fun</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(131,67,16);font-weight:bold;">f</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(131,67,16);font-weight:bold;">curve</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(176,24,19);">endfunction</span>
<span style="color:rgb(74,85,219);">
</span></pre>
    </div>
    <div class="moz-cite-prefix"><tt>--> line_int(0,6,parabola,my_f)<br>
         ans  =<br>
        <br>
           144.36474604669</tt></div>
    <div class="moz-cite-prefix"><tt><br>
      </tt></div>
    <div class="moz-cite-prefix"><tt>The derivative of the curve w.r.t.
        the parameter is computed by using the complex step.</tt></div>
    <div class="moz-cite-prefix"><tt><br>
      </tt></div>
    <div class="moz-cite-prefix"><tt>S.<br>
      </tt></div>
    <div class="moz-cite-prefix"><tt><br>
      </tt></div>
    <div class="moz-cite-prefix"><tt>Le 25/02/2020 à 10:35, arctica1963
        a écrit :</tt><tt><br>
      </tt></div>
    <blockquote type="cite"
      cite="mid:1582623308328-0.post@n3.nabble.com">
      <pre class="moz-quote-pre" wrap="">Hello all,

I am interested in doing line integrals on f(x,y) and f(x,y,z) for scalar
and vector calculations.

It is not an issue to do mathematically, but not so clear in Scilab how
variable substitution should work in this process. As I understand it, one
has to take the function and convert it to a parametric form in x,y,(z) in
order to reduce the integrand to a single variable (e.g. t) that can be
integrated simply.

Now, clearly it is not a problem to do the substitutions by hand and then
run the Scilab function (Integrate), but nice to simplify the procedure.

For the integral over a path (C) of f(x,y) ds, x and y have to be parametric
e.g. x(t) and y(t),
where ds = sqrt( (dx(t)/dt)^2 + (dy(t)/dt)^2 ) dt

Is there a simple route to solve line integrals in Scilab or building a
function to do this? 
e.g. LineIntegral(expr,x(t),y(t),t,a,b), where x(t) and y(t) are the
parametric forms.

A very simple problem:

f(x,y) = 2*x with x(t)=t/2 and y(t)=t^2 for t=0 to 6
Substitution for x and y and solving the integral over t should result in
144.36 approx.

Any pointers would be useful. Could not see any reference in the mailing
list or help on this.

Thanks
Lester



--
Sent from: <a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html</a>
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet">http://www.utc.fr/~mottelet</a>
</pre>
  </body>
</html>