# All Questions

8,453 questions
Filter by
Sorted by
Tagged with
5k views

### Poisson equation finite-difference with pure Neumann boundary conditions

I'm trying to solve a 1D Poisson equation with pure Neumann boundary conditions. I've found many discussions of this problem, e.g. 1) Poisson equation with Neumann boundary conditions 2) Writing the ...
85 views

### Solution of thermal analysis using finite element

I want to solve a thermal analysis using finite elements. The governing equation is $$C \frac{dT}{dt}+K T = Q$$. When using backward differencing for time, the resulting equation is quite straight ...
139 views

### Ising model simulation offset critical temperature and interal ernergy

I'm writing a code for the Ising model using WHAM (the weighted histogram analysis method)，But it seems to produce critical temperature and internal energy wrong. (newest rewritten code is below) <...
307 views

44 views

### How to compute the computational cost and storage of the Full Orthogonalization Method?

About the analysis of Full Orthogonalization Method (FOM) in Prof. Saad's book, wrote as follows: Algorithm 6.4 (FOM): \begin{array}{l} r_0=b-Ax_0,\beta=\|r_0\|_2,v_1 = r_0/\beta\\ Define \quad H_m ...
65 views

### How to divide points on a 3D complex surface into two regions based on a closed curve defined on this surface?

My problem seems simple but I can't find an algorithm that will do that for me for any 3D complex surface. I have a really complex shape 3D surface and a closed curve on it defined by some points (...
77 views

### How do I globally change the precision of a piece of code in Python to debug it?

I am solving a system of non-linear equations using the Newton-Raphson method in Python. This involves using the solve(Ax,b) function (...
679 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 ...
332 views

### Should benchmarkings be done at all? What is the point?

I am reading a paper which compares algorithm A versus algorithm B. It shows that algorithm A is faster than algorithm B via benchmarking that shows the CPU time. What is the point of this? Any ...
126 views

### Elliptic PDE finite volume method with Dirichlet boundary condition

I want to discretize the following equation using a Finite Volume Method $$\nabla \cdot (a(x)\nabla u)=f(x)\\x\in \Omega \subset \mathbb{R}^2 \\u_{|\partial\Omega}=g$$ I'm using Voronoi cells here: ...
243 views

### How to make a less diffusive code to solve 2D advection equation?

I would like to solve the following differential equation numerically in 2D, $$\frac{\partial z^-}{\partial t}+(\vec{B}\cdot\vec{\nabla})z^-=0,$$ see Wikipedia if you are curious about what the ...
143 views

### Incorporating a potential barrier in a wave-packet simulation (Fourier Transform method)

I'm trying to simulate the scattering of a wave-packet at a potential barrier in Python. I'm using a Fourier Transform method (not sure if its the same as the Split-Step method), where I apply Fourier ...
25 views

### Multibody Systems modeling disadvantages [closed]

Multibody Systems modeling is a very systematic approach usually results in large sparse Jacbian matrix. I am working to model a system consisting of 11 bodies and 63 constraint equations as soon as i ...
112 views

### Block-matrix: optimal fill-in reduction for LU factorization

Consider a square $N \times N$ block-matrix $\mathbf{A}$, where each $n \times n$ block $\mathbf{A}_{ii}$ is either a dense block or a zero-block. So, $N$ denotes the number of blocks, $n$ denotes the ...
53 views

### Stably solve transport equation with source term

I am trying to solve a transport equation of the form for the variable $\psi(t,r)$ $$\partial_t\psi-\alpha(r)\partial_r\psi-\beta(r)^2\psi-f(t,r)=0 ,$$ where I am solving ...
121 views

### How suitable is multigrid method for time-dependent PDEs?

For elliptic PDEs (Poisson-type), the multigrid method is very sufficient, but how about time-dependent problems (i.e parabolic or hyperbolic PDEs)? Is it efficient to solve such problems using a ...
292 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. ...
39 views

### Nonlinear least squares optimized Jacobian calculation

I have a nonlinear least squares problem, in which I am trying to minimize residuals which can be divided into four classes: $$\min_x ||\epsilon(x)||^2 + ||\xi(x)||^2 + ||\delta(x)||^2 + ||s(x)||^2$$...
900 views

### Nearest positive semidefinite matrix to a symmetric matrix in the spectral norm

So I have a symmetric matrix $A$ and I would like to solve the optimization problem, $$\hspace{2.5mm}\text{Minimize}\;\; \|A-S\|_2$$ $$\hspace{-5mm}\text{Subject to}\;\; S\geq0.$$ $A$ is given and $S$ ...
188 views

23 views

### How to simulate a PDF using data samples like this?

I know two methods to simulate a PDF from random data samples using MATLAB : 1) Using a histogram where I use this command histogram(data,'Normalization','pdf'), it gives PDF like bins. 2) Another ...
200 views

86 views

### Numerical bottlenecks

On a desktop scale computer, what are the most important bottlenecks (RAM vs. CPU, single vs. multithread) for numerical calculations? I'm specifically most interested in exact diagonalization and ...
327 views

### What are the major differences between GMRES and FOM?

