Bessel functions as CoefficientFunctions
- renzo
- Topic Author
- New Member
Less
More
2 years 1 month ago #4523
by renzo
Bessel functions as CoefficientFunctions was created by renzo
Hi,
I want to use the bessel function from a python library (for example scipy.special) as a CoefficientFunctions.
my code:
from ngsolve import *
from scipy.special import jn #import bessel J function
uexact = jn(1,x)
I get the following error:
uexact = jn(1,x)
TypeError: ufunc 'jv' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Is there a way to use these functions from a python library as CoefficentFunction?
Thank you,
Renzo
I want to use the bessel function from a python library (for example scipy.special) as a CoefficientFunctions.
my code:
from ngsolve import *
from scipy.special import jn #import bessel J function
uexact = jn(1,x)
I get the following error:
uexact = jn(1,x)
TypeError: ufunc 'jv' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
Is there a way to use these functions from a python library as CoefficentFunction?
Thank you,
Renzo
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
2 years 1 month ago #4524
by christopher
Replied by christopher on topic Bessel functions as CoefficientFunctions
Hi, no you cannot use scipy functions as coefficients, but we have the ngs-special-functions addon that provides these functions:
github.com/NGSolve/ngs-special-functions
Best
Christopher
github.com/NGSolve/ngs-special-functions
Best
Christopher
The following user(s) said Thank You: renzo
- renzo
- Topic Author
- New Member
Less
More
1 year 11 months ago #4566
by renzo
Replied by renzo on topic Bessel functions as CoefficientFunctions
Hi Christopher,
Thank you for your answer!
I followed the instruction to install the package on Linux and I tried to run the demo bessel.py but I get an import error:
ImportError: /home/c/rzanol/.local/lib/python3.8/site-packages/ngsolve/special_functions.so: undefined symbol: _ZNK5ngfem19CoefficientFunction14GetDescriptionB5cxx11Ev
Do you have any idea what could be the problem?
Thank you for your answer!
I followed the instruction to install the package on Linux and I tried to run the demo bessel.py but I get an import error:
ImportError: /home/c/rzanol/.local/lib/python3.8/site-packages/ngsolve/special_functions.so: undefined symbol: _ZNK5ngfem19CoefficientFunction14GetDescriptionB5cxx11Ev
Do you have any idea what could be the problem?
Time to create page: 0.095 seconds