All Questions

Filter by
Sorted by
Tagged with
4
votes
1answer
101 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
0answers
15 views

How to minimize a integral function using a constant step gradient method in Python?

I am developing a practical work of the following system of ode \begin{align}x'(t) &= k_1h(t) - (k_2+k_3)x(t)\\ y'(t) &= k_3x(t)\end{align} and $z(t) = (1-k_4)(x(t)+y(t))+k_4h(t)$, where $h(...
0
votes
0answers
3 views

Retaining or mapping sets (physical tags) after remeshing a compounded surface/curve in Gmsh?

For my current work, I need to remesh a given geometry with Gmsh (currently trying all Gmsh versions to achieve this) to continue my Abaqus simulations. As can be seen in the image, the geometry has ...
1
vote
0answers
8 views

Is there any theory of the minimum amount of data for tomographic reconstruction?

I'm doing an experiment on synthetic data and I want to generate enough data but not too much. So I wonder if there is any rule for the minimum number of projection angles and detector count. For ...
2
votes
1answer
4k views

Calculate Jacobian of triangular element given coordinates of vertices and displacements?

I am trying to determine quality of my mesh elements using the Jacobian determinant as the measure. My algorithm takes vertices of nodes in triangular mesh and moves them around so as to form ...
1
vote
0answers
19 views

Packing spheres inside a geometry

I am looking for packing spheres (can be monodisperse or polydisperse with known radii distribtuions) inside a geometry. I am sure this is a well explored scientific problem with applications in ...
2
votes
2answers
110 views

Inverting really big symmetric block diagonal 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 diagonal matrix. The biggest blocks ...
-4
votes
0answers
11 views

STRING OPERATIONS IN C PROGRAM [closed]

Given two strings, PRINT (YES or NO) whether the second string can be obtained from the first by deletion of none, one or more characters. Input Specification Input will contain two strings ...
0
votes
0answers
30 views

ODE integration with Bulirsch-Stoer method, step-size underflow

I am using the Numerical Recipes version of the Bulirsch-Stoer method to integrate an ODE with adaptive time step ("Numerical Recipes", section 16.4): ...
2
votes
0answers
39 views

Correct approach for thermal finite element simulation of layered assembly

I would like to optimise the heat transfer on a PCB. Several dies are on the top and cooling air is going through the fins in heat sink on the bottom. The assembly consists of several layers like ...
2
votes
1answer
123 views

log-sum-exp trick for signed/complex numbers

I need to evaluate a sum of values that are on many different orders of magnitude in scale but might be signed. I’ve had great luck with the “log-sum-exp” trick for an unsigned version of my problem, ...
0
votes
0answers
13 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
21 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 ...
2
votes
0answers
12 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
44 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
54 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-...
1
vote
1answer
35 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 ...
-2
votes
2answers
90 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 ...
2
votes
0answers
52 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 ...
3
votes
1answer
79 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 ...
0
votes
0answers
27 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....
0
votes
1answer
46 views

R function or package for carrying out maximum likelihood techniques in random effect models

I am applying optim() function in R to obtain maximum likelihood estimates of the fixed effects and random effects in a model with bivariate random effects. The ...
0
votes
1answer
129 views

seminorm of solutions of Laplace equation

If $u_1$ and $u_2$ are solutions of (weak-form) Laplace equation on a connected domain $\Omega$, with Dirichlet boundary values $u_{\partial\Omega, 1}$ and $u_{\partial\Omega, 2}$, respectively. If $$...
0
votes
1answer
143 views

Converting ROOT Tree to HDF5

I have a TTree in ROOT with 1000 events and 15 variables associated to each of them. I would like to convert this in its entirety to an hdf5 dataset. How do I organise my data in HDF5 Groups such that ...
1
vote
2answers
169 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
2answers
228 views

Motivation behind Collocation Method

In the previous question "Motivation behind Galerkin method", Paul gives a good and easy-to-understand explanation indicating that the Galerkin method is a kind of projection method. Can anyone ...
1
vote
1answer
58 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 ...
1
vote
1answer
45 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: ...
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
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
vote
2answers
55 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 ...
2
votes
1answer
93 views

Givens rotation vs 2x2 Householder reflection

The usual story of Givens rotations vs Householder reflections is that Householder reflections are better if you want to map a long vector to $e_1$, while Givens is better if you want to map a 2-...
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. ...
0
votes
0answers
40 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
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 ...
2
votes
1answer
113 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 ...
3
votes
0answers
44 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, ...
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
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 ...
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
1answer
376 views

What is the difference between Abaqus and Calculix contact input?

I would like to say first that am new at using Calculix. I'm using Abaqus/CAE to create a cup deep drawing simulation and everything worked perfectly but my objective is to run the same exact ...
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
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 ...
4
votes
0answers
50 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 ...
4
votes
1answer
62 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,...
12
votes
4answers
682 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 ...
-1
votes
0answers
57 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 ...

15 30 50 per page