Questions tagged [numerics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
282 views

What is a relative condition number of a sum of positive values?

We want to compute the relative condition number of: $$x_1+x_2+x_3+\cdots$$ We assume all values are positive, and we will do a limit of a large $x_1=10^{8}$, and smaller values for all the other ...
1
vote
0answers
220 views

Newton - Raphson method : maxima of function in 2 variables

I am computing the maximum of a function (with two-variables) using Newton-Raphson method. The function is : $e^{-(x \ - x_0)^2 - (y \ - y_0)^2}$, whose maxima exists at $(x_0,y_0)$. The Jacobian ...
0
votes
1answer
285 views

Crank-Nicolson method and mixed derivatives

I am curious if anyone had literature references or knowledge on how to apply the Crank-Nicolson (with approximate factorization) to the $$ \nabla \cdot (\nu (\nabla \mathbf{u} + \left(\nabla \mathbf{...
8
votes
2answers
283 views

Lagrange multipliers space is too rich in a mathematical view

Background: Lagrange multiplier method has been employed in numerous fields, such as contact problems, material interfaces, phase transformation, stiff constraints or sliding along interfaces. It is ...
1
vote
0answers
172 views

the augmented global stiffness matrix is not positive semi-definite using Lagrange Multipliers method within FEM

The augmented global stiffness matrix is not positive semi-definite when using Lagrange Multipliers method to enforce boundary constraints on a simple square domain of integral form: I am considering ...
1
vote
1answer
72 views

finite difference for a second order ode

I saw in a code for discretization of something like $\frac{d^2T(x)}{d^2x}$ , ( $x = sin(\theta)$ ) tries ...
2
votes
2answers
130 views

How does Mathematica compute real and complex solutions to single, non-polynomial equations?

This question on StackOverflow has led me to ask myself what would be involved in solving an equation like this one using tools available to the Python programmer. $$ \frac{0.125567841}{d^{2.25}} = \...
3
votes
1answer
71 views

SIRS Model doesn't depend on initial conditions?

So i have been working (as an undergrad, by working i mean "Redoing a few things my professor does") in a SIRS model for epidemies. SIRS stands here for: Susceptible -> Infected -> Recovered -> ...
0
votes
1answer
117 views

Error measure for a simple finite difference scheme

I am responsible for assisting with certain error measurements for an FE program. The idea is to set up some benchmark comparisons which we can use for future development of the program. To simplify ...
1
vote
0answers
105 views

Definition of CFL number in Arbitrary Lagrangian-Eulerian framework

In an Eulerian frame of reference, the CFL number is defined as $$\sigma=\frac{u \Delta t}{\Delta x}$$ with $u$ the magnitude of the fluid velocity. A restriction such as $\sigma<1$ for time ...
3
votes
1answer
246 views

How to compute the Frobenius norm of matrices whose entries are either too large or too small?

While implementing in Matlab the Frobenius norm of a matrix $$\| A\|_{\text F} := \sqrt{ \sum_{i=1}^m \sum_{j=1}^n a_{ij}^2 },$$ a problem arises when numbers are too big or too small: If a number ...
3
votes
0answers
86 views

How to optimize for decay constant in exponential-like function?

I've got a data set of points $M_O .. M_N$ for time points $t_0 .. t_N$, where $N$ is approximately 10-20, and the spacing of time is not uniform (i.e., $t_{i+1}-t_i$ is not constant for all i). It is ...
3
votes
1answer
277 views

Numerical calculation sum of exponential functions

I have to repeatedly calculate a function which contains a sum of a large number (~100) of exponential terms: $f(x) = \sum_{r=1}^{100} C_r e^{b_r \cdot x}$ There is no relation between the $C_r$ ...
4
votes
1answer
252 views

Clenshaw-type recurrence for derivative of Chebyshev series

The naive summation of a Chebyshev series \begin{align*} f(x) = \frac{c_0}{2} + \sum_{k=1}^{n-1} c_{k}T_{k}(x) \end{align*} which employs the three-term recurrence for evaluation of the Chebyshev ...
0
votes
1answer
101 views

finding the growth rate from numerical data

Suppose i have a bunch of 10 data points and i have to conclude whether the increase is $n^2,n^3,\cdots,2^n,3^n, e^n,\cdots$. For example i have the image:- Now the increase is either polynomial or ...
1
vote
0answers
19 views

Does excitation type matter in a time-domain simulation/computation of a transfer function of an LTI system?

Let's say I am running a FDTD simulation of a wave-equation to determine a transfer function of an LTI system: \begin{equation} H(f) = \dfrac{Y(f)}{X(f)}\ \end{equation} where $Y(f)$ and $X(f)$ are ...
4
votes
1answer
124 views

Using GSL for basic operations

I am learning C/C++ for Scientific Computing and I have a question regarding the usage of scientific libraries for basic operations. Suppose I have to write a small program in C for a bioinformatics ...
4
votes
2answers
172 views

Literatures on numerical stability of optimisation algorithms

I am curious of whether optimisation algorithms (whatever simplex, active-set quadratic programming, interior point sequential etc.) can fail due to numerical errors and how to avoid them. But I ...
4
votes
1answer
118 views

Reference Request: Raviart Thomas with hanging nodes

I am interested in reading about the analysis (existence, uniqueness, error estimates) of elliptic problems solved with a Mixed method that uses the Raviart Thomas elements (so far so good, easy to ...
6
votes
3answers
2k views

Galerkin method: Test functions vs. Basis functions

I'm a novice to finite element and I'm finding quite hard to find the actual difference between Test function(s) and Basis function(s). I would be glad if somone could explain me that and point out ...
2
votes
1answer
97 views

interpolation 2D irregular nodes

Given a 2D irregular spaced data like shown in the figure, I would like to know how to find derivatives at '*' by interpolating the values at 'o'. Does lagrange 2D interpolation work at irregular ...
6
votes
1answer
280 views

Is there any point to using hypot() for $\sqrt{1+c^2}$, $0 \le c \le 1$ for real numbers

It is conventional wisdom that programmers should use std::hypot whenever one implements an expression of the form $r = \sqrt{x^2 + y^2}$ In my example, my ...
0
votes
2answers
236 views

Boundary conditions for streamlines in enclosed flow

I am trying to solve Lid driven square cavity flow problem of Stokes equation using finite element method. I have boundary conditions for velocity as zeros on every boundary but u=1 on top boundary. ...
2
votes
1answer
120 views

How to deal with numerical errors in electrostatic field calculations

I want to trace electrostatic field lines emerging from 2D surfaces in 3D space. Eventually I want to find their intersection with an (uncharged) mesh. The charge distribution $\sigma(x), x \in \...
0
votes
3answers
139 views

How to determine a PDE which is structure-preserving (energy, mass conserved)?

How to determine if a PDE is structure-preserving (energy,mass conserved)? Are there some standards in judging the preserving-structure? Or rather, how to derive the formulation of energy-preserved ...
1
vote
3answers
600 views

Pressure boundary condition in lid driven cavity using finite element method

Thank you all 1.) I am trying to solve lid driven cavity problem for an incompressible Stokes and Navier Stokes equations using general "Mixed" finite element method. dirchlet boundary conditions are ...
1
vote
0answers
75 views

Computing the change of function at two close points without cancellation

I want to compute the difference $\Delta f(x_1,x_2) = f(x_1)-f(x_2)$ of a smooth function $f(x)$ at two points $x_1$ and $x_2$ which are close to each other. The magnitude of the expected result, $|\...
1
vote
0answers
48 views

Discrepancy in estimating boundary stencil for finite difference method

I am trying to estimate the FD stencil for boundary as mentioned in this paper (section 4.1) using MATLAB. The stencil order (6th) is higher than the one mentioned in paper (4th). $$ f_1' +\alpha f_2'...
2
votes
2answers
385 views

Runge Kutta (RK4) to solve coupled harmonic oscillators [duplicate]

I have the same problem as in this question. But can someone elaborate on the answer? The poster says that: Solving this system of 4 ODE's with rk4 will solve for all your state variables ...
0
votes
1answer
251 views

Trying to plot 1D wave equation for benchmarking

I am trying to plot a reference solution for the 1D wave equation using python. The above link states the following: For a rod fixed at the right end and free at the left end and subjected to a ...
3
votes
2answers
330 views

Difference in performance of preconditioned GMRES and MINRES

I have two matrices $A, B$ coming from a finite element discretization of a system of partial differential equations. $A$ represents the system matrix and is symmetric and indefinite. $B$ is symmetric ...
0
votes
1answer
504 views

How can this multidimensional integral be efficiently implemented in python using Gauss-Hermite quadrature

I'm playing around with dynamic programming and need to calculate a multidimensional integral $E[V(W)]$ where we assume $W$ has a log normal distribution. I was looking at the following example in ...
1
vote
2answers
142 views

How to deal with big numbers in intermediate calculations?

I have a rather long expression (https://pastebin.com/jUsxdCCs) that is an analytical solution of a set of differential equations generated symbolically from Maple. I need to solve a set of equations ...
-1
votes
1answer
1k views

Using scipy.odeint to solve coupled equations [closed]

I have a set of three coupled autonomous equations: ${y_{1}}\prime = y_{1}(\frac{\Omega_{m}}{y_{1}^3} + \frac{y_{3}^2}{6.0} + \frac{V(y_{2})}{2.H_{0}^2})$ $y_{2}\prime = y_{3}$ $y_{3}\prime = -3\frac{...
1
vote
0answers
138 views

Time-dependent Schrodinger equation(time-dependent Hamiltonian)

This question was already asked here and this is a suitable form of the equation for numerically solving. \begin{align*} i\frac{\partial}{\partial t}u_{\ell}(r,t) = \Bigg(-\frac{1}{2} \frac{\partial ^...
4
votes
3answers
859 views

How to solve the transcendental equation: $\tan(x) = \frac{2x}{x^2-1}$

I'm interested in finding the roots of the following equation: $\tan(x) = \frac{2x}{x^2-1}$. It is easily seen that 0 is a root and the roots are symmetric w.r.t. 0. I wonder if an analytical ...
1
vote
0answers
208 views

Double Integrating acceleration data to obtain position: 2 Problems

I have a data sample from an accelerometer from my phone (pretty bad accelerometer though). I'm trying to double integrate it in order to obtain the position as a function of time. I'm using a program ...
1
vote
1answer
255 views

1-D turbulent energy spectra in homogeneous direction (non-isotropic)

I am trying to compute the one-dimensional energy spectra for my channel-flow simulation. I have already written a post-processing script to achieve this; however, I need to validate my code before ...
1
vote
1answer
54 views

Calculating a limit as parameter goes to infinity

I have a fair background in pure mathematics and right now my project is a numerical implementation of a certain algorithm. I have some numerical background, but not all that much, so the question is ...
1
vote
0answers
378 views

How accurate is cumtrapz in MatLab?

Say I have a set of discrete acceleration data and want to integrate it to get a set of velocity data. How accurate is the cumtrapz (Cumulative trapezoidal ...
3
votes
1answer
133 views

Stability of PDE Discretizations with Multistep Time Discretizations

Let's pretend we have a spatially discretized PDE of the following form: \begin{align} \frac{\partial^2 \boldsymbol{u}^k}{\partial t^2} = D\boldsymbol{u}^k \end{align} where $D$ can be any form for ...
0
votes
1answer
477 views

Set of linear ordinary differential equations with a mass matrix

What methods are known for efficiently solving a large set of linear homogeneous ordinary differential equations of the following form? \begin{equation} \mathbf{B} \frac{d\mathbf{y}}{dt} = \mathbf{A} \...
4
votes
1answer
237 views

Interpolating a mathematical function using a Hermite Cubic Finite Element Space

I have a Hermite Cubic Finite Element Space on a computer in the form of Matlab m-files. More specifically, I can evaluate four "shape functions" $N_1, N_2, N_3,$ and $N_4$, for which the following ...
2
votes
1answer
67 views

Legendre expansion of $r(x) = f(x)/g(x)$ using a finite number of samples from $f(x)$ and $g(x)$

I have two finite sets of events $\{x_1, ..., x_N\}$ and $\{y_1, ..., y_N\}$ that are sampled from the PDFs $f(x)$ and $g(x)$, respectively, where $x \in [-1,+1]$. I want to estimate the Legendre ...
1
vote
0answers
29 views

Simulation of a lens, insufficient points

I am simulating the propagation of a light pulse using the equation $$\frac{\partial}{\partial z}A=\frac{1}{2\cdot k_0}\nabla^2_rA$$ with $$k_0=\frac{2\pi}{\lambda_0}$$ The propagation with a step ...
0
votes
1answer
581 views

How to construct an ellipsoid using Ansys design modeller (or any other 3D CAD software) [closed]

I am working on numerical simulation of breast model to evaluate the use of thermal imaging for breast cancer detection. To do this I need to construct an ellipsoid rotated 30 degrees around y-axis ...
2
votes
0answers
810 views

Using RK2 Method to solve the simple harmonic oscillator of a horizontal mass on a spring (1D)

Being new to numerical analysis techniques, in particular RK2, I decided the best way to jump in is by using python to solve the well known mass-spring oscillator using RK2 techniques. My problem is ...
3
votes
2answers
68 views

Bounded approximation to a bounded function

I have a non-negative function $f(x) \ge 0$ defined on the interval $[a,b]$. I would like to have a finite-dimensional approximation to this function that is guaranteed to be non-negative on $[a,b]$. ...
9
votes
2answers
423 views

How much regularization to add to make SVD stable?

I've been using Intel MKL's SVD (dgesvd through SciPy) and noticed that results are are significantly different when I change precision between ...