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
0
votes
1 answer

Create a web interface for a Python numerical simulation code (and where to host it)

I need to create a web interface for a Python numerical simulation code, and host both (interface and python code). When a user will run a simulation, it could take hours, or even days for the simulation to finish (and of course it has to run many…
Guix
  • 308
  • 2
  • 11
0
votes
1 answer

Implementation of piecewised function in python with numerical ODE solution. TypeError: float() argument must be a string or a number, not 'OdeResult'

I have a reaction system whose mechanism is defined in the form of a nonlinear first-order ODE as: dx(t)/dt = - gaf(1 - rho)(1 - exp(-kt))(x(t)^2 + bx(t))/(cx(t) + p) where, g, a, f, b, c, rho, k and p are all constants. I’m trying to compile a code…
CCMJ
  • 1
  • 1
0
votes
0 answers

taking derivative using sparse matrix

I’m trying to solve the following problem for around 2 days, but have not had success. I want to calculate the derivative using the sparse matrix, but the result doesn’t true. I think there is a mistake in the solution function, but I cannot find…
Javad
  • 1
0
votes
1 answer

Create B such that B @ X.ravel() == (A.T @ X + X @ A).ravel()

I'm not new to numpy, but the solution to this problem has been eluding me for a while now, so I thought that I would ask here. Given the equation Y = A.T @ X + X @ A where A and X are square matrices. construct B such that B @ X.ravel() ==…
Vinzent
  • 1,070
  • 1
  • 9
  • 14
0
votes
3 answers

Need to find when value is == 0, but I cannot due to numerical errors

I have 2 large lists of vectors (>10,000 vectors each, say vi and wi) and I am trying to find when vi cross-product wi = 0, or, when vi x wi = 0. The lists of vectors are previously calculated (this is Computational Fluid Dynamics and the calculated…
0
votes
1 answer

How to remove spikes in solution and produce smooth interpolation with scipy?

I'm writing a numerical solution to a partial integro-differential equation, and I need it to run quickly so I found that scipy.integrate.simps is best, but it's not always 100% accurate and produces the spikes in [1]. My solution was to remove them…
0
votes
1 answer

Finding f(g) from f(x) and g(x) numerically

I'm studying an article where there are two functions: $e(x) = (e_0/8)\cdot[(2x^3 + x)\sqrt{(1 + x^2)} − \sinh^{−1}(x)]$ $p(x) = (e_0/24)\cdot[(2x^3 - 3x)\sqrt{(1 + x^2)} + 3\sinh^{−1}(x)]$ The article ask me to find numerically $e(p)$ starting from…
mcp
  • 23
  • 3
0
votes
1 answer

C floating point exception handling

The manual pages for fenv.h (feraiseexcept and its ilk) are unusually uninformative; the examples I find online (cppreference.com and others) are very minimal. How are they supposed to be used? In particular, does feraiseexcept(...) always return?…
vonbrand
  • 11,412
  • 8
  • 32
  • 52
0
votes
1 answer

numerical prediction of a pendulums motion in python not predicting properly

I'm working on a numerical prediction of a pendulums motion for a project. while running the program I've noticed the time between each peak (when the value reaches the same theta value as the beginning value of theta) is not the same as the…
0
votes
1 answer

Numerical solution for a pendulum

I am having a trouble in providing a graphical representation of my system, which happens to be a harmonically driven pendulum. The problem is shown below for reference. Problem The source code I used is shown below using the Verlet Scheme. #Import…
0
votes
1 answer

Functions intersection approximation

Let f1 and f2 be two functions in the range of [a, b], and maxerr the required approximation. They both differentiable and continuous in this range. I should return an iterable of approximate intersection Xs, such that: ∀x∈Xs, |f_1(x) - f_2(x)| <…
0
votes
0 answers

Alternatives to scipy.integrate

I'm new to numerical integration with Python and I was wandering what is the best Python package for this purpose. Of course I discovered scipy.integrate that is pretty nice, but I wanted to know if that is really the "gold stardand" or if there are…
0
votes
0 answers

Is there a way to manipulate function arguments by their position number?

I wish to be able to manipulate function arguments by the order in which they are given. So, void sum(int a, int b, int c) std::cout<< arguments[0]+arguments[1]; sum(1,1,4); should print 2. This feature is in JavaScript. I need it to…
Lelouch
  • 101
  • 2
0
votes
2 answers

C function call Numerical Recipes Chapter 10.3

I have this function. I'm kinda green in C and I don't know how to call this function to get a result: float dbrent(float ax, float bx, float cx, float (*f)(float),float (*df)(float), float tol, float* xmin) { int iter, ok1, ok2; float a, b,…
0
votes
1 answer

CUDA access matrix stored in RAM and possibility of being implemented

Recently I started working with numerical computation and solving mathematical problems numerically, programing in C++ with OpenMP. But now my problem is to big and take days to solve even parallelized. So, I’m thinking in start learning CUDA to…
Guus
  • 15
  • 3