All Questions

Filter by
Sorted by
Tagged with
3
votes
3answers
87 views

CPU usage when a MPI rank waits during a blocking communication

A typical way of dealing with I/O in MPI parallel programs is to either read all data to a single node and dispatch to the other nodes accordingly, or send all data to a single node and write from ...
6
votes
1answer
132 views

How fast is automatic differentiation?

I asked this question earlier on StackOverflow, but it's obviously better suited for SciComp: While there seem to be lots of references online which compare automatic differentiation methods and ...
2
votes
1answer
99 views

What is eighth order central difference?

The origin of the question can be found here. I know the details about forward, backward and central differences. If $u$ is the variable, does eight order means it approximates the $u_{xx}$ using $u$...
0
votes
1answer
40 views

Why PETSc/MPI uses only 1 processor a number of times, rather than using several as prescribed by mpiexec [closed]

I am a beginner to PETSc and MPI, so after installing PETSc I was compiling some basic tutorial. But whenever I give the number of processors i.e mpiexec -n 4 ./ex1 ...
1
vote
0answers
25 views
1
vote
0answers
68 views

Calculate integrals using numpy.fft

Good evening, I would like to understand why I do not get the correct result: I assume that I know my function on discrete data points and expand it as a discrete Fourier transform: $\text{sin}(x)=\...
0
votes
1answer
55 views

How to implement Geometric Multigrid in non-rectangular grids?

