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 |
||
Line 3: | Line 3: | ||
---- | ---- | ||
;Usage 1: <code>yint(<var>y<sub>vector</sub></var> {, <var>dx<sub>scalar</sub></var>=1})</code> | ;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''[0]=''y''[0]*''dx''</code> | ||
::<code>''r''[i]=''r''[i-1]+''y''[i]*''dx''; with: i=1..nrow(''y'')-1</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> | ;Usage 2: <code>yint(<var>y<sub>vector</sub></var> , <var>dx<sub>scalar</sub></var>, <var>c<sub>scalar</sub></var>)</code> | ||
;Result | ;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]=''r''[i-1]+''y''[i-1]*''dx''; with: i=1..nrow(''y'')</code> | ::<code>''r''[i]=''r''[i-1]+''y''[i-1]*''dx''; with: i=1..nrow(''y'')</code> | ||
Line 27: | Line 27: | ||
::<code>''r''[i]=''r''[i-1]+''y''[i]*(''x''[i+1]-''x''[i]); with: i=1..nrow(''y'')-1</code> | ::<code>''r''[i]=''r''[i-1]+''y''[i]*(''x''[i+1]-''x''[i]); with: i=1..nrow(''y'')-1</code> | ||
---- | ---- | ||
;Usage | ;Usage 6: <code>yint(<var>y<sub>vector</sub></var>, <var>x<sub>vector</sub></var>, <var>c<sub>scalar</sub></var>)</code> | ||
;Result | ;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]=''r''[i-1]+''y''[i-1]*(''x''[i]-''x''[i-1]); with: i=1..nrow(''y'')</code> | ::<code>''r''[i]=''r''[i-1]+''y''[i-1]*(''x''[i]-''x''[i-1]); with: i=1..nrow(''y'')</code> |
Revision as of 08:34, 13 April 2011
Calculates the integration (differnce quotients) 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