All Questions

Filter by
Sorted by
Tagged with
1
vote
0answers
62 views

How to approach geographic data interpolation by distance?

let's say I have a set of geographic locations (lat, lng) resulting from a query. Those locations have some kind of internal ranking, my set is sorted by this number in a descending order. Now I'm ...
7
votes
1answer
87 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 ...
0
votes
0answers
39 views

Simulating flow in a branched pipe

I am trying to simulate 1D advection and convection of a solute in the following blood vessel segment. I would like to know if this system can be simulated in COMSOL or MATLAB. I have used pdepe ...
0
votes
1answer
35 views

Spline regularization

I am fitting some B-splines to data, but the data has a "gap" region where the spline is less constrained by the data. I want to devise a regularization scheme to help prevent the spline from ...
1
vote
1answer
70 views

Evaluating an indefinite integral that has no closed form

I need to evaluate the following indefinite integral: $$I=\int\frac{x^5+2ax^3+a^2x-4a}{x^7+ax^5+2ax^4}dx=\int\frac{x^5+2ax^3+a^2x-4a}{x^4(x^3+ax+2a)}dx$$ The solution that I obtained while ...
3
votes
0answers
47 views

Singular vectors of s1 for tiny dense matrices

I have a function whose main bottleneck is finding a(ny) singular vector pair in the space of the largest singular value, along with the singular value itself. This is done a huge number of times. ...
6
votes
1answer
297 views

Problems Implementing the Remez Algorithm

So first off: *** This code is not being used in production software. It is a personal project of mine, trying to understand approximation theory and advanced curve fitting. In other words, I'm ...
2
votes
1answer
58 views

Gradient descent in constrained optimization of barrier function

This question may be too basic, but I was wondering if it is possible to implement simple methods such as gradient descent or its variations to find the minimum of barrier functions in constrained ...
1
vote
1answer
65 views

Solving 1D convection using method of lines

I'm interested in solving the following 1D-advection equation using method of lines. $$\frac{\partial C}{\partial t} = - v\frac{\partial C}{\partial x}$$ The spatial domain has been discretized into ...
0
votes
2answers
2k views

scipy.integrate.odeint: how can odeint access a parameter set that is evolving independently of it?

I might have some non-linear ODEs that are being solved by scipy.integrate.odeint. However, a parameter at each time step might have to be updated by using a non-DE ...
4
votes
1answer
51 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
1answer
48 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
97 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 ...
0
votes
1answer
80 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
25 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
21 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 ...
6
votes
3answers
244 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
108 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
143 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
85 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
19 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
37 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
63 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 ...
7
votes
0answers
97 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
132 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
vote
1answer
96 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 ...
3
votes
1answer
63 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
0answers
46 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
56 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
7k 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
74 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
58 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 ...
3
votes
2answers
80 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
248 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
44 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
332 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
122 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
161 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
0answers
81 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
108 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
65 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
48 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
89 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
107 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
430 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
140 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
63 views

How to record hardware and software info in Julia?

Watermark extension for Jupyter shows system and package information for reproducibility: ...
2
votes
1answer
95 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