It is quite easy to implement multigrid on a rectangular grid but what about an non-rectangular?How to coarse a non-rectangular grid and apply multigrid(assume an easy non-rectangular grid capital ...
3
votes
0answers
42 views

Subspaces for Iterative methods

In the original paper of Conjugate Gradients, the authors mention that if we pick the canonical basis $\{e_1,e_2,\ldots,e_n\}$, to obtain A-orthonormal vectors, we end up with the Gaussian elimination ...
0
votes
2answers
79 views

Is expm1 the right primitive?

I'm writing some code to calculate $\int_0^1 e^{ax} \mathrm{d} x$. Annoyingly there does not seem to be a way of doing this without if statements: ...
6
votes
2answers
1k views

Runge-Kutta in the presence of an attractor

Suppose you are solving a system of equations numerically that possesses an attractor (no matter the initial conditions set, all the different solutions will approach a specific set of values that ...
2
votes
0answers
27 views

Fast approximate evaluation of Fourier-Legendre series

Suppose I know that a function from $[0,\pi] \to \mathbb{R}$ may be written as $$ \sum_{k=0}^\infty A_l \frac{2l+1}{4\pi} P_l(r) $$ where $A_l$ all are known. Is there a way in which I may very ...
6
votes
0answers
109 views

fastest way to compute many small dot products

I have two n-by-3 blocks contiguous in memory ("n vectors of length 3") and I'd like to compute the dot product between each of the rows as fast as possible. In numpy, using ...
1
vote
0answers
36 views

How to use discrete cosine and discrete sine transforms in fftw

I work on fluid-related simulations. I have used FFT for fluid simulation. I want to use discrete cosine transform (DCT) and discrete sine transform (DST) to transform my velocity field to wavenumbers....
3
votes
1answer
76 views

Dynamic linear elasticity problem is stiff (numerically)

I am considering a dynamic linear elasticity problem applied to a simple structure such as a beam. In system form, the PDE can be written as $M \ddot{X} + D \dot{X} + XK = F$ where $X$ represents the ...
6
votes
0answers
102 views

How to check if my stiffness matrix is correct

I built the stiffness matrix for the Poisson equation on a 2-dimensional domain with the shape of "almost" an octagon, using pyramid basis functions. I used almost to intend the fact that I have an "...
2
votes
1answer
77 views

Lumped matrices in thermal analysis using finite elements

The governing equation of the transient heat transfer problem is $$C \frac{dT}{dt}+K T = Q$$ $C$ is the heat capacity matrix. $K$ is the thermal conductivity matrix. $T$ is the temperature vector. $...
5
votes
2answers
129 views

Is the diffusion equation with Neumann and Dirichlet BCs well-posed?

I am considering the following diffusion equation: $$\frac{\partial f}{\partial t} = \frac{\partial}{\partial x}[D(x,t)\frac{\partial f}{\partial x}]$$ over a grid ...
3
votes
1answer
55 views

Are there any other better methods than block diagnoal and block upper triangular precondtioner for saddle point problems?

For stokes problems, $$ -\Delta \vec{u} + \nabla p =\vec{f},\qquad \nabla . \vec{u} = 0; $$ with appropriate boundary conditions which guarantee there is a unique solution. Using FDM or FEM, ...
1
vote
1answer
93 views

(FEM) Efficient CRS vectors evaluation using elements connectivities

What is an efficient way of evaluating the column (col_ind) and the row (row_ptr) vectors for the CRS (Compressed Row Storage) storage format using the Connectivity Array? The Connectivity Array is a ...
2
votes
0answers
61 views

CFD and finite volume method: Dirichlet boundary conditions for the Euler equations

Please point me to an answer if one already exists, but after some searching, I still can't find the answer to what seems like a very simple question. There are plenty of references out there for ...
1
vote
0answers
12 views

polylog implementation of fully-dynamic graph connected-components?

I have read about papers in the last 20 years that have solved this problem. Many are mentioned in http://jamiemorgenstern.com/teaching/s18-6550/notes/notes-lec4-dgc.pdf Unfortunately the only ...
2
votes
1answer
57 views

Upwind finite difference: Matrix Implementation

I want to implement the upwind finite difference scheme for the 1D linear advection equation using a finite difference matrix in python: $$ A =\begin{pmatrix} 1-a\cfrac{\Delta t}{\Delta x} & 0 &...
2
votes
1answer
39 views

Four-noded rectangular element shape matrices

I works on a project where I need to compute a modal analysis of an acoustic cavity. The cavity is rigid which translates the problem to the following equation $$\frac{\partial^2p}{\partial{}x^2}+\...
1
vote
1answer
27 views

Four-noded rectangular element shape functions

I works on a project where I need to compute a modal analysis of an acoustic cavity. The cavity is rigid which translates the problem to the following equation $$\frac{\partial^2p}{\partial{}x^2}+\...
3
votes
0answers
50 views

Why GA convergence curves continue as two parallel lines?

I'm working on a optimization problem and using GA algorithm (in MATLAB, ga function). As you know MATLAB plots GA result with two curves, one for the best values and other to show the mean values ...
5
votes
0answers
85 views

Evolutionary dynamics in vascularised tumors, PDE-ODE coupled system

I have to solve the following PDE-ODE system $$ \displaystyle{\partial_{t} n = \bigl[a(s) - b(s)(y - h(s))^{2} - d\int_{\mathbb{R}} n \, dy \; + \; \beta \, \partial^2_{yy} n \;} \\\\ \...
2
votes
1answer
52 views

Correct relative error for Comparison of levelsets outside a constrained region

I am working on the estimation of tumor extent outside of the region which is visible in MRT/CT/DTI images. I want to compare two methods, which approximate the tumor density profile. Lets say the ...
2
votes
1answer
43 views

Numerical integration of the dataset of a function

The energy equation for a spherically symmetric system is given by $$\mathscr{E}=\frac{v^2(r)}{2}+\frac{c_s^2(r)}{\gamma-1}+\phi(r)$$ where $\mathscr{E}$ is the total energy, $v$ is the velocity of ...
2
votes
1answer
69 views

Defining Current Density in a FEM model (MATLAB)

I'm attempting to solve the Poisson equation in 3D for a magnetic vector potential in the presence of a current source. To validate my code, I'm initially looking to reproduce the model described in ...
2
votes
1answer
121 views

Why $\alpha I +A$ can improve the condition nubmer of a SPD matrix $A$?

For Poisson equation with Dirichlet boundary conditions in 2 dimension: $$ -\Delta u=f, $$ using FDM (centered difference) or FEM discretization, we can obtain a SPD system of linear equations as ...
3
votes
1answer
67 views

What is the **contraction factor and convergence factor** of a iteration method?

For any iteration method from A=M-N, e.g., $$ Mx_{k+1}=Nx_{k}+b,\quad k=0,1,... $$ we know that it converges iff $\rho(M^{-1}N)<1$. And when it converges, there exists a concept called asymtotic ...
1
vote
0answers
65 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 ...
2
votes
1answer
127 views

Physical interpretation of divergence theorem

In a diverging pipe section like the following, the pipe of radius $r$ splits into two pipes of radius $r/2$. Consider a solute transported by convection from node 1. $$\frac{\partial C}{\partial t}...
2
votes
1answer
53 views

How to obtain only the value of my variable using scipy.optimize.minimize

when I minimize a function using scipy.optimize.minimize I get a big list of things as a result, but I would like to only get the value of my variable, this is my code : ...
0
votes
0answers
42 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 ...
1
vote
1answer
75 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 ...
0
votes
1answer
46 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 ...
2
votes
0answers
55 views

Multilevel minimization - boundary conditions

I am interested in minimizing $$min_{x \in R^{n^l}} f^l(x),$$ where $f^l(x)$ is nonlinear objective function arising from discretization of PDE. I would like to use nonlinear multilevel minimization ...
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. ...
1
vote
1answer
80 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 ...
2
votes
1answer
66 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 ...
7
votes
1answer
90 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 ...
3
votes
1answer
86 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 ...
11
votes
1answer
181 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 ...
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
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 ...
1
vote
1answer
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 ...
-1
votes
1answer
41 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. ...
4
votes
1answer
57 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 ...
7
votes
0answers
102 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 ...

15 30 50 per page
1 4 5 6 7 8 170