treverhines / RBF

Python package containing the tools necessary for radial basis function (RBF) applications
MIT License
215 stars 50 forks source link

Using this RBF package for complex numbers interpolation #30

Closed lalit-pathak closed 1 year ago

lalit-pathak commented 1 year ago

Hello Trever,

First of all, thanks a lot for making this package open. It has been extremely helpful in my research work. I have a question regarding the rbf interpolation for complex numbers. As far as I understand, this package can do interpolation for real numbers. When I tried to do it for complex numbers, it simply ignored the imaginary part and only considered the real part of the complex number for generating interpolants. Is it possible to modify the code so that it also interpolates the complex numbers?

Thanks

lalit-pathak commented 1 year ago

Another update to the previous question.

Instead of considering them a complex number, I can consider them a vector (whose real part is one component and the imaginary part is the other component of the vector). In this way, it can be regarded as a vector-valued interpolation. Is it possible to do vector-valued interpolation with this package?

Thanks

lalit-pathak commented 1 year ago

I just found out that I am using an older version of this code where we can't do it for complex numbers. In the latest version, there is support for complex numbers too. I'll check it and get back to you in case of any doubt.

Thanks

treverhines commented 1 year ago

Yup, the current version should support interpolating complex and/or vector data. Let me know if you have any issues

lalit-pathak commented 1 year ago

Thanks for your prompt response.

Will the evaluation be faster in this case in comparison to doing individual evaluations for real and imaginary parts separately?

treverhines commented 1 year ago

Interpolating complex data will be just as fast as passing the data in as a 2d vector. Internally, if the data is complex, then it gets converted to a vector of real and imaginary parts

lalit-pathak commented 1 year ago

Thanks @treverhines for the explanation. It is really useful in my research work. I will be back if I have any question.

lalit-pathak commented 1 year ago

Thanks @treverhines for the explanation. It is really useful in my research work. I will be back if I have any question.