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

expIntegralE - wrong values in parametric plot #24

Closed
axkr opened this issue Jul 26, 2021 · 6 comments
Closed

expIntegralE - wrong values in parametric plot #24

axkr opened this issue Jul 26, 2021 · 6 comments

Comments

@axkr
Copy link

axkr commented Jul 26, 2021

Can you please check the "outlier" values in the parametric plot?
I think they are wrong.
Is there a way to simply determine the values if I'm moving the cursor on these values?

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC
  "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
  "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" style="width: 100%; height: 100%; margin: 0; padding: 0">
<head>
<meta charset="utf-8">
<title>MathCell</title>
</head>

<body style="width: 100%; height: 100%; margin: 0; padding: 0">

<script src="https://cdn.jsdelivr.net/gh/paulmasson/math@1.4.5/build/math.js"></script>
<script src="https://cdn.jsdelivr.net/gh/paulmasson/mathcell@1.9.2/build/mathcell.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mathjax/MathJax@2.7.5/MathJax.js?config=TeX-AMS_HTML"></script>
<div class="mathcell" style="display: flex; width: 100%; height: 100%; margin: 0;  padding: .25in .5in .5in .5in; flex-direction: column; overflow: hidden">
<script>

var parent = document.currentScript.parentNode;

var id = generateId();
parent.id = id;

MathCell( id, [  ] );

parent.update = function( id ) {


function z1(z) { try { return  expIntegralE(2,z);}catch(e){return complex(Number.NaN);} }

var p1 = parametric( (re,im) => [ re, im, z1(complex(re,im)) ], [-2.0, 2.0], [-2.0, 2.0], { complexFunction: 'abs', colormap: 'complexArgument' } );

  var config = { type: 'threejs', aspectRatio: [1.0,1,1] };
  var data = [p1];
evaluate( id, data, config );

}

parent.update( id );

</script>
</div>

</body>
</html>

image

@paulmasson
Copy link
Owner

@axkr guess this function needs work! Thanks for catching this.

There is currently no mouse-over information in either 2D or 3D, but that would be a nice feature to implement in the future. In the meantime, parametric has an option to set maxFaceSlope to remove obvious errors. A setting of 3 works here, of course leaving gaps in the surface.

I've added test data for this function, both on the complex plane and unit circle. The latter errors out immediately, so I'll need to fix this sooner rather than later...

@paulmasson
Copy link
Owner

@axkr the data on the unit circle no longer errors out, but there are still problems with the function as can be seen with this webpage:

https://paulmasson.github.io/math/test/unit-circle.html

It ultimately traces back to expIntegralEi through the upper incomplete gamma function. Still needs work...

@paulmasson
Copy link
Owner

@axkr fixed issues in the underlying expIntegralEi around the origin, so this should look much better. Included in release 1.4.8.

The mouse-over idea is now #26. Thanks for the input!

@axkr
Copy link
Author

axkr commented Apr 8, 2022

There is still an outlier:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC
  "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
  "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">

<html xmlns="[http://www.w3.org/1999/xhtml]()" style="[width: 100%; height: 100%; margin: 0; padding: 0]()">
<head>
<meta charset="[utf-8]()">
<title>MathCell</title>
</head>

<body style="[width: 100%; height: 100%; margin: 0; padding: 0]()">
<script src="[https://cdn.jsdelivr.net/gh/paulmasson/math@1.4.8/build/math.js](view-source:https://cdn.jsdelivr.net/gh/paulmasson/math@1.4.8/build/math.js)"></script>
<script src="[https://cdn.jsdelivr.net/gh/paulmasson/mathcell@1.9.2/build/mathcell.js](view-source:https://cdn.jsdelivr.net/gh/paulmasson/mathcell@1.9.2/build/mathcell.js)"></script>
<script src="[https://cdn.jsdelivr.net/gh/mathjax/MathJax@2.7.5/MathJax.js?config=TeX-AMS_HTML](view-source:https://cdn.jsdelivr.net/gh/mathjax/MathJax@2.7.5/MathJax.js?config=TeX-AMS_HTML)"></script>

<div class="[mathcell]()" style="[display: flex; width: 100%; height: 100%; margin: 0; flex-direction: column; overflow: hidden]()">
<script>
var parent = document.currentScript.parentNode;
var id = generateId();
parent.id = id;
MathCell( id, [  ] );

parent.update = function( id ) {


function z1(z) { try { return  expIntegralE(2,z);}catch(e){return complex(Number.NaN);} }

var p1 = parametric( (re,im) => [ re, im, z1(complex(re,im)) ], [-2.0, 2.0], [-2.0, 2.0], { complexFunction: 'abs', colormap: 'complexArgument' } );

  var config = { type: 'threejs', aspectRatio: [1.0,1,1] };
  var data = [p1];
evaluate( id, data, config );

}
parent.update( id );
</script>
</div>
</body>
</html>

@paulmasson
Copy link
Owner

@axkr this is not an outlier but an error along the entire negative imaginary axis. You can verify by extending the lower y-limit.

Top of my todo list for this repository is a test page for both the real and imaginary axes to check for branch errors and the like.

axkr added a commit to axkr/symja_android_library that referenced this issue Apr 9, 2022
@paulmasson
Copy link
Owner

@axkr the test along complex axes is complete. You can see the error there in the function above:

https://paulmasson.github.io/math/test/complex-axes.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants