Skip to main content
Filter by
Sorted by
Tagged with
3 votes
3 answers
105 views

I have a black box function baseball that determines the magnitude of the distance that a baseball travels when launched. It takes the initial speed, the angle of launch and the initial spin. Assuming ...
panji's user avatar
  • 47
2 votes
2 answers
120 views

Porting what I believe to be working code for a radix-2 Estrin polynomial evaluation scheme to the Intel ICX 2024 compiler I am seeing a slowdown for a handful of polynomial lengths just below 16*N (...
Martin Brown's user avatar
  • 3,596
1 vote
0 answers
57 views

I'm trying to run an IFFT on a very long signal (10^9 data points) and I'm running into RAM constraints. I'd like to be able to chop up the signal and run it in batches (as I am not time constrained ...
David's user avatar
  • 454
-1 votes
2 answers
180 views

I'm attempting to implement an algorithm to compute an array of values. Unfortunately, I've found the literal implementation of that algorithm to be too slow for my use case. I suspect there's an ...
PerplexedDimension's user avatar
2 votes
2 answers
117 views

I would like to compute the residual of the numerical solution to an ordinary differential equation. Here is the code import numpy as np from scipy.integrate import solve_ivp def f(t, x): return ...
Artem's user avatar
  • 123
-2 votes
2 answers
233 views

I am implementing a method berechneCosinus(float x, int ordnung) in Java that should approximate the cosine of x using the Taylor series up to the specified order. My questions: Can I optimize the ...
Andre's user avatar
  • 21
1 vote
0 answers
75 views

Description I have a deterministic program that uses jax, and is heavy on linear algebra operations. I ran this code on CPU, using three different CPUs. Two MacOs Systems (one on Sequoia (M1 Pro), ...
yousef elbrolosy's user avatar
1 vote
1 answer
60 views

I'm trying to implement a function in Python that reduces a square matrix to upper Hessenberg form using Givens rotations. I know that this should be possible Wiki and sometimes preferred over ...
ldro's user avatar
  • 11
0 votes
1 answer
162 views

I want to solve some ODE just for one time step. The time step is decided internally by the solver, not by me. Is there a python adaptive-time-step ode solver which could do this? For illustration the ...
Naraghazi's user avatar
  • 121
2 votes
1 answer
69 views

Based on the information provided in these lecture notes, the leapfrog integration algorithm should preserve area (for single-body systems) in phase space. I implemented the algorithm for a Coulomb ...
AJB's user avatar
  • 111
8 votes
2 answers
735 views

First, it is most compact sine approximation ever. It seems i can do better than Remez in terms of precision/performance. Here [0,pi/2] approximation range. double p[] = -0.0020836519336891552, -0....
minorlogic's user avatar
  • 2,055
0 votes
0 answers
69 views

For a grid ((xi,yj))i,j, and a function f with well knows values at points (xi,yi). We want to compute the double integral of f according to a measure phi(y)dxdy, where phi is a normalized function. ...
Alpha Z's user avatar
4 votes
5 answers
314 views

I am studying numerical analysis and I have come across this dilemma. Running the following script, from decimal import Decimal a = 0.1 ; N = 100000 ; # product calculation P = N*a # Print product ...
Nicola Sergio's user avatar
0 votes
0 answers
63 views

I’m trying to generate a phase portrait for a system of coupled ordinary differential equations (ODEs) using Python’s scipy.integrate.solve_ivp. The system models the frequency of cooperators (x) and ...
Emon Hossain's user avatar
0 votes
1 answer
82 views

Why does the following code that calls comb produce the wrong output? from scipy.special import comb from sympy import binomial def coup(n=100, m=10): expectation = 0 for j in range(1, n + 1): ...
bettersayhello's user avatar
0 votes
0 answers
38 views

I am trying to write code that will fit logistic function to set of data. I am using Levenberg-Marquardt routine (as given in Numerical Recipes 3rd edition) and that requires me to supply a function ...
martin's user avatar
  • 2,670
0 votes
0 answers
62 views

I try to simulate the following problem: Compute the density of states numerically of a BCS superconductor with magnetic impurities using the tight binding model of 1D chain with periodically border ...
ivana curci's user avatar
0 votes
0 answers
49 views

I'm trying to implement a simple molecular dynamic simulation in Python for N atoms with periodic boundary conditions while allowing coordinate wrapping to visualize the atoms interacting through ...
Lana.s's user avatar
  • 47
1 vote
1 answer
66 views

I'm trying to implement a simple MD simulation in Python (I'm new to this),I'm using LJ potential and force equations along with Verlet method: def LJ_VF(r): #r = distance in Å #Returns V in (...
Lana.s's user avatar
  • 47
0 votes
0 answers
30 views

I am experimenting with an N-Body-Simulation with the goal to be efficient with a large number of particles. That means, the most costly thing will be calls to the ODE-function. Adams-Bashforth only ...
Paul Aner's user avatar
  • 543
0 votes
0 answers
39 views

The expression I'm integrating is Where the latent variables are sampled from the a multivariate distribution as following: And the random variables w_n given a latent variable is sampled from a ...
cdt123's user avatar
  • 71
0 votes
2 answers
59 views

I have a Python function, called trap_1D, which computes the (approximate) integral of a univariate function f over an interval [a,b] using the composite trapezoidal rule. Now I want to evaluate an ...
Leonidas's user avatar
  • 783
0 votes
0 answers
53 views

I have implemented following equations both with the Matlab own ODE solvers and with a very simple finite difference scheme. The latter works properly, while the ODE code does not produce suitable ...
user299176's user avatar
0 votes
1 answer
143 views

I am implementing the forward algorithm for Hidden Markov Models (see below for the algorithm). To prevent over/underflow, I work with log-probabilities instead, and use the log-sum-exp trick to ...
ranky123's user avatar
  • 409
2 votes
2 answers
191 views

The algorithm for calculating a fraction from a decimal number is known and there are enough examples for that. In my case I need to find a fraction for a given decimal where A = N/D is optimized but ...
Gustavo's user avatar
  • 1,019

1
2 3 4 5
50