I am reading Professor Saad's "Iterative Methods for Sparse Linear Systems" (2nd edition). The basic algorithm for FOM is given on page 166 and the basic algorithm for GMRES is given on page 172. ...
90 views

### Immersed boundary method in FEniCS?

I have looked at the FEniCS tutorials and documentation but I cannot find any mention to the possibility of implementing an immersed boundary method (IBM) for fluid dynamics. In particular, I want ...
463 views

### Why MATLAB chooses the Householder in its built-in function gmres.m?

Recently, I have studied how to construct an orthonormal basis for Krylov subspace to solve $Ax=b$, where $A\in \mathbb{R}^{n\times n}$ is nonsingular. As we know, there are usually 4 ways to ...
51 views

### Estimation of viscosity from critical properties

The above graph represents reduced viscosity as a function of reduced temperature for several values of the ...
70 views

I'm looking to find a computationally efficient solution to a large system of nonlinear equations. I'm trying to maximize the following function: $$f(\vec{x}) = \sum_i^N C_i (x_i-A_i)x_i^{\epsilon_{... 1answer 135 views ### How to optimize sampling for global sensitivity analysis What is a good way to sample parameters for performing global sensitivity analysis? Some methods are defined using integrals, some are use Monte Carlo. How do these compare? 1answer 69 views ### Prove that the set of maximizers are independent of parameter in the objective function A maximization problem reads as$$ J(y) = \sum_{k=1}^{K} \sigma_k(y)^q \mathop{\rightarrow}^{y} max$$where q \in [1,\infty] is a user-defined parameter and functions \sigma_k, k=\{1,\dots,K\} ... 1answer 14 views ### How to Collect fraction in Maple 18? [closed] Suppose I have$$f=\frac x 3+ \frac y 3 +\frac z 3$$And I want to use collect(f, 1/3) And I wish it will displays$$f=\frac1 3(x+y+z)$$But it doesn't work.... 1answer 85 views ### Modelling flow through pipe networks I'm trying to educate myself on modelling solute flows through pipe networks. This is a follow up of my previous post here$$\frac{\partial C}{\partial t} = - v\frac{\partial C}{\partial x}$$While ... 0answers 36 views ### How to avoid density getting “deleted” in two way rigid body coupling with LBM CFD? I've been reading this paper recently, which talks about using Lattice Boltzmann methods and two way coupling. Specifically, it outlines fluid solid coupling, and solid fluid coupling, and how simply ... 1answer 317 views ### The Formula of Explicit Runge-Kutta Fourteen order I need an explicit Runge-Kutta 14th order formula. If you know about some reference that discusses at least 10th order (or higher, since I'm looking for the 14th) of Runge-Kutta and there is ... 2answers 67 views ### How to understand the choice of Krylov subspace orthonormal basis? This semester, I study the Krylov subspace iterative methods (about Ax=b) using the book H. A. Van der Vorst. Iterative Krylov Methods for Large Linear Systems, volume 13. Cambridge University Press, ... 3answers 602 views ### Create mesh for complicated 3D object for finite element analysis I see images of steel connections, concrete dams, and other complicated 3D objects in papers which finite element analysis has been performed on them. My questions are: How these objects are created ... 1answer 53 views ### Is it possible to resample grid in such a way so that continuous objects remain continuous? Suppose I rasterize a rectangle of width 2.5 gridpoints and get the values as shown: =============== | 0 | 1 | 1 | 0.5 | 0 | Now I resample that ... 1answer 79 views ### Compute the function between two images Take an image f with some characters on it (below, hjFu3). Let's apply a filter h on it to obtain a second image g where the text is not visible. Is there a way to compute what kind of filter ... 1answer 111 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 ... 1answer 93 views ### Numerical stability in the product of many matrices I have to calculate in numpy the matrix-product of many matrices (~400). Are there common practices to increase numerical stability? If this is relevant, the matrices are 300\times 300 orthogonal ... 1answer 339 views ### Increasing V-cycles for constant Coarsest Grid Size and increasing Fine Grid size Problem statement I implemented geometric multigrid for -\nabla^{2}=f where f=\frac{3\pi^{2}}{4}sin \frac{\pi x}{2} sin \frac{\pi y}{2} sin \frac{\pi z}{2} on \Omega \in [0,1] on a unit cube. ... 2answers 66 views ### How to use natural logarithm inside Expression on FENICS I'm trying to evaluate the exact solution of heat diffusion in circular plate. I'm not able to use the natural logarithm inside expression. ... 0answers 36 views ### Complementary quadratic knapsack problem The quadratic knapsack problem (QKP)$$\max_x x^TPx\mathrm{s.t.}\;\;w^Tx\leq c,\; x\in\{0,1\} where $P\geq0, w\geq0$ elementwise, is well studied and has existing solvers. My problem below ...
I use software for pollutant propagation on rivers that takes as input a set of parameters ($p_1,p_2,\ldots,p_n$) and creates an output file which is basically a matrix where on each row the ...
Last week, I have learned the details of the robust iterative methods of PCG, MINRES, GMRES, which will converges to the exact solution $x^*$ of nonsingular system within $N$ steps for \$A\in \mathbb{R}...