<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 02/04/2021 à 12:53, arctica1963 a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:1617360822330-0.post@n3.nabble.com">
<pre class="moz-quote-pre" wrap="">Hi Stephane,
At the moment I am just trying to understand how Scilab works with triple
integration of f(x,y,z) with limits for xyz. </pre>
</blockquote>
<p>Ok, when you say "limits" for xyz you mean that each variable
varies in a given constant interval, that's what I meant by the
rectangular parallelepiped [x1,x2] x [y1,y2] x [z1,z2]. In fact it
is a pity that Scilab does not handle this case but only the more
general case of a collection of (eventually disconnected)
tetrahedrons. However, cutting your parallepiped in 5
(<a class="moz-txt-link-freetext" href="https://www.geogebra.org/m/C3TjXxFY">https://www.geogebra.org/m/C3TjXxFY</a>) is enough to use int3d,
since they will be recursively divided to attain the required
precision:</p>
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="color:rgb(0,0,0);">deff</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">v=f(xyz,numfun)</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">v=xyz(1)^2+xyz(2)^2+xyz(3)^2</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">xlim</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">0</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(0,0,0);">ylim</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">0</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(0,0,0);">zlim</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">0</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(74,85,219);">[</span><span style="color:rgb(0,0,0);">x</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">y</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">z</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);">ndgrid</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">xlim</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">ylim</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">zlim</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">i</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">5</span> <span style="color:rgb(188,143,143);">8</span> <span style="color:rgb(188,143,143);">2</span> <span style="color:rgb(188,143,143);">3</span>
<span style="color:rgb(188,143,143);">5</span> <span style="color:rgb(188,143,143);">8</span> <span style="color:rgb(188,143,143);">2</span> <span style="color:rgb(188,143,143);">6</span>
<span style="color:rgb(188,143,143);">5</span> <span style="color:rgb(188,143,143);">8</span> <span style="color:rgb(188,143,143);">3</span> <span style="color:rgb(188,143,143);">7</span>
<span style="color:rgb(188,143,143);">5</span> <span style="color:rgb(188,143,143);">2</span> <span style="color:rgb(188,143,143);">3</span> <span style="color:rgb(188,143,143);">1</span>
<span style="color:rgb(188,143,143);">2</span> <span style="color:rgb(188,143,143);">3</span> <span style="color:rgb(188,143,143);">8</span> <span style="color:rgb(188,143,143);">4</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(92,92,92);">'</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(74,85,219);">[</span><span style="color:rgb(0,0,0);">result</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">err</span><span style="color:rgb(74,85,219);">]</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(50,185,185);">int3d</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">x</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">y</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">z</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">f</span><span style="color:rgb(74,85,219);">)
--> result
result =
1.0000000
--> err
err =
1.110D-14
</span></pre>
<p>S.<br>
</p>
<blockquote type="cite"
cite="mid:1617360822330-0.post@n3.nabble.com">
<pre class="moz-quote-pre" wrap="">
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>