Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [numerics]

The tag has no usage guidance.

0
votes
1answer
44 views

What is required for a numerical method to solve an IVP? [on hold]

I have an ODE with the initial condition: $y'=2r\sqrt{y}$, $y(r=0)=1$. I am thinking of using either Forward-Euler method or Leap-Frog to solve this numerically. However before I implement a ...
6
votes
2answers
203 views

Is Highams' computation of mean worth the price?

In Accuracy and Stability of Numerical Algorithms, equation 1.6a, Higham gives the following update formula for the mean: $$ M_{1} := x_1, \quad M_{k+1} := M_{k} + \frac{x_k - M_k}{k} $$ Ok, one ...
0
votes
1answer
79 views

calculating integral for an ODE system

I have an ODE system defining a mathematical model of a biological system, say $$ \frac{da}{dt}=f_1(a,b,\ldots,z,p)\\ \frac{db}{dt}=f_2(a,b,\ldots,z,p)\\ \cdots\\ \frac{dz}{dt}=f_n(a,b,\ldots,z,p) $$ ...
4
votes
2answers
94 views

SLATEC Routine Computes Givens Rotation in Unexpected Way

Some Background I am working on a C++ translation of a SLATEC routine, R1UPDT, which performs a Givens rotation: $$r = \frac{1.0}{\sqrt{a^2 + b^2}}$$ Usually, ...
1
vote
2answers
82 views

How I could calculate L2 norm of an unstructured grid?

I want to calculate L2 norm of a 3D unstructured grid to compare my simulation results in two different mesh sizes as coarse and fine. I read this answer and it seems in three-dimensional space, I ...
2
votes
1answer
103 views

Poorly conditioned, easily evaluated sum for unit testing

I am looking for examples of poorly conditioned sums which can rapidly be evaluated, for the purposes of unit testing. I'm currently using the series representation for $\ln(2)$: $$ \sum_{n=1}^{\...
1
vote
1answer
91 views

Relation between conjugate gradient method and finite elements method

What is difference beetwen this two method? Are these methods far from each other or are these methods complement each other? Could you take an example?
-1
votes
0answers
34 views

Can I solve a non-negative non-linear least squares problem by solving for the square root of my desired solution and squaring it?

I'm hoping to use the Gauss-Newton method to solve a non-linear least squares problem where the solution $\boldsymbol x$ must be non-negative. To do this can I instead solve for $\pm \sqrt{\...
4
votes
1answer
83 views

Numerically find the nearest positive semi definite matrix to a symmetric matrix

