All Questions

Filter by
Sorted by
Tagged with
2
votes
0answers
17 views

Understanding the Eisenstat-Walker method for choosing the tolerance of a linear solver when solving a non-linear PDE

We are working on the solution of large non-linear PDE (say the Navier-Stokes equation) which we solve using Newton's method with an analytical formulation of the jacobian. For very large systems, we ...
2
votes
1answer
28 views

How to deal with pseudo-compressibility of lattice Boltzmann method when you are calculating mass flux?

In lattice Boltzmann method, we have a concept, which is called pseudo-compressibility and it is defined based on the fact that LBM simulates incompressible flows by having small Mach number to ensure ...
1
vote
0answers
18 views

Calculating the jacobian of norm and square root terms in the Finite Element Method

In the code that my group is writing (Lethe) we use a stabilized approach to solve the Navier-Stokes equation. The GLS stabilized method we use has a stabilisation term which contains a stabilization ...
-1
votes
0answers
29 views

Generate a non-equispaced grid with higher points in the middle

I know it's a really simple problem, but I'm quite stuck on it. I have $M+1$ points $x_0, \ldots, x_M$ frand want to create a non equispaced grid where the points have higher density in the middle. ...
1
vote
1answer
37 views

Attempting to perturb ODE when initial condition is equilibrium point does not work

I have the following system of differential equations: $$ x' = ax- cy + e1 $$ $$y' = by- dx + e2 $$ for variables $x,y$ and parameters $a,b,c,d,e1,e2$. I'd like to solve this in python, which is ...
4
votes
0answers
89 views

Integrators for Nonlinear/Stiff PDE

It was suggested I ask this question in this section. Anyway: I have a particular nonlinear PDE of the form $$ u_t(x,t)=iu_{xx}(x,t)+f(x,u(x,t)) \tag{1} $$ Where f is some nonlinear function. With ...
6
votes
0answers
23 views

Implications of thermodynamic inconsistency in CFD calculations

During my PhD work, I had to use tabulated values of thermodynamic properties of gases in some Computational Fluid Dynamics (CFD in short) simulations. My tables are discretized in temperature and ...
-3
votes
0answers
27 views

Pseudocode of Lagrange derivatives through recursion

