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

Fix documentation of ComplexMath.Asin, Acos and Log #2168

Closed
beutlich opened this issue Feb 13, 2017 · 2 comments
Closed

Fix documentation of ComplexMath.Asin, Acos and Log #2168

beutlich opened this issue Feb 13, 2017 · 2 comments
Assignees
Labels
documentation Issue addresses the documentation L: Complex* Issue addresses Complex, Modelica.ComplexBlocks or Modelica.ComplexMath V: 3.2.2 Issue originates in MSL v3.2.2 (and is not present in earlier releases)
Milestone

Comments

@beutlich
Copy link
Member

beutlich commented Feb 13, 2017

The input constraints do not hold for complex numbers and seem to have been copy/pasted from the corresponding Real blocks of Blocks.Math. This is what it reads in MSL v3.2.2:

For Asin/Acos:

The absolute values of the elements of the input <code>u</code> need to
be less or equal to one (<b>abs</b>( u ) <= 1).
Otherwise an error occurs.

For Log:

An error occurs if the elements of the input <code>u</code> are
zero or negative.
@beutlich beutlich added bug Critical/severe issue L: Complex* Issue addresses Complex, Modelica.ComplexBlocks or Modelica.ComplexMath labels Feb 13, 2017
@beutlich beutlich added this to the MSL_next-MINOR-version milestone Feb 13, 2017
@AHaumer
Copy link
Contributor

AHaumer commented Mar 5, 2017

Agree for Asin and Acos, but how should Complex u be negative? abs(u) is always >= 0, ok for abs(u)=0 we have a problem.

@HansOlsson
Copy link
Contributor

Agree for Asin and Acos, but how should Complex u be negative? abs(u) is always >= 0, ok for abs(u)=0 we have a problem.

Well, -1 seems negative, but Modelica.ComplexMath.log(Complex(-1)) is ok - and thus it seems it should be:
An error occurs if the elements of the input <code>u</code> are zero.

Similarly Modelica.ComplexMath.asin(Complex(2,0) actually works - so we don't need any restriction on those.

However, there is another issue (needs a separate ticket for Modelica.Blocks.Math; will open it) - it is a single input and thus I would expect:
Log: An error occurs if the input <code>u</code> is zero.
Asin/Acos: This space intentionally left blank

It is likely that the error in Modelica.Blocks.Math occurred due to Modelica 1->2 change when blocks changed from having vectors to scalars as inputs.

@beutlich beutlich added the V: 3.2.2 Issue originates in MSL v3.2.2 (and is not present in earlier releases) label Mar 6, 2017
@beutlich beutlich added documentation Issue addresses the documentation and removed bug Critical/severe issue labels Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue addresses the documentation L: Complex* Issue addresses Complex, Modelica.ComplexBlocks or Modelica.ComplexMath V: 3.2.2 Issue originates in MSL v3.2.2 (and is not present in earlier releases)
Projects
None yet
Development

No branches or pull requests

3 participants