Programmer Guide/Command Reference/EVAL/yint: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
Calculates the integration | 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 | ;Usage 1: <code>yint(<var>y<sub>vector</sub></var> {, <var>dx<sub>scalar</sub></var>=1})</code> | ||
;Result | ;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''[0]=''c''</code> | ||
::<code>''r''[i+1]=''r''[i]+''y''[i]*''dx''; with: i= | ::<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 | ;Usage 4: <code>yint(<var>y<sub>vector</sub></var>, <var>dx<sub>vector</sub></var>, <var>c<sub>scalar</sub></var>)</code> | ||
;Result | ;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''[0]=''c''</code> | ||
::<code>''r''[i | ::<code>''r''[i]=''r''[i-1]+''y''[i-1]*''dx''[i-1]; with: i=1..nrow(''y'')</code> | ||
---- | ---- | ||
;Usage | ;Usage 5: <code>yint(<var>y<sub>vector</sub></var>, <var>x<sub>vector</sub></var>)</code> | ||
;Result | ;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''[0]=''c''</code> | ||
::<code>''r''[i | ::<code>''r''[i]=''r''[i-1]+''y''[i-1]*(''x''[i]-''x''[i-1]); with: i=1..nrow(''y'')</code> | ||
---- | ---- | ||
;See also: [[ | ;See also: [[../ydiff|ydiff]] | ||
[[ | [[../#Functions|<function list>]] |
Latest revision as of 12: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 withnrow(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 withnrow(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 withnrow(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 withnrow(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