Hello everyone.
I have constructed a function using Shannon interpolation as:
sinc = Sinc[Pi #] & ;
shannonIP[v_, w_] =
Total[#3* sinc[(v - #1)/dDelta]*sinc[(w - #2)/dDelta] & @@@
interpolatedData];
Now, I have been told to send this code to a coworker who does optimization in Pyomo. The problem is that said software doesn’t understand the function Sinc. I have to construct it using at most Sin[x]. I have done some attempts:
sincB = (Sin[Pi #]/(Pi (# + 10^-90))) & ;
sincC = Piecewise[{{(Sin[Pi #]/(Pi #)), # >
0.00000000001}, {1 - (#^2)/6 + (#^4)/120 - (#^6)/5040, # <=
0.00000000001}}] & ;
sincD = 1 - ((Pi #^2)/6) + ((Pi #^4)/120) - ((Pi #^6)/
5040) + ((Pi #^8)/362280) - ((Pi #^10)/39916800) + ((Pi #^12)/
6227020800) - ((Pi #^14)/1307674368000) + ((Pi #^16)/
355687428096000) & ;
sincE = Piecewise[{{(Sin[Pi #]/(Pi #)), # != 0}, {1, # =
0.0000000000}}] & ;
None of these provide acceptable results; the piecewise ones also have weird white lines when plotting the resulting functions and the resulting expressions aren’t something that one can send to Pyomo. I will attach my code in case it is useful.
Can someone please give me advice on what to do?
Thank you very much.
Regards.
Jaime.
remove_sincB.nb (2.86 MB)