I spotted the Kelvin conversion problem too :)<br><br>Cheers<br><br>Lester<br><br><div class="gmail_quote">On 13 December 2012 09:38, Serge Steer <span dir="ltr"><<a href="mailto:Serge.Steer@inria.fr" target="_blank">Serge.Steer@inria.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Le 13/12/2012 07:56, Lester Anderson a
écrit :<br>
</div><div class="im">
<blockquote type="cite">Hi Serge<br>
<br>
A quick question. In the context of the equation, what is the
purpose of the ones(t) part? The help states that this creates a
matrix composed of ones.<br>
</blockquote>
<br>
</div><pre style="font-family:Monospaced;font-style:normal;font-size:14.0"><span style="color:rgb(74,85,219)">(</span><span>B</span><span style="color:rgb(92,92,92)">./</span><span style="color:rgb(74,85,219)">(</span><span>m1</span><span style="color:rgb(92,92,92)">.^</span><span style="color:rgb(188,143,143)">3</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(218,112,214)">%pi</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(92,92,92)">.*</span><span style="color:rgb(50,185,185)">sin</span><span style="color:rgb(74,85,219)">(</span><span>m1</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(218,112,214)">%pi</span><span style="color:rgb(92,92,92)">/</span><span>B</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">) is a column vector, the multiplication by ones(t) which is a row vector is a way to create a matrix with identical columns
. Ina similar manner </span><span>m1</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>t</span><span style="color:rgb(92,92,92)"></span>
creates a matrix multiplying the column vector <span style="color:rgb(74,85,219)"></span><span>m1</span><span style="color:rgb(92,92,92)">.^</span><span style="color:rgb(188,143,143)">2</span> by the row vector t<span style="color:rgb(92,92,92)"></span></pre>
<div><div class="h5">
<blockquote type="cite">
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0"><span>g</span><span style="color:rgb(92,92,92)">=</span><span>c</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(50,185,185)">sum</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(74,85,219)">(</span><span>B</span><span style="color:rgb(92,92,92)">./</span><span style="color:rgb(74,85,219)">(</span><span>m1</span><span style="color:rgb(92,92,92)">.^</span><span style="color:rgb(188,143,143)">3</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(218,112,214)">%pi</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(92,92,92)">.*</span><span style="color:rgb(50,185,185)">sin</span><span style="color:rgb(74,85,219)">(</span><span>m1</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(218,112,214)">%pi</span><span style="color:rgb(92,92,92)">/</span><span>B</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(50,185,185)">ones</span><span style="color:rgb(74,85,219)">(</span><span>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)">exp</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(92,92,92)">-</span><span style="color:rgb(74,85,219)">(</span><span>m1</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>t</span><span style="color:rgb(92,92,92)">/</span><span>tau</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span>,</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(74,85,219)">)</span><span>;</span></pre>
Probabaly a very simple answer.<br>
<br>
Cheers<br>
<br>
Lester<br>
<br>
<div class="gmail_quote">On 12 December 2012 22:46, Lester
Anderson <span dir="ltr"><<a href="mailto:arctica1963@gmail.com" target="_blank">arctica1963@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Many thanks
Serge :) That worked great!<br>
Helps to see how the syntax should work.<br>
<br>
Cheers<span><font color="#888888"><br>
<br>
Lester</font></span>
<div>
<div><br>
<br>
<div class="gmail_quote">On 12 December 2012 22:29, Serge
Steer <span dir="ltr"><<a href="mailto:serge.steer@inria.fr" target="_blank">serge.steer@inria.fr</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="font-size:12pt;font-family:times new roman,new york,times,serif">
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0"><span>I think the following code fullfil your wish...
n</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">0</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(188,143,143)">20</span> <span>;</span><span style="color:rgb(1,168,1);font-style:italic">// series in the expansion</span>
<span>B</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">1.5</span><span>;</span> <span style="color:rgb(1,168,1);font-style:italic">//beta factor</span>
<span>Tm</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">1300</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(188,143,143)">274.15</span><span>;</span> <span style="color:rgb(1,168,1);font-style:italic">//base-lithosphere temperature [C]</span>
<span>tau</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">62.8</span><span>;</span> <span style="color:rgb(1,168,1);font-style:italic">//lithosphere cooling thermal decay constant [Ma]</span>
<span>a</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">125000</span><span>;</span> <span style="color:rgb(1,168,1);font-style:italic">//equilibrium lithospheric thickness [m]</span>
<span>alpha</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">3.28e-5</span> <span>;</span><span style="color:rgb(1,168,1);font-style:italic">//thermal expansion coefficient K^-1</span>
<span style="color:rgb(1,168,1);font-style:italic">// Tm needs to be converted to Kelvin - multiply by 274.15</span>
<span>rho</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">3300</span><span>;</span>
<span>t</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">0</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(188,143,143)">5</span><span style="color:rgb(255,170,0)">:</span><span style="color:rgb(188,143,143)">150</span><span>;</span> <span style="color:rgb(1,168,1);font-style:italic">//lithosphere age [Ma]</span>
<span>G</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(188,143,143)">6.67e-11</span><span>;</span>
<span style="color:rgb(1,168,1);font-style:italic">// LTGA with increasing age of oceanic lithosphere</span>
<span>c</span><span style="color:rgb(92,92,92)">=</span><span style="color:rgb(188,143,143)">8</span><span style="color:rgb(92,92,92)">*</span><span>G</span><span style="color:rgb(92,92,92)">*</span><span>alpha</span><span style="color:rgb(92,92,92)">*</span><span>rho</span><span style="color:rgb(92,92,92)">*</span><span>a</span><span style="color:rgb(92,92,92)">*</span><span>Tm</span><span style="color:rgb(92,92,92)">/</span><span style="color:rgb(218,112,214)">%pi</span><span>;</span>
<span>m</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(255,170,0)">:</span><span style="color:rgb(188,143,143)">20</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(92,92,92)">'</span><span>;</span><span>m1</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>m</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">1</span><span>;</span>
<span>g</span><span style="color:rgb(92,92,92)">=</span><span>c</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(50,185,185)">sum</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(74,85,219)">(</span><span>B</span><span style="color:rgb(92,92,92)">./</span><span style="color:rgb(74,85,219)">(</span><span>m1</span><span style="color:rgb(92,92,92)">.^</span><span style="color:rgb(188,143,143)">3</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(218,112,214)">%pi</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(92,92,92)">.*</span><span style="color:rgb(50,185,185)">sin</span><span style="color:rgb(74,85,219)">(</span><span>m1</span><span style="color:rgb(92,92,92)">*</span><span style="color:rgb(218,112,214)">%pi</span><span style="color:rgb(92,92,92)">/</span><span>B</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(50,185,185)">ones</span><span style="color:rgb(74,85,219)">(</span><span>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)">exp</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(92,92,92)">-</span><span style="color:rgb(74,85,219)">(</span><span>m1</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>t</span><span style="color:rgb(92,92,92)">/</span><span>tau</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(74,85,219)">)</span><span>,</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(74,85,219)">)</span><span>;</span>
<span style="color:rgb(174,92,176);text-decoration:underline">clf</span><span>;</span><span style="color:rgb(174,92,176);text-decoration:underline">plot</span><span style="color:rgb(74,85,219)">(</span><span>t</span><span>,</span><span>g</span><span style="color:rgb(74,85,219)">)</span></pre>
<br>
Serge Steer<br>
<hr>
<blockquote style="padding-left:5px;font-size:12pt;font-style:normal;margin-left:5px;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal;border-left:2px solid rgb(16,16,255)">
<b>De: </b>"Lester Anderson" <<a href="mailto:arctica1963@gmail.com" target="_blank">arctica1963@gmail.com</a>><br>
<b>À: </b>"International users mailing list for
Scilab." <<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>><br>
<b>Envoyé: </b>Mardi 11 Décembre 2012 08:16:01<br>
<b>Objet: </b>[Scilab-users] Summation query in
Scilab
<div>
<div><br>
<br>
Hello,<br>
<br>
I have an equation structured like in the
attached, however I am unsure of the correct
syntax to compute in Scilab.<br>
<br>
One can calculate the first term of the
expansion but obvioulsy it needs to go to a
large number (approximating infinity eg 20).<br>
I am sure this is something very
straightforward!<br>
<br>
Any ideas welcome.<br>
<br>
Thanks for the help<br>
<br>
Lester<br>
<br>
att: image of equation, test code<br>
<br>
</div>
</div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote>
<br>
</div>
</div>
<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br>