All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

How to use the solution of a multistage stochastic program?

Given a multistage stochastic program, its solution (if it exists) consists of the first decision vector, as well as all the recourse decision vectors for all possible scenarios of an event tree. But ...
0
votes
0answers
4 views

existance of the solution of a PDE controlled by a value at spatially fixed point

I have a stable numerical solution for the equation shown below. However, using a simple separation of variables an instructor demonstrated non-existence of the solution for such problem. Could ...
1
vote
0answers
5 views

2-dimensional Gauss-Hermite quadrature in R

A similar question was asked here and the given answer is perfect for a unidimensional integration. I need to make bidimensional integration in R with a Gauss-Hermite quadrature: $$\int_{R^2} h(p1,p2)...
0
votes
0answers
32 views

A name for a numerical phenomena when using numerical methods

I have a nonlinear solver for equation $g= c_1f(x_1,y_1)+c_2f(x_2,y_2)$. Note that $c_1$ is much bigger than $c_2$. So after using Levenberg–Marquardt algorithm, I could only get $x_1$, $y_1$ and $...
1
vote
1answer
33 views

Filling a volume with generalised polyhedra

Given a volume (say, some polyhedron), I need to fill it with smaller polyhedra, such that the space is filled as much as possible. The constraints and relaxations are: (0) For a computation ...
1
vote
1answer
41 views

Application of Poiseuille equation

I'd like to know whether the Hagen-Poiseuille equation can be used to solve for the velocity of fluid when the Reynolds number (Re) is less than 1. From textbooks, I understand that the Hagen-...
2
votes
0answers
50 views

Explanation of subspace strategy regarding CG described in Golub's book

I was wondering about the last paragraph in Matrix Computations (4th edition) by Golub, Chapter 11 (11.3.3), specifically his explanation of subspace strategy for Conjugate Gradient. Note that in ...
-2
votes
2answers
82 views

solving coupled ODEs using runge kutta method

I want to solve the following sets of n coupled equations. Initial values of $x_{n}(t)$ and $p_{n}(t)$ are specified. The problem is, I have an 1D lattice where every particle is bound with ...
0
votes
0answers
25 views

Propagation of a Gaussian beam using FFT

I am trying to simulate the propagation of a gaussian beam through a lens using an FFT approach. I tried to implement the approach described by Couairon in this paper at page 43: https://link....
4
votes
2answers
2k views
1
vote
1answer
55 views

How to choose between compact finite differences and spectral methods

For a project in my advanced numerical method class I have to solve the 1D Kuramoto-Sivashinsky equation. $$ u_t + u u_x + \lambda u_{xx} + \eta u_{xxxx} = 0. $$ As explained here I will solve it ...
0
votes
0answers
22 views

How to implement the gmres method using Householder transformation instead of the Gram-Schmidt?

For Generalized Minimal Residual method GMRES, we usually use the Modified Gram-Schmidt MGS to generate an orthonormal basis of ...
1
vote
1answer
43 views

Type of Rosenbrock method by its coefficients

A Fortran code that solves stiff PDE systems contains the following arrays of Rosenbrock-Wanner method coefficients: ...
4
votes
0answers
64 views

evaluating $\coth(x) - 1/x$ for real x, on 2 “pieces”

The function $\coth(x) - 1/x$ has a removable singularity at 0. Its Taylor series is: $$ \coth(x) - 1/x = \frac{x}{3} - \frac{x^3}{45} + \frac{2x^5}{945} + \ldots $$ I would like to evaluate the ...
1
vote
2answers
53 views

Why Householder transformation can not be chosen to be an identity matrix?

For Householder transformation, we know that $H = I-uu^T$, where $\|u\|_2=\sqrt{2}$. When it acts on any vector $x$, $Hx$ and $x$ is symmetric with respect to $span(u)^T$. But I have read a ...
1
vote
1answer
43 views

Initial condition for Kuramoto-Sivashinsky

For a project in my advanced numerical method class I have to solve the 1D Kuramoto-Sivashinsky equation of which I know little. I just know that it was derived the equation to model the diffusive ...
3
votes
0answers
43 views

Solving saddle point problem having non-invertible top-left block with a PETSc nested matrix

My system is a symmetric FE problem with lagrange multipliers: $Z=\begin{pmatrix}A & C^T \\ C & 0\end{pmatrix}$ The matrix $A$ is positive semi-definite, non-invertible. The whole matrix is ...
3
votes
0answers
31 views

Hit-n-Run Monte Carlo on convex polytope