I have a symmetric matrix $M$ which I want to numerically project onto the positive semi definite cone. To do so, I decompose it into $M = QDQ^T$ and transform all negative eigenvalues to zero. (...
0
votes
1answer
61 views

Approximation of ODE solution using Taylor series methods

This is my first post on here, so please excuse mistakes if any. I am trying to plot out the difference between two ODE solvers based on Taylor series: 1st order acccurate: $x(t_0 + h) = x(t_0) + ...
2
votes
2answers
133 views

Generate high n quantum harmonic oscillator states numerically

How can I generate the higher $n$ quantum harmonic oscillator wavefunction (in position space) numerically? Here, higher means around $n=500$, or say $n=2000$, where $n$ is the $n$th oscillator ...
4
votes
2answers
87 views

Analytical convergent sequence and numerical divergent sequence

Is it possible to construct a sequence that converges in theory but when computed numerically with a computer program is diverging. I feel that today our computer programs doesn't allow such ...
2
votes
3answers
182 views

How does a stiff equation solver work?

I am trying to understand how stiff differential equations are solved. For instance the equation, $$\frac{\partial y}{\partial t} = \alpha\frac{\partial ^2 y}{\partial z^2}$$ can be solved using ...
3
votes
1answer
105 views

Derivation of backward differentiation formulas(BDF)

I have been reading upon numerical techniques that are used to solve stiff ordinary differential equations. From the description given here, I could follow the steps till equation (5). I am finding ...
1
vote
0answers
55 views

Implementing boundary condition

I'm studying the transport of species A in the blood vessels, $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2}-v\frac{\partial C}{\partial x}$$ At x=0, I want to use the ...
3
votes
1answer
91 views

Golub-Kahan-Lanczos Bidiagonalization Procedure implementation doesn't produce bidiagonal matrix

I'm trying to implement the aforementioned procedure using this website as a reference. At the end of the page the algorithm is described as follows: I think I've mapped the given algorithm to code ...
3
votes
0answers
63 views

Library for solving multidimensional (n > 3) hyperbolic PDE systems

Does there exist a library (in any programming language) for solving (numerically) systems of multidimensional first-order linear PDEs in the form $$\mathbf{u}_{t}+\hat{A}(\mathbf{x})\mathbf{u}_{\...
1
vote
1answer
36 views

Wrong results for $2$ stage multistep method $y_{n+2} - y_n = h\left[(1/3)f_{n+2} + (4/3)f_{n+1} + (1/3)f_n\right]$

I need to fix a code to utilise the $2$ stage multistep method : $$y_{n+2} - y_n = h\left[(1/3)f_{n+2} + (4/3)f_{n+1} + (1/3)f_n\right]$$ Since this is an implicit method, I used a Newton-Raphson ...
4
votes
0answers
65 views

Solution of constrained system of ODEs

Can someone point me in a direction to solve this kind of integral constrained system of ODEs. \begin{align} &\int_0^{1/2}\dot{y}^2(t)=p\\ &2\lambda_1\ddot{y}(t)+\pi cos(\pi y(t))=0\\ &y(...
1
vote
2answers
39 views

Determine conditions on parameters (for consistency) on RK method $y_{n+1} = y_n + ha_1f(t_n,y_n) + ha_2f(t_n + b_1h, y_n + b_2hf(t_n,y_n))$

I'm asked to find the conditions on the coefficients $a_1,a_2,b_1,b_2$ in the RK method $$y_{n+1} = y_n + ha_1f(t_n,y_n) + ha_2f(t_n + b_1h, y_n + b_2hf(t_n,y_n))$$ such that is consistent of (a) ...
0
votes
1answer
53 views

Numerical solution of non-linear first order partial differential equation (HJB)

I am trying to solve a simple optimal control problem using the Hamilton-Jacobi-Bellman equation, numerically in Python. This is proving to be rather difficult as I end up having to solve the ...
4
votes
0answers
75 views

Comparing sum of floating points

I am currently working on a numerical algorithm involving a lot of floating point arithmetic, involving some badly conditioned problem sets. I am using the relation $|x - y| / (\max(|x|, |y|, 1)) \...
1
vote
1answer
93 views

Operation count for GMRES

One can use GMRES as it is, but there is also a version of GMRES called k-step restarted GMRES, which is used for large matrices, where $k$ is some fixed number of steps after which we take a new $x_0$...
5
votes
1answer
49 views

Mass matrix and BDF time integration

I have a system of nonlinear equations on the general form: \begin{align} \mathbf{M}(\bar{y})\dot{\bar{y}} =\bar{f}(\bar{y},t) \end{align} Where $\mathbf{M}(\bar{y})$ is a matrix and $\bar{f}$ is a ...
3
votes
2answers
135 views

Asymptotic error of forward Euler

I'm trying to understand the asymptotic error behaviour of forward Euler (finite difference method), as timesteps are decreased (refined), so I feel trust in the method of manufactured solutions (MMS)....
3
votes
0answers
79 views

Why the MIRACLE of Lanczos/CG-like?

Lanczos/Arnoldi/Rietz/CG-like algorithm share the same core strategy... In each, a little miracle appears, most of the Gram-Schmidt inner products are zeroes! In others words, new direction need only ...
3
votes
1answer
161 views

Computational complexity of Newton's method

the classical Newton's method for non-linear systems of equations is $x_{k+1} =x_k-J_F(x_n)^{-1} F(x_n)$. In pratice, rather than compute the inverse of the Jacobian matrix, one solves the systems $...
1
vote
0answers
36 views

Numerically solving a system of parabolic PDEs and 1st order ODEs

I'm trying to solve the following system of differential equations numerically. What are the available finite difference approaches and matlab solvers to solve such a system? Other approaches to solve ...
6
votes
1answer
106 views

How do I integrate a function defined over an arbitrary area?

Let's say, I have a compact area $S$ (for example a circle, a square or some arbitrary polygon) and a function $f: S \rightarrow \mathbb{R}$. I want to numerically calculate the Integral $$ \int_S f(\...
2
votes
0answers
29 views

Numerical stability while modeling wave equation in staggered grid

I have modeled a simple wave equation given by: \begin{align} & \begin{cases} u_t = v_x \\ v_t = u_x \end{cases} \end{align} Boundary conditions given on interval $M=[-1,1]$ by: \begin{align} u(...
5
votes
1answer
103 views

Numerical solution of two coupled nonlinear eigenvalue problems

I would like to numerically solve the following system of coupled nonlinear differential equations: $$ -\frac{\hbar^2}{2m_a} \frac{\partial^2}{\partial x^2}\psi_a + V_{ext}\psi_a + \left( g_a |...
-1
votes
1answer
67 views

Relation of Condition of a Matrix and Convergency

Can anybody explain me the relation between the condition of a Matrix and the convergency of a problem. For example how is the relation between the condition of the stiffness Matrix occuring in FEM ...
1
vote
0answers
72 views

why I cannot find explicit finite difference for elliptic equation

Let us think on the Poisson equation $\nabla^2 u(\bf{x})=\rho(x)$ with Neumann boundary conditions, with $\bf{x}=\it (x,y)$ in 2D. Here is a stencil with central differences in both $x$ and $y$ (...
1
vote
2answers
68 views

Guaranteed equality between binary results with increasing MPI processes

Testing on an MPI scientific code for compressible flow dynamics I noticed that the results may depend on the number of processors used for the calculation. In fact, comparing the binary files they ...
3
votes
1answer
123 views

Derivatives of Approximate Matrix inverses

I am cross posting this question to the mathermatics stack exchange. please find it either at this link, https://math.stackexchange.com/q/2952989/430980, or below: I have a question concerning the ...
2
votes
0answers
64 views

Efects from the boundary in advection equation [duplicate]

I am implementing the advection equation $u_x+(1/c)u_t=0$ following a Crank-Nicholson finite difference scheme. The equation for this is \begin{eqnarray*} -\frac{\gamma}{4} w_{n-3 j+1} + w_{n-2 j+1} ...
1
vote
0answers
86 views

How to solve an implicit ODE with forward Euler?

Consider the implicit ODE $$ M(y)\dot{y} = F(t,y) $$ If $M$ is non-singular for all $y$ How to use the forward-Euler method to numerically solve for $y$ without inverting $M(y)$? I only came out ...
1
vote
1answer
141 views

What is the difference between Abaqus and Calculix contact input?

I would like to say first that am new at using Calculix. I'm using Abaqus/CAE to create a cup deep drawing simulation and everything worked perfectly but my objective is to run the same exact ...
2
votes
1answer
57 views

PML boundary conditions

I set up two one-way wave equations for constant velocity $c$ in one-dimension. When I implement them I get a highly unstable (divergent) solution. I wonder if someone could give me a suggestion about ...
2
votes
0answers
74 views

How to numerically optimize affine transformations?

I need to optimize affine transformations for of a set of triangles using energy function based on the connectivity. The energy of an edge $e_j$ between triangles $T_a, T_b$ is given by $$ E_j = \...
2
votes
1answer
91 views

Euler Method Instability. Why?

I am currently enjoying writing computational codes as a hobby. Right now I've worked out an Euler method and results are pretty good with up to $x=1$. Over $x=1$, instability starts to kick in. May I ...
-2
votes
1answer
45 views

Calculate accuracy order/rate

I was doing error analysis of numerical scheme and I get $L_1$ error for each grid size with $N$ element. I was searching reference to compute accuracy order/rate from that error data but doesn't find ...
0
votes
4answers
236 views

Which Linux OS for computer science and numerical analysis

I am switching from OSX to Linux, which I am familiar with but have no greater experience. There are several different alternatives: archlinux, gnome, ubuntu etc. Which would you recommend for a PhD ...
2
votes
0answers
32 views

Sensitivity Lagrangian solution general case

I have asked this question already on maths and mathoverflow. Just a question about a literature reference. I am writing a paper for engineers. Usually for the Lagrange multiplier problem $$ \...
1
vote
0answers
33 views

Efficient numerical optimization of an “almost separable” function

I have come across an optimization problem with the following objective function: $$f(x_0,y_0,z_0,x_1,y_1,z_1,...,x_N,y_N,z_N) = \sum_{i=0}^N f_i(x_i,y_i,z_i, \alpha(x_{i+1}-x_i) + \beta(y_{i+1}-y_i))...
9
votes
0answers
107 views

Are there shortcuts for numerically approximating systems of ordinary differential equations when autonomous?

Existing algorithms for solving ODEs handle functions $\frac{dy}{dt} = f(y, t)$, where $y \in \mathbb R^n$. But in many physical systems, the differential equation is autonomous, so $\frac{dy}{dt} = f(...
4
votes
2answers
109 views

Estimating error at mid timesteps for Runge-Kutta methods

When a timestep $h$ is rejected using a Runge-Kutta pair, such as Dormand–Prince, the algorithm resumes from the same initial point $t$ with a smaller timestep. A different idea is to resume at an ...
4
votes
0answers
104 views

Compile-time error control vs. interval arithmetic?

I use interval arithmetic for reliable computing. Now, a procedure coded in a good implementation of interval arithmetic takes perhaps about eight times as much as the same procedure carried out ...
8
votes
1answer
71 views

Benchmark problems for eigenvalue reordering algorithms sought

Every real matrix $A$ can be reduce to real Schur form $T = U^T A U$ using an orthogonal similiary transform $U$. Here the matrix $T$ is quasi-triangular form with 1 by 1 or 2 by 2 blocks on the main ...
1
vote
1answer
133 views

Does a generic method for solving a system of PDEs exist?

There are generic methods for solving systems of ODEs numerically. Are there generic methods for PDEs? If so, what are they? If not, why not? To elaborate... Any set of ODEs can be written in ...