Questions tagged [python]
A general purpose high-level programming language that emphasizes ease of code syntax and readability.
976 questions
0 votes
1 answer
70 views
Help implementing the Hessenberg QR algorithm using the Keras Ops API
I am trying to implement the Complex and Real Schur Decompositions using only the Keras Ops API, so I can utilize it to impose some eigenvalue constraints on a weight matrix. I am also using the JAX ...
3 votes
1 answer
68 views
M2M in python using SciPy.sph_harm_y
I’m implementing a 3D Laplace Fast Multipole Method in Python and I’m trying to validate my P2M, potential evaluation, and M2M steps against direct summation. P2M + evaluation agree with direct ...
0 votes
0 answers
59 views
More accurate ways to approximate a Finite Fourier Sine Transform?
I'm reading through this research paper, and from section 2, I have deduced that the Finite Fourier Sine Transform along $0\le x\le L_x$ is formulated as $$F(m) = \frac{2}{L_x}\int_0^{L_x} f(x) \sin\...
1 vote
1 answer
82 views
Oscillations in 1D compressible Navier–Stokes simulation
I am currently struggling with the implementation of the compressible Navier–Stokes equations in my research work. To simplify the problem as much as possible, I reformulated it as a textbook-like ...
2 votes
1 answer
121 views
Panini sticker python coding problem - bug in my code somewhere
I have found this paper: http://www.unige.ch/math/folks/velenik/Vulg/Paninimania.pdf On page 4 I am trying to turn this: into python code but I do not get the correct answer, I have 'The result of ...
2 votes
0 answers
107 views
Why does my ODE show a sudden spike (thermodynamics heat transfer model)
I'm trying to model temperature inside a container given outside temperature and an internal heat source. The problem is that when the heat source is switched on (on the 10 hour mark) there is an ...
2 votes
1 answer
114 views
Split-step Fourier method for ultrashort pulse propagation predicts everything, but not the spectral phase
I'm implementing in Python the split-step Fourier method (SSFM) to solve the non-linear envelope propagation equation (NEE), and I'm including second and third order dispersion (GDD, TOD), self-phase ...
3 votes
1 answer
210 views
Poincaré section for double pendulum code improvement
I wanted to try numerical analysis of a chaotic system. So I decided to write my own code for the Poincaré section of a double pendulum in Python. The code works and the Poincaré section should be ...
0 votes
0 answers
35 views
How to use M.E.S.S. / pymess for solving large scale Lyapunov equations?
I am trying to use M.E.S.S. (Matrix Equation Sparse Solver) to solve large scale sparse Lyapunov equations, see here. In particular I installed the python wrapper ...
0 votes
1 answer
198 views
Find necessary operators for symbolic regression
I wrote a symbolic regression tool in Python. It is possible to give unary and binary operators. If nothing is specified, I want to determine potential operators. So, I want to know if there is an ...
0 votes
0 answers
32 views
Surface group missing in Radioss block mesh exported with python gmsh
I am expecting a corresponding /GRSHEL or /GRSH3N keyword for a surface physical group. The surface group is exported correctly with the gui program by following this guide https://openradioss....
1 vote
1 answer
161 views
Gradient Descent vs Accelerated Gradient Descent
I have this Exercise in my Numerical Optimization class and here it is: In this exercise, you will consider the ridge regression problem: $$\min_{x \in \mathbb{R}^n}\frac{1}{2}\|Ax-y\|^2_2+\frac{\...
1 vote
1 answer
218 views
C++ vs Python Advection Diffusion Matrix vs Stencil Based for-loops
Background I have an intermediate level of experience implementing the 2 dimensional advection-diffusion equation in Python. As far as I'm aware, the general practice is to frame the simulation as a ...
2 votes
1 answer
155 views
algorithmic complexity in numpy
I have learnt scientific computing back in the time when C and C++ were the thing, and I'm relatively new to ...
0 votes
1 answer
91 views
Extrapolation of lookup tables in python
I need to extrapolate in Python a lookup table of 6 input params and 1 dependent variable. The RESULT parameter was obtained for the CRY values between 9 and 15. Need to extrapolate it between 15 and ...