All Questions

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

Guidelines for publishing data from a stochastic simulation

So, my question is if one should ideally keep a record of all seeds that are used when publishing numerical work that involves one or more random number generators (e.g. a stochastic simulation), and ...
2
votes
1answer
180 views

Is there a simple way to avoid carbuncles for FD WENO methods?

I have implemented finite-difference WENO scheme for Euler equations (with some variants - WENO-JS, WENO-Z, WENO-M, different flux splitting). It works well, but have problem with so-called carbuncles ...
2
votes
1answer
606 views

Clever ways to update LU factorization for ridge regression

Ridge regression can be posed as minimizing the following objective function (over $x$): $$\frac{1}{2} \lVert Ax - b \lVert_2^2 ~+ \frac{\lambda}{2} \lVert x \lVert_2^2 $$ Which has a closed form ...
0
votes
2answers
49 views

“WY” representation of QR factorization — implementations?

I have a matrix $A \in \mathbb{R}^{m \times n}$ where $m \gg n$ and I want to compute the full QR decomposition $A = QR$. Where $Q$ is an orthogonal $m \times m$ matrix. Bishof & Van Loan (1987) ...
0
votes
2answers
38 views

Grid Independence Study

Is the change in time step necessary for the grid independent study? As the CFL is based on the relation between dt and dx. In mesh independent study, only change should be mesh i.e, dx isn't it so?
1
vote
0answers
36 views

Hack for using hardware to take square roots of 128 bit numbers