So, I'm currently trying to implement a MCMC to uniformly sampling hyper-points from the polytope defined as $\mathbb{K}=\{x\in\mathbb{R}^{n}\;\;\text{s.t.}\;\; A\,x=b \}$ in the specific case where, ...
2
votes
1answer
110 views

Efficient ways to numerically evaluate matrix exponentials

What are some computationally efficient ways to solve matrix exponentials, i.e. functions of the form : f(X)=$e^{X}$, where X is a square matrix ? So far I have been able to diagonalise some ...
0
votes
0answers
38 views

HSS preconditioner with gmres [closed]

I have a question about HSS preconditioner with GMRES method. For implementing the HSS preconditioner with GMRES, we need to solve the linear system of the form (I + H)(I + S)z =r, for a given r at ...
1
vote
1answer
50 views

Using adolc for the sign function in c++

Here is an implementation of the sign function in C++ using Adolc librairy for automatic differentiation. ...
1
vote
1answer
31 views

Determinant of a matrix after removing or adding lines and columns

In quantum mechanics, the wavefunction of N electrons is given by a determinant. I am working on a Monte Carlo algorithm. At each Monte Carlo step, I need to add or remove an electron, which means ...
2
votes
2answers
83 views

Inverting really big symmetric block matrix

I have a really big symmetric 7.000.000 X 7.000.000 matrix that i would like to invert. The matrix is extremely sparse and it can be rearranged as to become a block matrix. The biggest blocks are ...
4
votes
0answers
48 views

Why the two Gram-Schmidt algorithms produce different results for qr factorization?

For the qr factorization using classic Gram-Schmidt algorithm, I found the 2 different implementations below. The first one uses the for loop to compute the upper ...
2
votes
1answer
49 views

pdepe or Crank-Nicolson? How much is pdepe good?

I am beginner in MATLAB and similar. I sow and discussed with my professors doing simulations some times: they wrote down a lot of calculus, most of them using Crank-Nicolson Method and so implement ...
1
vote
2answers
166 views

How to simulate over 1 billion particles?

I want to simulate human erythrocytes in capillaries. I calculated, that for a 1 meter long and 1 mm in diameter capillary there are about 3 billion blood cells. Erythrocytes are actually discs, but ...
4
votes
1answer
60 views

Why the solid FEM problem can not be solved after constraining 3 degrees of freedom?

I write a simple MATLAB code for solving solid FEM problem. The problem looks like that (1) (2) x-------x | / | | / | | / | x-------x (3) (4) ...
31
votes
2answers
11k views

why is A*v+B*v faster than (A+B)*v?

$A$ and $B$ are $n \times n$ matrices and $v$ is a vector with $n$ elements. $Av$ has $\approx 2n^2$ flops and $A+B$ has $n^2$ flops. Following this logic, $(A+B)v$ should be faster than $Av+Bv$. Yet,...
1
vote
2answers
86 views

Is the similar subdivision of a delaunay mesh still delaunay?

I have a delaunay triangulation for a 2d box with say an airfoil inside. If I uniformly refine this mesh by subdividing each triangle in the mesh into 4 triangles by halving each edge, is the ...
-1
votes
0answers
28 views

How to compute the gradient of T with Armadillo library [closed]

I am using the Armadillo library to solve a 3d heat conduction problem on 3d unstructured grid system,the gradient of the T field is determined by the least square method. I have created a matrix ...
0
votes
0answers
49 views

Is it possble to do this complex symbolic calculation with Matlab?

Sorry it's bit abrupt, but recently I am caught up in some symbolic calcualtion which is tedious and almost impossible with mere human hands, so just wondering is it possible to solve the double ...
-1
votes
0answers
5 views

Change value of dependent sweep varietals

I am using Comsol to model a really hard problem. I am using the sweep for one variable (width), and as the problem state (Length=2*width). When I use the sweep the value of Length does not update. ...
12
votes
4answers
680 views

Example where autodiff works but symbolic differentiation will not?

According to the survey paper on autodiff (linked) Autodiff works on inputs that cannot be specified in closed form but can be described by a sequence of code, each component of which is ...
4
votes
1answer
111 views

Computation of triple nested loops as a convolution product?

I'm trying to compute efficiently the following \begin{equation} A_j = \sum_{l'=1}^{\infty}\sum_{k= 0}^{K-1} L_{l'}T_ke^{2\pi i \frac{k}{K}j}\epsilon_{l',k} \end{equation} for $j = 0,1, \ldots, K-2,K-...
1
vote
0answers
52 views

