diff options
author | nutricato | 2009-07-07 14:41:59 +0000 |
---|---|---|
committer | nutricato | 2009-07-07 14:41:59 +0000 |
commit | 0b992f0195b8d0abe9f74ac3d9294d1b1c14c44b (patch) | |
tree | 8987ca0c33af5eabaea9bd5f317413557c617954 /tests/unit_tests/test9999_WorkingDir/scilabcode | |
parent | a484e92e9ca595b25036c11d6b259ba98ee1765c (diff) | |
download | scilab2c-0b992f0195b8d0abe9f74ac3d9294d1b1c14c44b.tar.gz scilab2c-0b992f0195b8d0abe9f74ac3d9294d1b1c14c44b.tar.bz2 scilab2c-0b992f0195b8d0abe9f74ac3d9294d1b1c14c44b.zip |
Diffstat (limited to 'tests/unit_tests/test9999_WorkingDir/scilabcode')
-rw-r--r-- | tests/unit_tests/test9999_WorkingDir/scilabcode/mainfunction.sci | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/tests/unit_tests/test9999_WorkingDir/scilabcode/mainfunction.sci b/tests/unit_tests/test9999_WorkingDir/scilabcode/mainfunction.sci index afea60c6..5e2a7728 100644 --- a/tests/unit_tests/test9999_WorkingDir/scilabcode/mainfunction.sci +++ b/tests/unit_tests/test9999_WorkingDir/scilabcode/mainfunction.sci @@ -1,16 +1,49 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE
function mainfunction()
// ---------------------------------------
-// --- Initialization of the operands. ---
+// --- Initialization of the parameters. ---
// ---------------------------------------
+ + +// ---------------------------------------
+// --- Set number of point for quadrature . +// --- interval for quadrature [a,b]
+// ---------------------------------------
+ + + +Np =10 // number of point for quadrature +a=1 +b=5
+ + +// ---------------------------------------
+// --- Compute Legendre-Gauss-Lobatto nodes, weights +//. ---In standard [-1 1] interval
+// --------------------------------------- + +[x,w]=lglnodes(Np); +disp('x'); +disp(x); +disp('w'); +disp(w); +// ---------------------------------------
+// --- Compute the nodes +//. ---In [a,b] pick a t points in the +// --- desired interval +// ------------------------------------- + +t=((b-a)./2)*x+(b+a)./2; + + + +Iab=((b-a)./2)*mysum(w.*Fint(t),11); + +disp('Number of nodes for quadrature '); +disp(Np) +disp('Integral value in [a b] with Np points');
+disp(Iab)
-v1 = zeros(1,5);
-disp('v1, before initialization.')
-disp(v1)
-for cnt = 1:5
- v1(cnt) = cnt;
-end
-disp('v1, after initialization.')
-disp(v1)
endfunction
|