I need to take integer square roots $\lfloor \sqrt{n}\rfloor$ of (lots of) 128 bit numbers $n$. Calling gmp seems to take surprisingly long (though I can't tell for sure, since gmp routines are not ...
1
vote
1answer
48 views

Help understanding Brent's root finding method

Help me understand a part of Brent's root finding algorithm. In a typical iteration we have samples (a,fa), (b,fb), (c,fc) all real with (a<b<c) or (c<b<a) . Also, in the case I am ...
1
vote
1answer
648 views

Split-step Fourier method applied on Schrodinger equation

I'm trying to solve a Schrodinger equation of the form $i\frac{\partial}{\partial t}\psi=-\frac{\partial^2}{\partial x^2}\psi + (V(x)+\alpha|\psi|^2)\psi$ using the split-step Fourier method ...
0
votes
1answer
22 views

Task Spooler – Executing an Executable within an Executable

I am currently using Task Spooler, which is a job scheduler I have installed on my iMac. I have encountered a problem in which I cannot execute a job properly. Using a bash script, this is how I run ...
1
vote
0answers
20 views

Multigrid Reduction In Time Convergence

I am trying to solve a 2D dynamic linear elasticity model parallel in time using Xbraid. The spatial domain is [0,1]x[0,1] and time domain [0,1]. For time integration I am using a backward Euler ...
0
votes
0answers
15 views

Error in Monte Carlo integration

I am looking for a concise description to help me understand the error for Monte Carlo Integration using Uniform Sampling and Importance Sampling For Importance Sampling I have that the error is just ...
0
votes
0answers
24 views

discretizing advection equation with variable wave speed + stability

I currently have a code that solves $u_t+ cu_x=0$ with periodic boundary conditions, and constant $c$ (using an upwind method). I'm wondering how I would alter this code to solve something of the form ...
2
votes
2answers
133 views

Heat equation in non-dimensional form behaving differently than in usual format

Starting from $$ c_p \frac{\partial u }{\partial t} = k \nabla^2 u $$ in a one dimensional domain [0,1] where $c_p$ and $k$ are modeling two different materials: $$ k = \begin{cases} 1 ~\text{if} ~x &...
4
votes
2answers
104 views

Meshing surface of a sphere with a subdomain

I am trying to build a triangle mesh of the surface of a sphere which also includes a subdomain defined by a 'polygon'. Here is a successful example (subdomain defined by the red dots): Note that the ...
1
vote
1answer
75 views
+50

Calculating Error for Poisson Equation using Successive Over-Relaxation technique, Python

I am trying to solve the Poisson Equation $\frac{\partial^2 T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2} = 32(x(x-1) + y(y-1))$ for a 61x61 grid using Python3 with boundary conditions being $T=...
0
votes
0answers
34 views

how to Implement linear tetrahedral elements for finite element computations?

I am trying to implement 3D tetrahedral elements in my finite element code (which works fine for linear triangles and quadrangles in 2D). But my simulations are crashing with tetrahedral elements. My ...
3
votes
0answers
44 views

Optimize linear equation using inner products and subject to L1 norm

I have a linear system of the form $A x = b$ where $A$ and $b$ are known, $A$ is "square", and $\lvert b \rvert_1 = \lvert x \rvert_1 = 1$. Unfortunately, I am working in a framework that ...
0
votes
1answer
51 views

Sum of random variables - Check your derived distribution against a numerical calculation/histogram

Consider independent random variates $X_0, X_1, . . .$ each uniformly distributed on the support $[0, 1)$ Let's say $Y = X_0 + X_1$, where $X_0$ and $X_1$ are independent uniform random variables with ...
0
votes
1answer
75 views

Dealing neighbor list in NVT Monte Carlo (MC) simulation

I'm making a NVT Monte Carlo (MC) simulation code with only short range interaction. I found many MC tutorial codes (usually Lennard-Jones system) in online. However, most of them are doing energy ...
0
votes
0answers
22 views

COMSOL Cannot evaluate expression [closed]

I'm working on a 2D model to simulate groundwater flow through pores using the Darcy's law interface. I'd like to eventually tie in flow and transport of diluted species. The domain is defined as a 0....
1
vote
1answer
88 views

Trouble Making 3rd-Order Sympletic Integrator for Planitary N-Body Problem (A Hamiltonian System)

I am doing a solar-system simulation. I am using Ruth's 3rd order sympletic integrator to avoid the problem of Energy Drift (which I had with RK4), but the the planets quickly leave orbit, and energy ...
-1
votes
0answers
55 views

I am plotting too many figures the animations get slower as a result. Need to clear figure or something

I am trying to embed an animation using FuncAnimation from matplotlib into a tkninter GUI. In the execute button at the bottom I am calling the Execute function. If I click the execute button many ...
2
votes
0answers
142 views

Parallel In Time with Multigrid

I am trying to solve the linear finite element equation $M\ddot{u}+Ku=F(t)$, where $M$ is the mass matrix ,$K$ the stiffness matrix and $F(t)$ the external load vector, parallel in time using XBraid ...
2
votes
2answers
96 views

Use Monte Carlo integration to compute the volume and centre of mass in Python

In particular, I want to focus on finding the volume $V$ because I will need it to start working on solving the centre of mass This $3D$ homogenous body (Torus section) is defined by $$x^2 + \left(\...
0
votes
1answer
45 views

Clarification regarding 3D FMM translation operators

I am implementing an adaptive 3D FMM with the "basic" $O(p^4)$ translation operators. I am looking for clarification on the multipole-to-multipole (M2M) translation operator. I will explain my ...
1
vote
0answers
46 views

Determining the voxels between two boundary surfaces

Update (Solution) -17 October 2020- I finally did it! You can check the code on my GitLab repo. The function is to do this is the domain_extract which identifies ...
2
votes
1answer
99 views

(Lack of) Availability of Finite-Difference library for simple 2D PDEs

I would like to solve two types of simple 2D problems, namely the stationary heat equation on an L shaped geometry like this: And also compute the magnetostactic field in an air gap of the following ...
1
vote
0answers
35 views

How can I implement a bvp problem in a non uniform grid?

I want toconstruct a difference method for the the numerical approximation of the solution of the following boundary value problem: $u:[a,b]\to \mathbb{R}$ function,such that $$ -u''(x)=f(x)$$ and $u(...
17
votes
4answers
659 views

What are some applications which require interval arithmetic?

I have a very basic notion about interval arithmetic (IA), but it seems to be a very interesting branch of computational science both theoretically and practically. It is clear that the obvious ...
0
votes
1answer
35 views

Vector format export for screenshots

How to best export Scene/Screenshot in Paraview as a vector graphic? It seems PDF and PS export are not working really good for me (Paraview 5.3/5.5/5.8), either the scene is cropped at the borders or ...
0
votes
0answers
28 views

Dolfin convert : How to interpolate data at vertices of (3D) cells?

I hope that one of you guys can help me because i have been stuck here for a week. I am trying to read a gmsh file (.msh) using dolfin convert to XML and then download it with dolfin. The thing is ...
0
votes
0answers
43 views

How to use FEniCS to calculate the electric field of an isolated charged sphere

Initially I thought that this is the kind of question which ought to have already been answered in the form of an example online, but so far I haven't found one. I will admit that I am very new to ...
1
vote
0answers
57 views

Solution predictors for accelerating convergence in nonlinear FEM

I am looking for the details of commonly-used predictors for accelerating the convergence of iterations using Newton-Raphson scheme for nonlinear problems in FEM. I am looking specifically for static ...
1
vote
0answers
24 views

Bipartite Euclidean Matching simple to implement approximate algorithm

I am looking for a simple to implement algorithm for the bipartite euclidean matching problem (or an implementation of any practical algorithm). I am aware of Agarwal's paper, but I would like to ...
1
vote
1answer
47 views

scipy odeint: excess work done on this call and very sensitive to initial value

I am trying out odeint and received the error 'Excess work done on this call (perhaps wrong Dfun type).'. The values returned are also super sensitive to small ...
0
votes
0answers
44 views

Time complexity of derivation, gradient,differential, jacobian matrix

what is the time complexity of gradient $\nabla_{f}$ using the $\mathcal O$-notation? what is the time complexity of jacobian matrix using the $\mathcal O$-notation? who knows some references to ...
0
votes
1answer
173 views

Time complexity of numerical finite differences

I have a function $f:\mathbb R^N\to \mathbb R$ and I would like to compute all the partial derivatives of $f$ w.r.t. the $N$ input. What is the computational complexity using the (ones-sided) finite ...
2
votes
1answer
73 views

Methods to improve the efficiency and the memory requirement of LU factorization for complex symmetric system matrix

I want to solve a linear set of equations (Ax=b) using LU decomposition. My "A" matrix is a complex matrix which is ...
0
votes
0answers
25 views

Negative binomial expansion of general symbolic polynomial

Using Sympy, I would like to compute the negative binomial expansion of a general symbolic polynomial, e.g., $(x_1 + x_2 + x_3 + 4 x_4)^{-1}$. I understand that I can go by recursively partitioning ...
2
votes
1answer
72 views

Rank of a double-precision augmented matrix

Let $A$ be a matrix with real entries, and let $A_+$ be $A$ augmented by a single column. From linear algebra we know \begin{equation} \operatorname{rank}(A_+) = \operatorname{rank}(A) \hspace{10pt} ...
1
vote
1answer
75 views

How to avoid gsl root finder evaluate function outside its domain

When I use the newton's method or hybrid solver in the GSL package to deal with 1-D or multidimensional root solving problems, the code frequently crashes when the solver requests function value ...
2
votes
1answer
163 views

Efficient root finding algorithm for monotonic function

This is my first time asking a question here, so I may not be asking this in the right place. I am trying to find the roots of a monotonic function with as few function evaluations as possible. I ...
1
vote
1answer
20 views

What does this definition of two's complement representation of signed integers mean?

I am reading a book on digital circuits. It says that given a n-bit binary number $N$, its two's complement representation is itself, if $N$ is positive; and its two's complement representation is $2^...
2
votes
1answer
75 views

Efficient change of basis real positive definite symmetric matrix

I need to optimize a code where the most performance critical part is doing a 'change of basis', in other words it is an unitary similarity transformation on a big real positive definite symmetric ...
2
votes
0answers
41 views

Haw to apply central difference to viscous flux in energy equation?

In many modern papers Navier-Stokes equations are solved with finite-difference or finite-volume methods using WENO reconstruction for non-viscous fluxes and central differences for viscous ones. It ...
8
votes
2answers
121 views

A misunderstanding or a bug in LAPACK's solver for generalized eigenvalue problems?

In my application, I have two general real matrices $A$,$B$ defined as follows, $$ A=\begin{bmatrix} -s I_3 & A_0 & 0 & 0 \\ A_0^T & -s I_3 & 0 & 0 \\ 0 &...
0
votes
0answers
27 views

Implementation method selection for sparse constrained linear least squares or quadratic programming

I need to slove one optimization problem of quadratic programming. The number of optimization variables is about 16,000. The constraints include equality constraints and inequality constraints. I have ...
1
vote
1answer
146 views

How to make objective elastic SPH model?

I have implemented a constitutive equation of elastic materials (Hooke's law) in my 3D weakly compressible SPH solver based on [1]. The coding seems to be correct. To verify the implementation I ...
3
votes
1answer
92 views

Why do people omit the lowest times when averaging timing results?

Most of the time, when I see someone reporting the average timing of a certain algorithm on a computer in a computational mathematics paper, they do something like this: Run the operation $n$ times (...
3
votes
1answer
71 views

Numerical integration in time for finite elements

I am trying to solve $M\ddot{u}=-Ku+F_\text{ext}$ for a 2D linear elastic model with $M$ be the mass matrix,$K$ the stiffness matrix and $F_\text{ext}$ the external load vector coming from a uniformly ...

15 30 50 per page
1
2 3 4 5
183