Programmer Guide/Command Reference/EVAL/yint: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====yint=====
Calculates the integration of the vector ''y'' = f(''x'').
----
;Usage 1: <code>yint(<var>y<sub>vector</sub></var> {, <var>dx<sub>scalar</sub></var>=1})</code>
;Result 1: The result is the vector ''r'' with <code>nrow(''y'')</code> elements.
::<code>''r''[0]=''y''[0]*''dx''</code>
::<code>''r''[i]=''r''[i-1]+''y''[i]*''dx''; with: i=1..nrow(''y'')-1</code>
----
;Usage 2: <code>yint(<var>y<sub>vector</sub></var> , <var>dx<sub>scalar</sub></var>, <var>c<sub>scalar</sub></var>)</code>
;Result 2: The result is the vector ''r'' with <code>nrow(''y'')+1</code> elements.
::<code>''r''[0]=''c''</code>
::<code>''r''[i]=''r''[i-1]+''y''[i-1]*''dx''; with: i=1..nrow(''y'')</code>
----
;Usage 3: <code>yint(<var>y<sub>vector</sub></var>, <var>dx<sub>vector</sub></var>)</code>
;Result 3: The result is the vector ''r'' with <code>nrow(''y'')</code> elements. The argument ''dx'' contains the differences of the x values and is a vector with <code>nrow(''y'')</code> elements.
::<code>''r''[0]=''y''[0]*''dx''[0]</code>
::<code>''r''[i]=''r''[i-1]+''y''[i]*''dx''[i]; with: i=1..nrow(''y'')-1</code>
----
;Usage 4: <code>yint(<var>y<sub>vector</sub></var>, <var>dx<sub>vector</sub></var>, <var>c<sub>scalar</sub></var>)</code>
;Result 4: The result is the vector ''r'' with <code>nrow(''y'')+1</code> elements. The argument ''dx'' contains the differences of the x values and is a vector with <code>nrow(''y'')</code> elements.
::<code>''r''[0]=''c''</code>
::<code>''r''[i]=''r''[i-1]+''y''[i-1]*''dx''[i-1]; with: i=1..nrow(''y'')</code>
----
;Usage 5: <code>yint(<var>y<sub>vector</sub></var>, <var>x<sub>vector</sub></var>)</code>
;Result 5: The result is the vector ''r'' with <code>nrow(''y'')</code> elements. The argument ''x'' contains the x values and is a vector with <code>nrow(''y'')+1</code> elements.
::<code>''r''[0]=''y''[0]*(''x''[1]-''x''[0])</code>
::<code>''r''[i]=''r''[i-1]+''y''[i]*(''x''[i+1]-''x''[i]); with: i=1..nrow(''y'')-1</code>
----
;Usage 6: <code>yint(<var>y<sub>vector</sub></var>, <var>x<sub>vector</sub></var>, <var>c<sub>scalar</sub></var>)</code>
;Result 6: The result is the vector ''r'' with <code>nrow(''y'')+1</code> elements. The argument ''x'' contains the x values and is a vector with <code>nrow(''y'')+1</code> elements.
::<code>''r''[0]=''c''</code>
::<code>''r''[i]=''r''[i-1]+''y''[i-1]*(''x''[i]-''x''[i-1]); with: i=1..nrow(''y'')</code>
----
;See also: [[../ydiff|ydiff]]


Calculates the integration <code>r</code> of the vector <var>y</var> with <code>nrow(y)+1</code> elements.
[[../#Functions|<function list>]]
 
=====Usage:=====
 
<code>yint(<var>y</var>,<var>dx</var>,<var>c</var>)</code>
 
=====Parameters:=====
 
;<var>y</var>
 
:The y data vector.
 
;<var>dx</var>
 
:The x increment. If <var>dx</var> is not specified, the default value of <code>1</code> is used.
 
;<var>c</var>
 
:The start value (default = 0).
 
=====Result:=====
 
<code>r[0] =</code> <var>c</var><code>, r[i+1] = r[i] +</code> <var>y</var><code>[i]*</code><var>dx</var>
 
with: <code>i = 0</code> .. <code>nrow(y)-1</code>
 
=====Usage:=====
 
<code>yint(<var>y</var>,<var>x</var>,<var>c</var>)</code>
 
=====Parameters:=====
 
;<var>y</var>
 
:The y data vector.
 
;<var>x</var>
 
:The x data vector with <code>nrow(</code><var>y</var><code>)+1</code> elements.
 
;<var>c</var>
 
:The start value (default = 0).
 
=====Result:=====
 
<code>r[0] =</code> <var>c</var><code>, r[i+1] = r[i] +</code> <var>y</var><code>[i]*(</code><var>x</var><code>[i+1]-</code><var>x</var><code>[i])</code>
 
with: <code>i = 0</code> .. <code>nrow(</code><var>y</var><code>)-1</code>

Latest revision as of 13:23, 21 April 2011

Calculates the integration of the vector y = f(x).


Usage 1
yint(yvector {, dxscalar=1})
Result 1
The result is the vector r with nrow(y) elements.
r[0]=y[0]*dx
r[i]=r[i-1]+y[i]*dx; with: i=1..nrow(y)-1

Usage 2
yint(yvector , dxscalar, cscalar)
Result 2
The result is the vector r with nrow(y)+1 elements.
r[0]=c
r[i]=r[i-1]+y[i-1]*dx; with: i=1..nrow(y)

Usage 3
yint(yvector, dxvector)
Result 3
The result is the vector r with nrow(y) elements. The argument dx contains the differences of the x values and is a vector with nrow(y) elements.
r[0]=y[0]*dx[0]
r[i]=r[i-1]+y[i]*dx[i]; with: i=1..nrow(y)-1

Usage 4
yint(yvector, dxvector, cscalar)
Result 4
The result is the vector r with nrow(y)+1 elements. The argument dx contains the differences of the x values and is a vector with nrow(y) elements.
r[0]=c
r[i]=r[i-1]+y[i-1]*dx[i-1]; with: i=1..nrow(y)

Usage 5
yint(yvector, xvector)
Result 5
The result is the vector r with nrow(y) elements. The argument x contains the x values and is a vector with nrow(y)+1 elements.
r[0]=y[0]*(x[1]-x[0])
r[i]=r[i-1]+y[i]*(x[i+1]-x[i]); with: i=1..nrow(y)-1

Usage 6
yint(yvector, xvector, cscalar)
Result 6
The result is the vector r with nrow(y)+1 elements. The argument x contains the x values and is a vector with nrow(y)+1 elements.
r[0]=c
r[i]=r[i-1]+y[i-1]*(x[i]-x[i-1]); with: i=1..nrow(y)

See also
ydiff

<function list>

Navigation menu

Personal tools