Can Representation Theory be studied computationally / numerically?

Can a subfield such as the representation theory of Lie algebras be studied computationally / numerically -- is there an interplay between the abstract and the concrete? I would be grateful for an ...
2
votes
1answer
52 views

Solution method of nonlinear heat transfer analysis

The governing equation of transient heat transfer analysis is described as follows: $$C \frac{dT}{dt}+K T = Q$$ When using backward difference scheme for the discretization of the time we get the ...
1
vote
2answers
157 views

How to vectorize 2 nested for loop with one complex condition in the inner loop?

Octave calculations is too slow specially when you deal with scientific calculations that can span a very very large matrix, even just iterating. I have to vectorize it to speed up the calculation. ...
2
votes
1answer
80 views

Is this a valid way to implement Neumann BCs in finite differences?

I'm trying to solve the 1D heat equation with Neumann boundry conditions numerically using finite differences: $$u_t = \alpha u_{xx}$$ $$u_{x}(0, t) = u_{x}(L, t) = k$$ $$u(x, 0) = u_0(x)$$ The main ...
0
votes
2answers
41 views

contour plot of cloud of points [closed]

I have a cloud of points scattered in a rectangle and some data in this points, a bit like this $$ x(:)=[x(1), x(2), ..., x(N)] \\ y(:)=[y(1), y(2), ..., y(N)] \\ u(:)=[u(1), u(2), ..., u(N)] $$ ...
4
votes
0answers
83 views

Trying to understand splitting-based iterative method for 2D Laplace problem

I am trying to understand the theory behind a splitting based iterative method which uses the incomplete Cholesky factorization. Before giving the specific details, let me first give the problem ...
-1
votes
0answers
56 views

Simulating an object in orbit

This question is more oriented around suggestions for simulation tools and how to approach simulating an object in orbit. So high level I am trying to simulate the concept of a Sky Hook. What are the ...
2
votes
0answers
35 views

Avoid matrix multiplication in algebraic multigrid method

Currently when I try to solve a linear algebra system of the form of $A x =b$ I use the algebraic multigrid method. The algebraic multigrid method uses a Galerkin product to form the coarse grid ...
3
votes
1answer
81 views

Can one publish a new model and simulation without physical experiments?

When I read strong papers from, say, the Journal of Fluid Mechanics, a simple model, simulations and physical experimental results are given, showing good agreement. Can one publish a new model and ...
3
votes
1answer
74 views

Calculation of Mean Square Displacement for Brownian dynamics system with Lennard Jones interactions in python3

I have a problem getting a sensible result for the Mean Square Displacement (MSD) for a simulation of $N$ particles under Brownian dynamics with Lennard-Jones interaction between them with or without ...
3
votes
0answers
32 views

Integer partition algorithms

I am familiar with and have written MathCad algorithms for the partition functions 𝑝(𝑛,𝑘),which gives the number of ways of partitioning 𝑛 into 𝑘 parts, 𝑞(𝑛,𝑘), which gives the number of ways ...
3
votes
0answers
49 views

Levinson Recursion for Non Square Toeplitz Matrices

Given a rectangular Toeplitz Matrix $ H $, how could one solve: $$ y = H x $$ For instance, $ H $ can be Linear Convolution Matrix of the filter $ h $: $$ H = \begin{bmatrix} {h}_{1} & 0 & ...
1
vote
0answers
46 views

Numerical methods. MDF (ILU) implementation

I am trying to implement Minimum Discarded Fill (MDF) Ordering algorithm for incomplete matrix factorization. The algorithm description is here on page 60 Preconditioning Techniques for a Newton–...
8
votes
1answer
150 views

When training a neural network, why choose Adam over L-BGFS for the optimizer?

More specifically, when training a neural network, what reasons are there for choosing an optimizer from the family consisting of stochastic gradient descent (SGD) and its extensions (RMSProp, Adam, ...
0
votes
0answers
44 views

Heat diffusion simulation in a 3D piston using FENICS

I'm trying to simulate the heat diffusion in a 3D piston. I marked the boundaries on GMSH. I have used a Dirichlet BC of 300 on the top face of piston. But the results look abnormal. There is a ...
3
votes
0answers
51 views

What is the reason for this finite-difference high errors on non-uniform grid?

tl;dr Using a Taylor-matched method to find coefficients for the discretized equation $ \mathbf{A} \vec{f}'' = \mathbf{B} \vec{f} $, a Fortran code has been implemented to find the second derivative ...

15 30 50 per page