doc:user:general:fonctions
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:user:general:fonctions [2015/01/07 14:52] – boman | doc:user:general:fonctions [2025/04/04 13:57] (current) – [PieceWiseLinearFunction] papeleux | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Functions ====== | + | |
| + | ====== Functions | ||
| - | Functions are quite useful to describe how some parameters evolve, over time for example. They can be used to [[doc: | + | Functions are quite useful to describe how some parameters evolve, over time for example. They can be used to [[doc: |
| ===== PieceWiseLinearFunction ===== | ===== PieceWiseLinearFunction ===== | ||
| Line 21: | Line 22: | ||
| __Remark:__ As can be seen above, the first and last segments are extrapolated if a value of the function is required outside its domain. | __Remark:__ As can be seen above, the first and last segments are extrapolated if a value of the function is required outside its domain. | ||
| + | |||
| + | <note important> | ||
| + | Data must be defined in a STRICTLY increasing abcissae order ... | ||
| + | AND at least 2 points has to be defined... | ||
| + | </ | ||
| + | |||
| + | ===== CyclicPieceWiseLinearFunction ===== | ||
| + | The '' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | 2 constrains are applied on Data : | ||
| + | - the first abcisse must be equal to 0.0 (abs1 = 0.0) | ||
| + | - the cycle must be closed (ord1 = ordLast) | ||
| ===== PythonOneParameterFunction ===== | ===== PythonOneParameterFunction ===== | ||
| - | If a function is mathematically too complex to be defined with a '' | + | If a function is mathematically too complex to be defined with a '' |
| - | The goal is to give as argument a Python | + | def f(x): |
| + | [function | ||
| + | return y | ||
| + | fct1 = PythonOneParameterFunction(f) | ||
| For example, this is used to: | For example, this is used to: | ||
| Line 38: | Line 56: | ||
| fct1 = PieceWiseLinearFunction() | fct1 = PieceWiseLinearFunction() | ||
| - | fct1.setdata(0,0) | + | fct1.setData(0,0) |
| - | fct1.setdata(1,1) | + | fct1.setData(1,1) |
| can be also defined with a classical python function: | can be also defined with a classical python function: | ||
| Line 53: | Line 71: | ||
| ===== Advanced use ===== | ===== Advanced use ===== | ||
| - | {{: | + | {{: |
| The value can also be displayed for each estimation, and a more complex function can also be defined using all Python tools. For example, a load function can be first defined with a parabola, then with a straight line, the change between these two being controlled by an conditional structure. | The value can also be displayed for each estimation, and a more complex function can also be defined using all Python tools. For example, a load function can be first defined with a parabola, then with a straight line, the change between these two being controlled by an conditional structure. | ||
doc/user/general/fonctions.1420638768.txt.gz · Last modified: (external edit)
