Questions tagged [numerics]

The tag has no usage guidance.

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

Scientific calculator device malfunctioning [closed]

https://en.wikipedia.org/wiki/Scientific_calculator Can there be scenario/s that a scientific calculator gives incorrect answers in calculations to the end user?
1
vote
1answer
197 views

Robin Boundary Condition with Implicit Upwind - Finite Difference Method for 2D Convection-Diffusion Equation

I am trying to solve a problem with 2D Convection-Diffusion equation with U = Concentration ($mg/m^{2}$) using Implicit Upwind Finite Difference Method like this $$ \frac{\partial U}{\partial t} + ...
1
vote
1answer
46 views

2-DOF Robotic Manipulator Trajectory Tracking Simulation

I am trying to simulate a 2-DOF planar robotic manipulator (have its joints follow a predefined trajectory) that's described by its dynamic model: $$ M(q)\ddot{q}+C(q,\dot{q})\dot{q}+G(q) = \tau $$ ...
3
votes
2answers
69 views

Dividing functions over a wide range-

I try to solve a system of coupled equations, where a very nasty division operation occurs. In fact, I need to compute a derivative of two exponential decaying functions. Let's illustrate this with ...
1
vote
0answers
24 views

How can I improve the accuracy of the calculation of the magnetic field in Gmsh/GetDP?

I need to calculate the magnetic field along a straight line in proximity of an array of 6 magnets. I used the tutorial files "magnets" included in Gmsh and I slightly modified the file in ...
3
votes
3answers
4k views

How to get ODE solution at specified time points?

The code below basically illustrates my problem. It is a test code for a pendulum. I solve it using a method suggested on https://stackoverflow.com/questions/12926393/using-adaptive-step-sizes-with-...
2
votes
2answers
113 views

Numerical Methods of solving a non-linear ODE?

I want to solve the nonlinear equation $\frac{d^2x}{dt^2} + k\sin x = 0$, numerically. I found that solving this elliptic integral would be cumbersome, so is there a numerical method i could use to ...
2
votes
1answer
69 views

Best practice for ADTs in computational science with Fortran

I have been writing a software package in Fortran for solution of the Vlasov-Poisson system in 2D2V. I want this software to be useful beyond its current application (e.g. systems with different ...
2
votes
1answer
52 views

Cauchy Lorentzian simulation on FFT with oscillation

Recently I do simulation on Lorentzian Function with FFT Lorentzian Function is 2a/(x**2+a**2) ...
0
votes
1answer
45 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
votes
0answers
23 views

Could anyone illustrate using examples, the difference between machine epsilon and an underflow?

I have recently gotten started on Numerical Analysis and I was hoping that someone could help clarify the idea of these two concepts to me. Using specific examples of floating-point operations that ...
2
votes
0answers
81 views

Algorithm for computing inner products multiple times

I am taking a computational linear algebra course and i got stuck during a homework problem concerning the computation of inner products. I am supposed to compute the inner product:$$\mathrm{a}_{\...
0
votes
2answers
56 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
32 views

discretizing advection equation with variable wave speed + stability

I currently have a code that solves $u_t+ cu_x=0$ with periodic boundary conditions, and constant $c$ (using an upwind method). I'm wondering how I would alter this code to solve something of the form ...
0
votes
1answer
183 views

Time complexity of numerical finite differences

I have a function $f:\mathbb R^N\to \mathbb R$ and I would like to compute all the partial derivatives of $f$ w.r.t. the $N$ input. What is the computational complexity using the (ones-sided) finite ...
2
votes
1answer
78 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
62 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
1answer
70 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
0answers
63 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
vote
0answers
65 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 ...
1
vote
1answer
75 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
1answer
116 views

Galerkin method for heat equation

I'm working out the Galerkin method for the heat equation $$\frac{\partial u}{\partial t} - \frac{\partial^2 u}{\partial x^2} = 0$$ subject to $u(0,t)=0,u_x(1,t)=v(t)$. I want to use a Fourier basis ...
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
149 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
113 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
96 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
65 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
60 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
99 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}\...
4
votes
1answer
109 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 ...
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$ ...
2
votes
1answer
61 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
44 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
67 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
118 views

Normalized legendre and quadrature basis for discontinous Galerkin method

I've successfully implemented a 1D DG code with non-normalized Legendre basis and I've now moved onto developing a 2D code using tensor products. For my 2D code I've chosen to have normalized ...
0
votes
2answers
86 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 ...
16
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 ...
2
votes
1answer
420 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 ...
3
votes
1answer
150 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
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)} = ...
2
votes
1answer
782 views

Local truncation error of Dufort Frankel Scheme

The scheme is given by $$\frac{v_m^{n+1}-v_m^{n-1}}{2k} + b\frac{v_m^{n+1}+v_m^{n-1}-v_{m-1}^n-v_{m+1}^n}{h^2} = 0$$ where $v_m^n$ is the numerical solution at the $m^\text{th}$ spatial coordinate ...
0
votes
0answers
28 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
65 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
105 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
55 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 $...
2
votes
1answer
68 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+\...
11
votes
1answer
162 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 ...
0
votes
0answers
26 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
0answers
188 views

Extracting FEM matrices in matlab pde toolbox

I am trying to follow the dynamic linear elasticity in Matlab, link here. My goal is to extract the FE Matrices using the function assembleFEMatrices in matlab and solve the resulting system of second-...

1
2 3 4 5
17