Questions tagged [numerical-computing]

Is an interconnected combination of computer science and mathematics .

Is an interconnected combination of computer science and mathematics in which we develop and analyze algorithms for solving important problems in science, engineering, medicine, and business, for example, designing a bridge, choosing a stock portfolio, or detecting tumors in medical images

146 questions
1
vote
3 answers

Which way is more accurate?

I need to divide a numeric range to some segments that have same length. But I can't decide which way is more accurate. For example: double r1 = 100.0, r2 = 1000.0, r = r2 - r1; int n = 30; double[] position = new double[n]; for (int i = 0; i < n;…
EFanZh
  • 2,357
  • 3
  • 30
  • 63
1
vote
0 answers

Computing roots of a very high degree polynomial

Here is my problem ; for my research, I believe that the complex numbers I am looking at are precisely the (very large) set of roots of some high degree polynomial, of degree $\sim 2^n$ (~ 2^n) where $1 \le n \le 10 \sim 15$ (1 <= n <= 10 ~ 15).…
Patrick Da Silva
  • 1,524
  • 1
  • 11
  • 15
0
votes
1 answer

How to install Odespy library in Python V3.11?

Can someone help me to install the Odespy library in python library environment. https://github.com/NisangaN/odespy.git I tried by using pip install, but it is not working. I am a bit new to programming so try to explain as simply as possible.
Nis
  • 11
  • 1
0
votes
0 answers

How to calculate the Automatic differentiation of an arbitrary function in python

I'm using the mpmath library to compute a self defined function f(x) and needed to compute its higher order derivatives. I found the Automatic differentiation on Wikipedia and found it useful. # Automatic Differentiation import math class Var: …
0
votes
0 answers

Is it necessary to parallelize the nested function in python?

Computing higher order derivatives is a nested function and can be quite consuming. I tried to use the parallel programming to speed up the nested function. from concurrent.futures import ThreadPoolExecutor import os def numerical_derivative_par(f,…
0
votes
0 answers

Using fsolve in Shooting Method for Boundary Value Problem results in "ValueError: setting and array element with a sequence."

I'm a professor of Modeling & Simulation for engineering undergraduates and one of the examples I used to teach while talking about boundary value problems is the following: A ball is thrown from a height of 1.5 metres. The initial speed of the ball…
0
votes
1 answer

How to improve sub-matrix-vector multiplication c code

I have C code for generic-sub-matrix-vector (gesubmv) multiplication that computes y(rinds) = A(rinds, cinds)*x(cinds) + y(rinds), where rinds and cinds are vectors of row and column (not necessarily sorted) indices, respectively. For genericity,…
0
votes
1 answer

Numeric calculation of nullspace with Sympy is slow

I want to obtain the bases for kernel (nullspace) of a matrix using the Row Reduced Echelon Form (RREF). Although scipy has the function to calculate nullspace, it does not give me sparse vectors because it uses singular value decomposition…
0
votes
0 answers

Solve PDE using finite difference method

Using Matlab, I am trying to solve PDEs by the finite difference method. The coupled PDEs are as follows: the coupled PDEs How should I handle this term surrounded by a black frame? I tried many ways, and all failed.
0
votes
0 answers

Use python to numerically solve an equation with multiple unknowns

I am trying to solve a single equation with multiple unknowns numerically but am kind of stuck on how to approach this. The equation I am trying to solve is ln(k1V + k2W + k3*X) = -a/T + b. k1, k2, k3 are constants that I can provide an initial…
dbhakta88
  • 11
  • 2
0
votes
2 answers

How to solve a double integral with any code?

I have an double integral: Because exp(−^2) is a non-integrable function, I have tried to solve this using the quadgk function in MATLAB, but I don't get a good result. Changing the integral's upper limit from infinity to some exact value may be a…
0
votes
1 answer

Multiprocessing in python for numerical simulation with large objects

I am trying to put together a numerical simulation (specifically, Beta cell dynamics) based on Betram et al. 2007 (https://www.sciencedirect.com/science/article/pii/S0006349507709621). The model itself works fine but it is very slow since the…
0
votes
0 answers

What is the best method for solving this large system of non-linear equations in R?

I am trying to solve the attached (very large) system of non-linear equations, ideally in R. As far as I can tell, the system cannot be transformed to be a quadratic program or a quadratic matrix equation. The analytic Jacobian of the system is…
0
votes
2 answers

Numerical Solver in Python is not able to find a solution

I broke my problem down as follows. I am not able to solve the following equation with Python 3.9 in a meaningful way, instead it always stops with the initial_guess for small lambda_ < 1. Is there an alternative algorithm that can handle the error…
0
votes
1 answer

Sympy - speed up expressions evaluation

I compute something in python with sympy but this require too much time. The code looks like this: def compute_aux_lyupanov_val_k(y, A, B, C, D, k): res = [] res.append(y) for i in range(k-1): y = (C + D * y) / (A + B * y) …