Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify documentation on periodic table extrapolation #4287

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 5 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions Modelica/Blocks/Tables.mo
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ extrapolation = 1: Hold the first or last value of the table,
(If smoothness is LinearSegments or ConstantSegments
this means to extrapolate linearly through the first/last
two table points.).
= 3: Periodically repeat the table data (periodical function).
= 3: Periodically repeat the table data (periodical function),
where the repetition period is table[end,1]-table[1,1].
For u = table[end,1] the result is table[end,2]. However for the
limit of u downwards to table[end,1] the result is table[<strong>1</strong>,2].
This implies that for correct reproduction of a periodic function
the first and last data values should be the same
(table[1,2] = table[end,2]).
paultjevdh marked this conversation as resolved.
Show resolved Hide resolved
= 4: No extrapolation, i.e. extrapolation triggers an error
</pre></blockquote></li>
<li>If the table has only <strong>one row</strong>, the table value is returned,
Expand Down Expand Up @@ -420,7 +426,13 @@ extrapolation = 1: Hold the first or last value of the table,
(If smoothness is LinearSegments or ConstantSegments
this means to extrapolate linearly through the first/last
two table points.).
= 3: Periodically repeat the table data (periodical function).
= 3: Periodically repeat the table data (periodical function),
where the repetition period is table[end,1]-table[1,1].
For u = table[end,1] the result is table[end,2]. However for the
limit of u downwards to table[end,1] the result is table[<strong>1</strong>,2].
This implies that for correct reproduction of a periodic function
the first and last data values should be the same
(table[1,2] = table[end,2]).
paultjevdh marked this conversation as resolved.
Show resolved Hide resolved
= 4: No extrapolation, i.e. extrapolation triggers an error
</pre></blockquote></li>
<li>If the table has only <strong>one row</strong>, the table value is returned,
Expand Down Expand Up @@ -620,7 +632,15 @@ extrapolation = 1: Hold the first or last values of the table,
(If smoothness is LinearSegments or ConstantSegments
this means to extrapolate linearly through the first/last
two table points.).
= 3: Periodically repeat the table data (periodical function).
= 3: Periodically repeat the table data (periodical function),
where the repetition period is table[end,1]-table[2,1] and
table[1,end]-table[1,2] for columns and rows respectively.
Assuming u1 is one of the abscissa values: for u2 = table[1,end]
the result is table[u1,end]. However for the lim of u2 downwards
to table[1,end] the result is table[u1,<strong>2</strong>].
This implies that for correct reproduction of a periodic function
the first and last rows/columns should be the same
(table[2,2:] = table[end,2:] and table[2:,2] = table[2:,end]).
paultjevdh marked this conversation as resolved.
Show resolved Hide resolved
= 4: No extrapolation, i.e. extrapolation triggers an error
</pre></blockquote></li>
<li>If the table has only <strong>one element</strong>, the table value is returned,
Expand Down Expand Up @@ -811,7 +831,15 @@ extrapolation = 1: Hold the first or last values of the table,
(If smoothness is LinearSegments or ConstantSegments
this means to extrapolate linearly through the first/last
two table points.).
= 3: Periodically repeat the table data (periodical function).
= 3: Periodically repeat the table data (periodical function),
where the repetition period is table[end,1]-table[2,1] and
table[1,end]-table[1,2] for columns and rows respectively.
Assuming u1 is one of the abscissa values: for u2 = table[1,end]
the result is table[u1,end]. However for the lim of u2 downwards
to table[1,end] the result is table[u1,<strong>2</strong>].
This implies that for correct reproduction of a periodic function
the first and last rows/columns should be the same
(table[2,2:] = table[end,2:] and table[2:,2] = table[2:,end]).
paultjevdh marked this conversation as resolved.
Show resolved Hide resolved
= 4: No extrapolation, i.e. extrapolation triggers an error
</pre></blockquote></li>
<li>If the table has only <strong>one element</strong>, the table value is returned,
Expand Down