First of all, I do not have experience building a recursion algorithm. Unfortunately, I have to make a simple code that used to find the Lagrange weight in a different derivative order. $$l(x)=\prod_{...
0
votes
1answer
62 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 ...
0
votes
0answers
23 views

When semicoarsening is needed in multigrid method?

I am trying to understand multigrid in deep and all the coarsening techiques. So,assuming a 2D grid when semicoarsening is prefered instead of standard coarsening?What is the error's behaviour when a ...
-1
votes
0answers
12 views

Can we start Simplex method at a different corner than origin

I am working on a complex LP where I would like to get a fast heuristic solution and use it as a starting point for Simplex. The heuristic algorithm provides a corner point, but I am not sure how to ...
5
votes
3answers
237 views

Fast evaluation functions given by straight-line programs

I have a simple but long function that takes a vector x[10], and outputs a vector y[100]. It is an automatically generated eval function for a multivariate polynomial, ie, there is only (complex) ...
0
votes
1answer
80 views

Need an example Legendre-Gauss-Radau pseudospectral differentiation matrix or Matlab code

I'm trying to implement various kinds of pseudospectral methods for direct optimization in Matlab using IPOPT. I've got some working Legendre-Gauss-Lobatto code, but would like to use the flipped ...
8
votes
1answer
139 views

Radial integration of expensive function with Bessel weights

I need to calculate the integral $$I = \int_0^R f(r)J_n\left(\frac{z_{nm}r}{R}\right)rdr$$ where $J_n$ is the $n^{\mathrm{th}}$ order Bessel functions of the first kind, $z_{nm}$ is its $m^{\mathrm{...
1
vote
1answer
62 views

Solve linear system with Newton-Raphson method

Is it possible to solve a linear matrix system $A x = b$ using the Newton-Raphson method? If yes, how can this be done? More special, how is the derivative build?
-3
votes
0answers
11 views

How to check the feasibility of a set of linear inequality constraint?

(The image of the whole problem is also included) Consider a set of linear inequalities constraint as: Ax >= b, 0 <= x <= L, where A(N,N), x(N,1), and b(N,1). It is assumed that the ...
1
vote
1answer
2k views

Divergence in COMSOL

I'm trying to calculate the divergence of a vector quantity $L(L_x, L_y, L_z)$ in COMSOL. I calculate it using the built-in differentiation operator as follow: $$\nabla L = d(L_x,x)+d(L_y,y)+d(L_z,z)$...
-1
votes
1answer
32 views

Integrate using Composite Simpson's rule

In a question, we have been given the speed of a car at time t= 0,2,4,6,.......,20 minutes.But it asks us to approximate the distance travelled by the car in 30 minutes using Composite Simpson's rule. ...
3
votes
1answer
60 views

Scipy Spline Interpolation Parameter

Documentation in scipy.interpolate (found at https://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html) states: "The parameter variable is given with the keyword argument, u, which ...
0
votes
0answers
28 views

Coding of density of states of a 2D square lattice in python [on hold]

I want to get python code for the calculation of density of states. I am very new on coding. Can anyone help me out this situation?
6
votes
0answers
87 views

“Geometry of ill-conditioning” for least-squares problems

It is an idea that dates back to Demmel, 1987 that the condition number of a problem is often related to the distance to the closest ill-posed problems. In Section 3 of the above paper, the author ...
2
votes
0answers
54 views

Why wall shear stress calculated from LBM directly and the one calculated based on velocity profile are so different in some cases?

First of all, I hope you accept my apologizes if my question seems off topic here. But, I asked this question in ParaView forum and after a week still I did not receive any response yet, so I'm ...
-1
votes
0answers
15 views

Using Patchmatch for image inpainting

I've been reading over the Patchmatch paper and sample repositories and I understand what the algorithm does. It finds pairs of pixels between two images (or the same image) that have similar ...
1
vote
1answer
85 views

Numerical integration in 2D

I would like to solve the following problem $$ \vec{v}(x,y)= k\, \nabla \theta(x,y) $$ with respect to the unknown function $\theta$. Parameter $k$ is just a real constant quantity. I have two ...
0
votes
0answers
44 views

Problem with rate of convergent of numerical scheme for hyperbolic conservation law

I need help to verify my code in C++ that developed to solve the Burgers equation $$\\u_t + (\frac{u^2}{2})_x =0$$ $$u(x,0)=\sin(\pi x),\text{ } -1\leq x \leq 1$$ using a third-order ...
3
votes
1answer
55 views

Calculate Transformation Matrix between two sensors

My question is if I can calculate the transformation matrix between two sensors. Each sensor provides a $4\times 4$ matrix for every timestep recorded. The sensors are moving and have some noise in ...
0
votes
1answer
42 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 ...
2
votes
1answer
64 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 $...
0
votes
0answers
32 views

FEniCS, refinement not 'respecting' domain boundary

Short question: how to ensure that extra points are not included as 'boundary' points after calling the refine function. More details. I am working with a hexahedral mesh in $3$d. Let $X$ be the set ...
1
vote
0answers
54 views

Can the standard multigrid performance be used for time-dependent PDEs?

Consider a time dependent pde(i.e u(x,t)).I know when only space-coarsening is used the standard multigrid performance can be applied but what if instead we use only time-coarsening?Can we apply the ...
0
votes
2answers
6k views

How to prove the 2-norm of an invertible matrix is exactly the reciprocal of its minimum singular value?

If a matrix $A_{n\times n}$ is invertible, then $\left\|A^{-1}\right\|_2 = \dfrac{1}{\min\limits_{i} \sigma_i}$ where $\sigma_i$ is the $i$-th singular value of $A$
1
vote
0answers
67 views

understanding Domain Decomposition with example

I am new in Domain Decomposition method. I am started to solve $-\Delta u = f$ in $\Omega$ and $u = 0$ on $\partial\Omega$. From that I get in $\Omega _1$ $$\begin{bmatrix}4&-1\\-1&4\end{...
3
votes
1answer
55 views

Differences between Discrete Fourier Transform and Continuous Fourier Transform?

I am trying to visualize the time dependence of a free particle given an initial wave-function using Python and I just wanted to know if I could use the in built FFT implementation from NumPy to find ...
2
votes
2answers
70 views

Chebyshev differentiation via FFT with a domain [a,b]

I want to ask something about Chebyshev differentiation via FFT, which can be used to obtain with spectral accuracy the derivative of a smooth function. See for instance this code in python, which ...
1
vote
1answer
247 views

ODE Solving in Scilab

I have a certain ODE problem that needs to be solved using Scilab. dx(1)/dt=k*x(1)-x(5) dx(2)/dt=k2*x(2)-k1*x(1) dx(3)/dt=k1*[x(2)-x(3)] dx(4)/dt=k1*[x(3)-x(4)] <...
1
vote
1answer
43 views

Matrix multiplication not working in Scilab

I entered an instruction to calculate the coordinates of a vector after a change of basis in order to repeat it many times with various vectors. X0=[1;1/2] is a ...
3
votes
1answer
330 views

General case Kutta condition

I'm working on a 2D inviscid fluid simulation using a "panel method", with Potential being used to enforce the no-through boundary condition. I'm trying to incorporate the Kutta condition, which says ...
7
votes
1answer
119 views

Numerically estimating expected value of f(x) when x is normally distributed

I need to estimate $$ \mathbb{E}_x[f_i(x)] = \int_{\mathbb{R}^n} f_i(x) p(x) dx $$ for many functions $f_i(x)$, where $p(x)$ is the density of a normal distribution. The evaluation of all the ...
1
vote
2answers
134 views

Lattice Boltzmann methods vs Navier stokes/ other eulerian methods for *water* simulation

Note, there is already a question here, however the answers don't answer the original question, let alone specific considerations when dealing with nearly in-compressible fluids (water). Another ...
1
vote
1answer
76 views

Eigenfaces Algorithm

This might be a silly quesntion but recently I've been trying to program the eigenface algorithm using PCA, so I arranged the face vectors vertically in a matrix X such as: X = [x1,x2,x3,...,xn]; In ...
2
votes
3answers
93 views

How the gmres method iteration behaves for this **enfant terrible** matrix?

Recently, I have been studied my lessons about gmres iteration, probably the most popular iteration method for general large sparse linear system of equations Ax=b. And the convergence is obtained ...
2
votes
2answers
62 views

Can a direct method like Thomas be used in a multigrid method as a smoother?

As far as I know, multigrid uses stationary iterative methods as smoothers (i.e GS), but can we use a direct method also? For example, in case we have a tridiagonal system (for example 1D heat ...
2
votes
1answer
47 views

Partially Banded Matrix

I have a somewhat peculiar Jx=R system that I need to solve. The matrix J is 2N -by- 2N. The first N rows have all entries filled. The next N rows are banded in two places, i.e. for the (N+k)th row, ...
1
vote
1answer
31 views

Accelerating Conjugate Gradients fitting for small localized kernel (like cubic B-spline)

Question: Is there some pre-conditioner for Conjugate-Gradient (CG) cheap enough, that it is worth using even if my operator is very local (i.e. already has a low number of non-zero elements), as it ...
1
vote
1answer
76 views

Simulating advection - diffusion problem in a network of 1D pipe

I'm interested in solving the following advection-diffusion system in a 1D network of pipes. $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\partial C}{\partial x}$$ ...
3
votes
1answer
101 views

Solving an SDE with time-dependent parameter in R

I am trying to solve a system of SDEs in R using the Diffeqr package. Let's reduce the system to a simple ODE: ...
1
vote
2answers
382 views

Correct use of scipy's sparse.linalg.spilu

I'm attempting to use scipy's spilu routine as a preconditioner and I'm finding bad performance for my application (solving a global linear system arising from a DG ...
2
votes
1answer
139 views

A Bound for the inverse of the sum of identity and triangular matrix

I wonder if there are any theorems which can help me to calculate an upper bound for the spectral norm of: $$\left\| \left[ I + \sum_{i=1}^{\overline{n}\in\mathbb{N}} \big( C_i - I\big)\right]^{-1}\...
5
votes
1answer
58 views

How to record hardware and software info in Julia?

Watermark extension for Jupyter shows system and package information for reproducibility: ...
2
votes
1answer
93 views

Eigenvectors associated to two quasi-degenerate eigenvalues

I need to find the smallest eigenvalue and the corresponding eigenvector of a sparse matrix $M$ whose dimension is $\approx 10^4$. Within Matlab enviroment, I use the command ...

15 30 50 per page