Let me explain.
So I'm running a simulation with 2^15 points in MATLAB. Part of my initial condition is to use the
Sech().^2
Function. This works perfectly fine in MATLAB and I get an array of very useable data.
In python on the other hand, when I go
1/( np.cosh(x)**2 )
I get a runtime/ overflow error that ruins my day.
Why can MATLAB handle the code but numpy can't?
RuntimeWarning: overflow encountered in cosh r = 1/(np.cosh(x)**2)
The code works flawlessly when translated in MATLAB and produces exactly what I want.