Questions tagged [numerics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-3
votes
0answers
44 views

Operator Splitting and RK4 method

I’m trying to implement the method of Balanced and Rebalanced Splitting in the following problem which is enclosed in Speth’s and Macknamara’s paper ‘’BALANCED SPLITTING AND REBALANCED SPLITTING’’. ...
4
votes
3answers
829 views

How important is learning hardware/architecture for scientific computing?

Apologies if this is a bit of a soft, unclear, or opinion-based question. I'm a relatively new PhD student in a (computational) quantum chemistry group. My group develops and maintains a few software ...
-1
votes
0answers
43 views

scipy solve_ivp with adaptive solution

I am struggling to understand how scipy.solve_ivp() handles errors in a system of ODE. I have a complex systems of ODE with very large varying time-scales, for which my state "y" is composed ...
2
votes
2answers
137 views

How to implement point source or volume source in finite element implementations

I'm trying to do a simple implementation to study the advection-diffusion-reaction dynamics in a straight pipe. I have points positioned along the length of the pipe (blue dots in the image above). I ...
1
vote
0answers
53 views

For a hyperbolic PDE, is there any proof that the BDF2 method is stable for integrating them?

I would like to ask a question on the stability of BDF2 applied to hyperbolic PDEs. Say I have a hyperbolic equation as $\frac{\partial c}{\partial t} + {\bf U} \cdot {\bf \nabla}c=0$. This system is ...
0
votes
0answers
32 views

Expression for numerical amplification factor for Euler time integration and CD2 scheme for one degree hyperbolic function

This is the expression to be derived but I am not getting the exact expression as given in the image. Is the given expression given for the implicit Euler method? Here $N_c = c (\delta t)/h$ and $\tan(...
4
votes
0answers
76 views

Unstable Algorithms which become stable when hardware provides Kulisch exact dot product instruction

In John Gustaffson's book The End of Error, he discusses Ulrich Kulisch's exact dot product, which (in double precision) requires a 2100 bit fixed point register which rounds only once after the ...
0
votes
1answer
41 views

How can the Lipschitz continuity be shown with power iteration method?

I know that the definition of the Lipschitz continuity is defines as $$||f(y) - f(x)|| \leq L ||y-x||$$ My professor told me that by knowing $f$ we can find constant $L$ using the power iteration ...
3
votes
1answer
69 views

Why do we have to resort to Higher order schemes for solving the 1-D advection equation/ continuity equation?

\begin{equation} \begin{aligned} \frac{\partial N}{\partial t} &+ \frac{\partial J}{\partial r} = 0, \\ \frac{\partial N}{\partial t} &+ \frac{\partial }{\partial r}(N \upsilon ...
-1
votes
1answer
55 views

Howo to implement complex step derivative for complex functions?

I have a complex analytic function of which I want to take the numerical derivative. \begin{align} f(z) &\equiv f(x,y) = u(x,y) + i v(x,y) \\ \frac{d f(z)}{d z} & = \lim_{h \to 0} \frac{f(z + ...
1
vote
1answer
108 views

Solving numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods

Lately, I've been trying to solve numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods. Let $\nu$ be the viscosity and $[0,L]$ the domain. The 1D equation is, $$ u_t + uu_x + u_{xx} ...
3
votes
2answers
200 views

How to solve second order coupled non linear differential equations

For a project I am doing, I have to solve the following system of differential equations numerically using my own code: $$ x^2K'' = KH^2 + K(K^2-1) $$ and, $$ x^2H'' = 2K^2H + \alpha H(H^2-x^2) $$ ...
2
votes
4answers
139 views

Eigenvalue decomposition for a very huge matrix of medical images (such as the pixel physical coordinates of CT images)

I am trying to do eigenvalue decomposition for a huge matrix larger than 788000×788000 for medical image analysis. The matrix is not sparse and every element in the matrix has a real value. And, for ...
1
vote
1answer
84 views

Numerical integrator for $a'(t)=e^{-a(t)}f(t)$

Suppose I know a function $f(t)$ and all its derivatives in $t$ in closed form. Given $a(0)$ and some $t_0>0$, I'm looking for an explicit integrator that can estimate $a(t_0)$, where $a(\cdot)$ ...
0
votes
0answers
32 views

How to efficiently perform this 2D integral in Quadpy?

I need to integrate a function defined in 2Dims (z and radius r), for which I don't have an expression. I can just query the ...
1
vote
1answer
106 views

Accuracy gap for apparently stable solution

I was reasoning about the behaviour of the methods I'm using for my simulation and I noticed that, considering $h_s$ as the timestep over which I have unstable solutions and $h_a$ as the timestep ...
0
votes
0answers
38 views

Blown-up iterates in Gauss-Newton method

I am working on a non-linear least squares problem with standard form, in which I need to calibrate a parameter vector $\Theta$ to a set of inputs $\mathbf{x}$ and outputs $\mathbf{y}$: $$\begin{align}...
2
votes
3answers
158 views

Linear solver recommendation(s) for small problems

I am interested in solving many linear systems $Ax = b$, where $A$ is symmetric positive definite and small (i.e. less than 25,000 rows) --- $b$ will be changing. We can assume that $A$ arises from ...
0
votes
1answer
84 views

Error using scipy.integrate.solve_ivp: index error: the index 0 is out of bounds for axis 0 with size 0

I am recently working on the code based on the stick-slip phenomenon in Python. It's the stick-slip oscillator (chapter 3.4) in https://www.sciencedirect.com/science/article/pii/S0888327020301205. And ...
1
vote
0answers
37 views

discretization of advection diffusion with variable coefficients

I am looking for help to find a somewhat stable FD numerical scheme for the advection diffusion equation posed on a curve $(x(r),y(r))$. The equation becomes $$u_t=\alpha(r) u_r +\beta(r) u_{rr}+f(r,t)...
2
votes
0answers
65 views

Errors in Integral Estimate of Gaussian using Trapezoidal Rule

I'm trying to estimate the percentage error in computing the integral of a Gaussian via composite trapezoidal rule versus via an exact formula. To do this I've generated a gaussian with mean 0, ...
0
votes
1answer
51 views

finding boundary conditions when transforming a higher order ode to system of first order ode

given the following ODE: $$\frac{d^{4}w}{dx^{4}} + B\frac{d^{2}w}{dx^{2}} = 1$$ with boundary conditions $w(0) =0 , w(1) = 0,w'(0) = 0,w'(1) = 0$ its possible to solve analytically but I am attempting ...
0
votes
1answer
60 views

High Running Time and Suboptimal Accuracy of 2D Wave Equation Solver with Finite Differences

Im trying to solve the following 2D wave equation: $$u_{tt} = u_{xx} + u_{yy}, \hspace{3mm} u(x,y,0) = \cos(4 \pi x) \sin(4 \pi y), \hspace{3mm} u_t(x,y,0) = 0$$ with the periodic boundary condition ...
2
votes
1answer
57 views

Initial condition precision

Is there a way to have an estimate of the error propagated on an ode numerical solution by the error of the initial conditions? I suppose this depend on the numerical method used and on the problem ...
0
votes
1answer
59 views

2 point BVP solver: how to compute errors

Background I am working with chapter 2 in LeVeque's book: https://faculty.washington.edu/rjl/fdmbook/ I have build my own solver in Python to solve the 2 point BVP: $$ \epsilon u''+u(u'-1) =0 , \\ u(0)...
1
vote
0answers
41 views

Solving two field Schrodinger-Poisson system numerically

I want to solve the system of Schrodinger-Poisson equations numerically: \begin{align} \chi_1''(r) + \frac{2}{r}\chi_1'(r)&=2U(r)\chi_1(r) \\ \chi_2''(r) + \frac{2}{r}\chi_2'(r)&=2\...
0
votes
1answer
107 views

Trouble Implementing 1d Wave Equation Finite Difference Solver

Im trying to solve the 1d Wave Equation on $x \in \mathbb{R}, t > 0$: $$u_{tt} = c^2u_{xx}, \hspace{5mm} u(x,0) = \cos(4 \pi x), \hspace{5mm} u_t(x,0) = 0$$ with $c = 1$ and a periodic boundary ...
2
votes
1answer
210 views

Solving Cahn-Hilliard equation using semi-implicit Fourier spectral methods

So, I have written both a C and python code to solve the 2D Cahn-Hilliard equation: \begin{equation} \frac{\partial c}{\partial t} = \nabla^2\left(c^3 - c - \kappa\nabla^2c\right) \end{equation} ...
-2
votes
1answer
69 views

Forward Euler Adaptive Step Size Stability

Given with a generalization using adaptive times-stepping as then is it still reasonable to assume that to ensure stability of the Euler’s forward method we need the growth factor for all n to be ...
1
vote
0answers
35 views

Energy cannot decent during optimization despite non-zero gradient

Assume we have an (at least) 2nd-order differentiable energy $f(x), x\in R^n.$ And $n$ is very big. Mathematically, I think it is impossible to find a point $\bar{x}$ where the energy cannot be ...
-1
votes
1answer
63 views

illegal use of ODEINT

given the following system: $$\frac{dP}{dt} = \alpha P(1-\frac{P}{K}) - \beta P I$$ $$\frac{dI}{dt} = \beta P I - \rho I$$ how do I solve the system numerically. as when I attempt to solve this is the ...
3
votes
0answers
48 views

Difference between wave vector and density matrix in numerical calculation of Schrödinger equation

I solved Schrödinger equation for a following tow-level time-dependent Hamiltonian numerically in two ways: ...
1
vote
1answer
178 views

Drawing saddle node bifurcation diagram for a non-linear ODE in Python

I'm trying to draw the bifurcation diagram of the following ODE, This ODE leads to a saddle-node bifurcation (see wiki) However what I get is not exactly right. There's a lot of "noise" as ...
0
votes
0answers
162 views

Numerov method for solving Schrödinger equation

I have just begun learning computer science to apply it to Physics and I am trying to write a code for solving Schrödinger's equation of the harmonic oscillator (setting $V=\frac{x^2}{2}$) in one ...
0
votes
1answer
147 views

Perturbation problem using Runge-Kutta 4

I'm trying to evaluate the perturbations magnitude between 2 body orbiting a central one in three dimensions. In order to do this I need to have an estimate of the error, which I did using Richardson ...
2
votes
1answer
165 views

Reference request: C++ and numerical analysis book

I'm a master student with a good Numerical analysis background. I'm going to do a master thesis in the same subject, but I need to use C++ since my advisor loves it, and I also believe it's the best ...
1
vote
1answer
79 views

Calculate the arc length of a Steinmetz curve numerically

I'd like to know the length made by the intersection curve of two orthogonal cylinders of different radii a and b where a > b >0. I came across this post that provides a solution with an ...
-2
votes
1answer
40 views

Solving differential equation by setting vectorization `on` in MATLAB

This is a follow up to my previous question posted here. I've set up an ode system in MATLAB and I'm trying to vectorize the code to increase the speed of computation. The follow is the code for my ...
2
votes
1answer
202 views

Comparing numerical solutions with very different time grids

I've read an article (Long-term integrations and stability of planetary orbits in our Solar system) in which the authors solved the problem of the absence of an analytical solution for the solar ...
0
votes
1answer
66 views

Solving differential equation by specifying jacobian pattern

This is a follow up to my previous question posted here I'm trying to construct the sparsity pattern of the jacobian matrix to speed up the computation of a large system of odes. The following is the ...
2
votes
0answers
147 views

Best way to compute given functional with accuracy:

I need to plot the following functional with accuracy: $$ I(x,s) =\int_0^\infty\mathrm dy \frac{F(x + \mathrm iy,s) − F(x −\mathrm iy,s)}{\mathrm e^{2πy}-1}, $$ Where $ F(z,s) = \dfrac{1}{z^s\Gamma(\...
0
votes
0answers
66 views

Sparse linear solver in fortran working with REAL16

I need some (direct) sparse linear solver for fortran, which works with REAL16 data type. Any suggestions? Both Pardiso and MUMPS support only REAL8. (identical question: https://math.stackexchange....
1
vote
0answers
37 views

Are FDS scheme and ROE-FDS scheme the same?

In SU2 documentation about the numerical schemes (https://su2code.github.io/docs_v7/Convective-Schemes/) FDS is mentioned as a "standalone" method. Yet, when looking online for more ...
3
votes
1answer
95 views

Anomaly in 2-body simulation error

I've generated a solution for a planet motion around the Sun (placed at the reference frame center). I wanted to test what would I get for the error of the method I'm using (Runge Kutta with 4 stages, ...
0
votes
0answers
61 views

Shape recognition of tangientially connected polygons using openCV

Lately, I have encountered the following problem, namely how to recognize the shapes of particular polygons. I have realized that quite straightforward to do so when the polygons are separated by ...
0
votes
1answer
101 views

Numerical solution of ill-conditioned differential equation

I want to solve the following Cauchy problem \begin{equation} y' = y^2 + \frac{t^4 - 6t^3 + 12t^2 - 14t + 9}{(1+t)^2} \end{equation} with initial condition: $y(0) = 2$ for $t \in [0,1.6]$ using a 3 ...
3
votes
1answer
65 views

How does the diffusion of a finite volume method with a WENO scheme compare with that of spectral methods?

I know that, in general, finite volume (FV) methods are more (numerically) diffusive than spectral methods. However, I can't find any information on how the advection scheme changes that. For example, ...
-1
votes
1answer
74 views

Numerical solution of the advection equation with Crank–Nicolson finite difference method

I need to implement a numerical scheme for the solution of the one-dimensional advection equation $$\\\frac{\partial u}{\partial t} + C(x, t) \frac{\partial u}{\partial x} = 0 \\\\$$ $$ \\ C(x,t) = \...
3
votes
2answers
167 views

Using the BDF and RK4 methods to solve this coupled system of ODEs in C++

I'm trying to solve a system of ODEs using the BDF order 4 method. I find the first 3 points using RK4, then for the implicit part of the BDF, I use Newton-Raphson iteration. Unfortunately my solution ...
1
vote
0answers
56 views

Book recommendation on numerical methods for solving Integro-Differential equations

I was wondering if anyone could recommend a good book or resource on numerical methods for solving integro-differential equations? Of course I am familiar with the methods for solving ODEs and PDEs ...

1
2 3 4 5
18