Questions tagged [numerics]

The tag has no usage guidance.

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

Rank of a double-precision augmented matrix

Let $A$ be a matrix with real entries, and let $A_+$ be $A$ augmented by a single column. From linear algebra we know \begin{equation} \operatorname{rank}(A_+) = \operatorname{rank}(A) \hspace{10pt} ...
1
vote
1answer
46 views

Numerical integration problem: IntegrationWarning The integral is probably divergent, or slowly convergent

I am trying to get the numerical integration of a function using scipy's integrate.quad as follows. $$ \begin{equation} G (\alpha) = \frac{4\alpha}{\pi}\int_0^{\...
0
votes
0answers
61 views

Ill-conditioned stiffness matrix

I am writting a Fem code in c++ for a 2d plane stress model. My question is regarding the assembly stiffness matrix.I noticed that some elements of the matrix are not exactly zero but insted a number ...
-1
votes
0answers
33 views

V-Cycle Multigrid Finite Difference Solution to 1D Elliptic Problem

I am attempting to implement a V-cycle multigrid method for solving the 1D Poisson problem with finite differences. The implementation is done in Matlab. The issue that I have encountered is that, ...
1
vote
0answers
63 views

Error curve does not oscillate in between reference points using Remez

Using the Remez algorithm, implemented using multi-precision library, in certain functions that I want to approximate, the error curve does not oscillate in between reference points, and so no roots ...
0
votes
1answer
35 views

Linearization of Remez algorithm rational case

