Questions tagged [numerics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
84 views

Piecewise Quadratic Lagrange

I am trying to program the pieceewise quadratic lagrange, but I have to deal with these intervals at which the point I am trying to evaluate belongs to. So, essentially you need to have an if ...
4
votes
1answer
123 views

Trust region - Newton: how to choose constants that determine trust region bound

In a trust region based Newton method, a number of constants are given as inputs to the algorithm that determine the updating rules for the trust region bound. Are these constants chosen arbitrarily ...
10
votes
5answers
5k views

Integral in log-log space

I'm working with functions which, in general, are much smoother and better behaved in log-log space --- so that's where I perform interpolation/extrapolation, etc, and that works very well. Is there ...
1
vote
0answers
122 views

1-D finite differences with piecewise linear solution

I was having some lectures and I didn't quite understand the following: let's say you have a grid like $$G=\{ x \in \mathbb{R} : x = x_j = hj, \ j = 0,1,...,n,\ h=1/n\}.$$ And you write in ...
5
votes
1answer
336 views

Solving $ (A^{-1} + D)^{-1} v $ with low rank Cholesky factors of $A$

I have a large matrix $A \in \mathcal{R}^{N\times N}$ which is supposedly positive-definite, but numerically low rank. Instead of $A$, I have its incomplete Cholesky factor $G$, such that $A \simeq GG^...
2
votes
1answer
365 views

MAC Projection in Projection method?

My question concerns the following paper: A Conservative Adaptive Projection Method for the Variable Density Incompressible Navier–Stokes Equations (http://www.sciencedirect.com/science/article/pii/...
1
vote
3answers
1k views

Unexpected results of MATLAB's ode45

Whilst working with MATLAB recently I encountered something odd that I cannot explain. I was using the ode45 solver to solve a system of two coupled second order ODEs. I wasn't convinced about the ...
4
votes
2answers
429 views

Accuracy of numerical methods in finding eigenvalues

I have a problem with assesing the accuracy of my numerical calculation. I have a 2nd order ODE. It is an eigenvalue problem of the form: $$ y'' + ay' + \lambda^2y = 0, $$ and the boundary condiations ...
2
votes
2answers
173 views

Why have specialised upwind schemes been developed to solve hyperbolic equations?

Are upwind schemes such as Godunov type methods superior to central differencing schemes? Do the reasons include superiority in modelling hyperbolic problems with Dirichlet BC's?
2
votes
1answer
341 views

Improving my QZ-Algorithm (Include Shifts)

I Need to to solve an generalized Eigenvalue Problem and to compare two Methods (QR and QZ) concerning their convergence rate and execution time. I started with the Basic QR-Algorithm, implemented in ...
1
vote
0answers
54 views

should boundary conditions be effecting moving mesh results?

I have a question on the use of moving mesh to solve the inviscid euler equations. I have solved the following equations: $$\frac{\partial}{\partial t}\left[\begin{array}{c} \rho\\ \rho u \end{array}\...
3
votes
0answers
532 views

Difference between fast and normal Givens Rotations?

would someone be so kind as to explain me the difference between the ordinary givens-rotation and the fast givens-rotation? I know that the fast givens Rotation reduces the Count of operations to ...
8
votes
2answers
8k views

Use of machine learning in computational fluid dynamics

Background: I have only built one working numeric solution to 2d Navier-Stokes, for a course. It was a solution for lid-driven cavity flow. The course, however, discussed a number of schemas for ...
5
votes
1answer
245 views

Numerical methods for solving a mixed type nonlinear PDE

What type of numerical methods are there to solve PDE of the sorts of: $$\begin{align} &f(x,t,u(x,t))u_{xx} - g(x,t,u(x,t))u_{tt} = F(x,t,u(x,t))\\ &u(x,0)=G_1(x)\\ &\frac{\partial u(x,0)}...
3
votes
1answer
685 views

How to perform the sensitivity analyses of ODE with several parameters?

I have the system which is described by several ODE. The solution looks good for me. Now I need to implement the sensitivity analyses of parameters which I used in the model. Therefore, I have the ...
2
votes
1answer
231 views

Quadrature order for finite elements and time dependent discontinuous Galerkin

When setting up a finite element system you have to use quadrature to calculate the integrals. I'm having trouble understanding what order rule to use. I know of some rules of thumb, for example with ...
2
votes
0answers
44 views

Manipulating/Extracting Data and Developing Methods - Language Choice [closed]

As a general programming enthusiast and aspiring Bioinformatician student I have an intermediate understanding of computing (languages) as well as Java, and to a lesser extent C++. Having knowledge in ...
2
votes
2answers
104 views

Building minimization optimization problem for 2nd-order elliptic PDE

I am solving elliptic PDE problem, for which, Euler scheme looks as following: $$ \nabla [\gamma ( |\nabla u|^2) \nabla u] = 0,$$ where $$\gamma(|\nabla u|^2) = (1 + |\nabla u|^2)^{-1/2}. $$ I am ...
0
votes
1answer
167 views

Decoupling integral $\int f(x+ y )-f(x) dy = \int f(x+y) dy - \int f(x) dy$ in a numerical integration scheme?

Let us say I want to compute the following expression by a numerical integration scheme: $$ I = \int^{-x}_{-\infty} f(x + y) \, \mathrm dy - \int_{\mathbb R}\bigg(f(x+y) -f(x)\bigg)\, \mathrm dy $$ ...
1
vote
0answers
50 views

A better way to compute a double integral involving a infinite series?

Let $D_{\nu}(.)$ is the parabolic cylinder function (http://mathworld.wolfram.com/ParabolicCylinderFunction.html) And $\Gamma(.)$ is the Gamma function. Define $s_y(\mu,\nu,t,z)=2^{\nu}\...
18
votes
1answer
2k views

How to Run MPI-3.0 in shared memory mode like OpenMP

I am parallelizing code to numerically solve a 5 Dimensional population balance model. Currently I have a very good MPICH2 parallelized code in FORTRAN but as we increase parameter values the arrays ...
1
vote
1answer
178 views

Computation of plane wave scattering on semi infinite plane

I have attempted to code up the simple math required to plot the total field set up by an incident plane wave on a semi-infinite flat plate which can be found here. To summarise: $$\phi_s(r,\theta ) ...
4
votes
1answer
110 views

Comparing finite differences methods

I am currently writing my dissertation on different methods for pricing barrier options. As part of this, I have implemented a finite differences method for solving one partial differential equation, ...
2
votes
2answers
323 views

Polynomial approximation

Is there any universal method to fill this matrix for any $n$ value: $\textbf{A} = \left[ \matrix{n & \sum x_i & \sum x_i^2 & \cdots & \sum x_i^n \cr \sum x_i & \sum ...
0
votes
1answer
86 views

what is the upper bound of $\max \mathbf{w}^T\mathbf{x}_i$

I need to find an equation for the upper bound of $\max \mathbf{w}^T\mathbf{x}_i, \; i=1, \dots N$. where $\mathbf{w}$ and $\mathbf{x}_i$ are two vectors. I need to find a function $f$ which holds ...
1
vote
0answers
105 views

How to compute this double integral?

Let $$T=1, K=100, S_0=100, \sigma=0.05, r=0.15. $$ Define $\nu:=\frac{2r}{\sigma^2}-1$ and $$H(y,z)=\frac{z e^{\pi^2 /4y}}{\pi \sqrt{\pi y}}\int_0^{\infty} e^{-z \cosh(u) -u^2/(4y)} \sinh(u) \sin(...
11
votes
1answer
545 views

scale invariance for line-search and trust region algorithms

In Nocedal & Wright's book on Numerical Optimization, there is a statement in section 2.2 (page 27), "Generally speaking, it is easier to preserve scale invariance for line search algorithms than ...
3
votes
0answers
190 views

Numerically solving a system of partial integro-differential equations in Matlab

Given the following system of partial integro-differential equations $$ \frac{dX(t)}{dt}=\Lambda-\mu X(t)-\beta X(t)Z(t),\\ \frac{\partial Y(t,\omega)}{\partial t}+\frac{\partial Y(t,\omega)}{\partial ...
2
votes
0answers
116 views

Calculating theoretical order of accuracy of least squares fit advection scheme

I'm familiar with finding the order of accuracy using von Neumann analysis for finite difference schemes formulated using Taylor series expansions. But is there a similar technique for finding the ...
1
vote
0answers
74 views

fixed point iteration to find out second order non-linear diff equations

I am working on some model analysis, getting two diff equations and after I convert them into matrix form, I have equations looks like $$ [A][X]=C\times\big(\exp([B][X])-1\big), $$ where $C$ is a ...
2
votes
1answer
275 views

How to calculate $det(X^TX)$ efficiently, update one column of X each time

$X_{1} = (A, b)$, where $X_{1}$ is a $n\times p$ matrix, $A$ is a $n\times (p-1)$ and $b$ is $n\times1$. update $b$ with $c$,Is there any update method to compute more efficiently?
3
votes
2answers
301 views

Numerical Solution of the Advection Dispersion equation

I am facing a simple (at first glance) problem. I need to implement a numerical scheme for the solution of the first order wave propagation equation with chromatic dispersion included. My original ...
3
votes
1answer
1k views

How can I solve wave equation for circular membrane in polar coordinates?

The original equation is $$\frac{1}{c^2} \frac{\partial^2 u}{\partial t^2} = \frac{\partial^2 u}{\partial r^2} + \frac{1}{r}\frac{\partial u}{\partial r} + \frac{1}{r^2}\frac{\partial^2 u}{\partial \...
6
votes
1answer
92 views

Reference request: theory regarding time evolution of closed loop 2D elastic shapes?

I am interested in approximating the time evolution of 2D curves. Here's an illustration: An issue that arises when naively making this approximation as illustrated above, is that as one increases ...
4
votes
2answers
7k views

Error in result of finite-difference approximation when refining

I have calculated the first derivative of following equation using Euler method (first order), Three point Finite Difference method (second order) and Four point Finite Difference method (third order)....
2
votes
1answer
79 views

Shifting points in fortran

Hello I am trying to shift points which have been previously generated in the square area. I am having a trouble with some additional conditions how they should have been shifted. ...
10
votes
2answers
814 views

About faster approximation of log(x)

I had written a code a while ago which attempted to calculate $log(x)$ without using library functions. Yesterday, I was reviewing the old code, and I tried to make it as fast as possible, (and ...
3
votes
5answers
213 views

Distance between points

I am wondering how can I solve following problem. Arrange randomly $n$ points inside a square of side $a$ under the condition that the distance between any two points may not be smaller than 1. I ...
5
votes
1answer
395 views

Error propagation in recurrence relation

I have a recurrence relation $$P_{n} = A_{n} P_{n-1} - B_{n}P_{n-2}$$ with given $P_{0}$ and $P_{1}$. Numerically, each $A_{n}$ and $B_{n}$ is calculated with some precision. The same applies to ...
7
votes
1answer
275 views

How to avoid overflow error in program that computes product of two numbers, such that when one is big enough to cause overflow, other is $0$?

Let us say that I have a function like so: def f(x): return g(x)*h(x) Now, g(x) and ...
2
votes
1answer
402 views

Monte Carlo Double Integration Implementation

Am implementing a monte carlo integration routine to compute this double integral in eqn 0.3 of page 2 of this paper 'Mobius energy of knots and unknots', Annals of Mathematics, http://www.math.ucsb....
1
vote
1answer
48 views

Resources exploring the problem of “volume exclusion”?

Consider the following situation: There are two boundaries -- one is denoted using grey lines, and the other is denoted using black lines. The boundaries are numerically represented using "vertices", ...
3
votes
0answers
238 views

matplotlib contourplot for $\log z$ in the Complex Plane $\mathbb{C}$

I tried using Python's matplotlib on the logarithm and here is what I got, a kind of starburst pattern. Since the angle jumps between $\theta = 0$ and $\theta = 2\pi$, contour assumes there is a ...
1
vote
1answer
117 views

Is this the correct procedure for calculating matrix spectrum?

I am not sure if my question is on topic but I have a piece of Fortran code that is used to perform successive over relaxation. Prior to performing successive over relaxation the author is calculating ...
4
votes
1answer
228 views

Trust-region Newton: implementation issue with Conjugate Gradient calculations

UPDATE: The problem turned out to be the step (refer penultimate paragraph below) where I was factoring out a small value from the vectors of the numerator and denominator and then computed dot ...
3
votes
0answers
193 views

Stability analysis for explicit time discretization in the Finite Element Method

I have been looking for stability analysis of general reaction-diffusion problems, of the form $\frac{\partial u}{\partial t}=\nabla\cdot D\nabla u-k\,u$ , to be solved using the standard Finite ...
2
votes
0answers
63 views

Need a smart way to numerically take residues in a multidimensional integral

I'm trying to do an integral of the form $\int_C f(u,v) $, where $C$ is a set of contours in $u$ and $v$. In particular, each variable's contour starts at $-\infty+i \epsilon$, goes around a branch ...
-2
votes
2answers
113 views

Ways to solve numerically differential equations in C [closed]

I have to solve numerically a differential equation in C. The equation is: How can I write some code to solve it? Are there some numerical methods (Runge-Kutta maybe?) to solve it? A colleague ...
0
votes
1answer
111 views

How many sample points are needed when re-constructing linear combination of 2D polynomials defined over unit circle?

I have a set of first 25 Zernike polynomials. Below are shown few in Cartesin co-ordinate system. z2 = 2*x z3 = 2*y z4 = sqrt(3)*(2*x^2+2*y^2-1) : : ...

1
11 12
13
14 15
18