In the rational case, we are interested to find polynomials $P(x)$ and $Q(x)$ s.t. $f(x_k)-P(x_k)/Q(x_k)=(-1)^kE$ for $k=1,2,\ldots, N$ where $N=deg(P)+deg(Q)+2$ This can be rewritten as $$ (1)~~~~~~(...
1
vote
1answer
74 views

Least Square fit of a system of equations

I've a matrix equation $\bar z^{(r)}(k + 1) = \bar{DF} ~ \bar z^{(r)}(k)$. Now the $\bar z$'s and $\bar{DF}$ are $d \times d$ matrices. Now $\bar{DF} = \begin{pmatrix} 0 & 1 & 0 & 0 & \...
0
votes
0answers
22 views

offline Bin Packing problem with multiple size bins

As per my research on stack overflow communities, This is probably known as cutting stock problem / multiple Knapsack problem (a variant of the bin packing problem) which is NP hard. here are the ...
2
votes
0answers
76 views

Remez algorithm convergence

I have implemented the Remez algorithm in Python where all calculations were done with the Python mpmath library. I have noticed that sometimes the $|E_{max}|$ and $|E_{min}|$ do not monotonically ...
2
votes
1answer
144 views

Finite element (1D) for steady state non-linear problem

I need to solve with linear finite elements the equation $$\frac{\partial }{\partial x}\Bigl(\text{sgn}(x) u \Big) +\frac{\partial}{\partial x} \Bigl[ \sqrt{u} \frac{\partial u}{\partial x} \Bigr] =0$...
1
vote
1answer
111 views

Non-Linear advection diffusion with nondifferetiable advection term

I'm looking at Murray's book: Mathematical biology: an introduction , first volume, pag. 404 In particular, I'm interested to solve the following PDE: $$\partial_t u = \partial_x (\text{sign}(x) u) + \...
2
votes
1answer
85 views

Ill-condioned Linear System and Gaussian Elimination

Suppose that I have a linear system $Ax=b$ such that $A$ is ill-conditioned. Can I say that it is dangerous to find a solution with Gaussian Elimination for this system, or does there exist some class ...
1
vote
0answers
64 views

How can I practice multivariable root-finding?

Recently, I've been reading up on various root-finding / optimization algorithms such as the Levenberg-Marquardt method, Gauss-Newton, Conjugate Gradient, trust-region and trust-region-dogleg. I've ...
1
vote
1answer
59 views

Imposing pressure variation instead of Dirichlet boundary conditions on Finite Element Method

I always see Finite Element codes solving PDE with Dirichlet or Neumann boundary conditions. But, I have a problem now consisting of a straight cylinder with a circular base (a simple 3D tube), with ...
0
votes
0answers
95 views

Solution of Cahn-Hilliard equation

I need to solve the Cahn-Hilliard equation $$\frac{\partial u}{\partial t} = \Delta(f(u) - \epsilon^2\Delta u), \hspace{.5cm}(x, t)\in \Omega\times(0, T],$$ using mixed formulation \begin{equation}\...
0
votes
0answers
45 views

Norm estimates if adjoints can't be computed

Assume that you have two linear maps $A$ and $V$. For a given $x$ (of appropriate dimension) you can compute $Ax$ numerically, and for any $y$ (of appropriate dimension) you can calculate $V^Ty$ ...
4
votes
1answer
106 views

Accurate and efficient computation of the logarithm of the ratio of two sines

For exploratory work related to special function implementations, I need to compute $\log \frac{\sin y}{\sin x} $, where $0 \le x \le y \le 2x < \frac{\pi}{2}$. Cases with $x \approx y$ in ...
2
votes
1answer
59 views

Parity for artificial dissipation term in a finite-difference solution

I have a doubt regarding the signal of the dissipative term in a finite difference solution for an equation of the form $$ \frac{\partial u}{\partial x}+f(x)=0, u(0)=0 $$ In which $f$ is an odd ...
0
votes
0answers
42 views

numerical solution to pde on an ellipse

Looking for advice on discretization (preferably finite difference) schemes for pdes on curves in general, but in this case it is an ellipse (so given by $(a\cos(r), b\sin(r)$). The problem is the ...
2
votes
1answer
66 views

Find quadrature points and weights

I'm struggling with the following problem: What is the maximum degree of exactness that we can obtain with the following quadrature >formula $$\int_0^1 f(x)\frac{1}{\sqrt{x}}dx \approx w_0 f(x_0) +...
0
votes
1answer
68 views

Interpreting multivariable root-finding results from Matlab's fsolve algorithm

Edit: So I was able to get the same value of r that's given, when coding up the sum of squares of function values directly in the script file, rather than on the Command Window. So, maybe there's a ...
0
votes
2answers
60 views

No flux Neumann boundary condition for non-stationary PDE equivalent to Dirichlet boundary?

When using no flux Neumann boundary conditions (i.e. zero derivative to the normal on the boundary) in a non-stationary PDE, I don't seem to recognize the difference to using Dirichlet boundary ...
3
votes
1answer
132 views

How to use numerical integration to calculate the surface area of a superellipsoid?

I am working in an application in which I need to calculate the surface area of a superellipsoid. I have read that there is no closed form solution (see here), so I am trying to compute it using ...
0
votes
0answers
19 views

Grid Independence Study

Is the change in time step necessary for the grid independent study? As the CFL is based on the relation between dt and dx. In mesh independent study, only change should be mesh i.e, dx isn't it so?
0
votes
0answers
26 views

Set of integrators do not consistently solve an equation in Python

I must solve the following second order differential equation: $\delta \phi^{''}_{\mathbf{k}}+(3-\epsilon)\delta \phi^{'}_{\mathbf{k}}+\left(\frac{k^2}{a^2 H^2}+\frac{V_{,\phi\phi}}{H^2}-6\epsilon +4\...
0
votes
1answer
64 views

Extracting data from VTK simulations using C++

I have been given a few numerical simulations regarding fluid mixing and have been asked to extract a few parameters from them using C++. Altogether there are about 1000 VTK files per simulation, and ...
4
votes
1answer
95 views

Imposing no flux boundary conditions on variants of the Cahn-Hilliard equation using Finite Differences in Python

I have been looking into simulations of phase separation in variants of the Cahn-Hilliard system and have been running into issues with implementing no flux boundary conditions on certain variants. ...
0
votes
0answers
54 views

The error in SOR algorithm suddenly falls to zero when it reaches 1e-7 range

I am solving the Poisson equation for heterojunction using Fortran90. I use the SOR algorithm to arrive at the potential profile. I see the weird behavior where the error (the difference between the $...
0
votes
0answers
25 views

Abnormalities when using SOR to solve the Poisson Equation

I am trying to solve the Poisson equation for Heterostructures using SOR. The equation to solve looks lik I have discretized the Poisson equation using finite difference and my code is written in ...
2
votes
1answer
85 views

Computing Series of $ke^{-(x - h)^2}$

I asked this question on the Computer Science stack exchange (https://cs.stackexchange.com/questions/128710/faster-computation-of-ke-x-h2), but it appears that it is more appropriate in Computational ...
0
votes
0answers
32 views

Numerical simulation for a bounded process. Is slight deviation a “normal” fact?

Suppose I have to numerically simulate a process $\{y_t\}$ such that $y_t\geq0$ $\forall t\in\mathbb{N}$, with $t$ denoting time-step. Let's suppose I use MonteCarlo with $\mathscr{N}$ simulation ...
1
vote
0answers
32 views

Discretization formula for a system of two differential equations. “Solution to one of these is the initial condition of the other”. In which sense?

Consider the following stochastic differential equation \begin{equation} dy=\left(A-\left(A+B\right)y\right)dt+C\sqrt{y\left(1-y\right)}dW\tag{1} \end{equation} where $A$, $B$ and $C$ are parameters ...
0
votes
1answer
72 views

interface value on the error equation

https://www.jstor.org/stable/pdf/2157482.pdf, here I have a problem in last equation of (2.6) in section (2.1). When they are considering error equation on the interface $\Gamma$ they get $e_v^{(n)} = ...
0
votes
1answer
84 views

Which scheme for inhomogeneous convection-diffusion equation with highly variable coefficients?

I have a 1D convection-diffusion equation $\sigma_t = a(x,t) \sigma_{xx}+b(x,t)\sigma_x+f(x,t)$ defined on the unit interval, with nonzero Neumann boundary conditions at both ends. It should be noted ...
2
votes
1answer
92 views

Calculate stable time step DG method for advection-diffusion

For stable time steps for the RKDG method for transport equations we require that $$ \Delta t \le \frac{\Delta x CFL}{(2k + 1)|\lambda|}, $$ where $\lambda$ is the eigenvalue of our conservation law ...
1
vote
1answer
58 views

Linear system with an l1-norm constraint

I have a saddle-point system of the form \begin{equation} \begin{bmatrix} A & B \\ B^T & O \end{bmatrix}\begin{bmatrix} x\\ y \end{bmatrix} = \begin{bmatrix} f \\ \vec{0} \end{bmatrix}, \end{...
1
vote
0answers
37 views

Euler Explict Method for solving the PDE for option prices under the Schwartz mean reverting model. Numerical Finance

I have to solve the following PDE for a Call option : $\partial_tV + \{ \alpha - (\mu - \lambda/ \alpha -log(S))\}S\partial_SV + 1/2 \sigma^{2}S^{2}\partial_{S}^{2}V - rV = 0$ Where V(S,t) is the ...
2
votes
1answer
67 views

Accelerating convergence of a generalized continued fraction

I wish to compute $$ \frac{1}{1 + \frac{1^3}{1 + \frac{2^3}{1 + \frac{3^3}{1+\cdots} } } } $$ to high accuracy. To start, I tried computing $$ \frac{1}{1 + \frac{1^2}{1 + \frac{2^2}{1 + \frac{3^2}{1+\...
1
vote
0answers
90 views

Is Romberg integration method implemented as weighted function values numerically correct?

I have to integrate expression f(x) * g(x) for many different functions f but just one g. I ...
5
votes
1answer
142 views

Accurate computation of Gauss-Kuzmin entropy

The Gauss-Kuzmin distribution gives the probability of an integer appearing as a partial denominator in the continued fraction of a real number $x$ as $$ P(a_k = k) = -\log_2\left(1 - \frac{1}{(k+1)^2}...
0
votes
0answers
27 views

Error analysis of Modified Lentz's method

In Numerical Recipes, the authors state: There is at present no rigorous analysis of error propagation in Lentz’s algorithm. This statement is now ~15 years old, so I wonder has this gap in the ...
3
votes
0answers
41 views

Numerical calculation of the Berry connection

I'm doing some numerical calculations involving Hermitian matrices, and derivatives of the eigenvectors. Essentially, I have an n x n, Hermitian matrix H(x), which is dependent on some continuous ...
5
votes
1answer
93 views

Accurately Computing a Positive Vector in the Nullspace of a Matrix

I'm sure this question has been asked before yet after many hours of searching I am unable to find a definitive answer. The problem at hand is solving the linear system: $$A \mathbf{x} = \mathbf{0}$$ ...
0
votes
1answer
131 views

Red flags for numerical computing?

I've learnt the hard way that you should avoid: computing small numbers as the difference of two large numbers evaluating chaotic functions with imprecise inputs. Are there any other red flags a ...
0
votes
0answers
23 views

At what l/d ratio will a frame element start to behave as a shell element?

I'm working in ETABS. There are few columns of dimension 300mmx1400mm. The height of building is 36.6 meter above ground level and the dimension of building is 26mx68m. I'm getting the time period of ...
0
votes
0answers
77 views

A parallelized GMRES solver?

My application calls for solving a dense, 40,000 x 40,000, ill-conditioned linear system. The native SciPy GMRES solver with preconditioning has worked well for my application and solving a single ...
3
votes
0answers
56 views

How to construct a Fortin Operator for Crouzeix-Raviart Element?

I want to prove the LBB condition for the Stokes Equations discretised by the Crouzeix-Raviart element. The continuous Stokes Equation in the weak formulation is Find $u \in H_0^1(\Omega, \mathbb{R}^...
0
votes
0answers
28 views

Simulating the response of nonlinear system with stiff differential equations

I want to simulate the response of a nonlinear system given in the following form: $$ \dot{x_1} = f_1(\bar{x_1})+g_1(\bar{x_1})x_2, \ x_1(0) = 0.2 $$ $$ \dot{x_2} = f_2(\bar{x_2})+g_2(\bar{x_2})x_3, \...
-1
votes
1answer
95 views

Numerical solution for gradient(slope)

Abstract I have the next equation to find a force, for my problem: $$U=-\int \vec{m}\small{(x)}\times \vec{B}(x)dV$$ $$\vec{F}=-\nabla U$$ Considering 3-dimensional space with x,y,z coordinates, ...
19
votes
4answers
3k views

Is half precision supported by modern architecture?

I am new to computer science and I was wondering whether half precision is supported by modern architecture in the same way as single or double precision is. I thought the 2008 revision of IEEE-754 ...

1
2 3 4 5
17