All Questions

2
votes
0answers
389 views

2D Neumann Conditions on Irregular Domain

I would like to model the 2D diffusion equation with Neumann BC's inside the following egg-shaped domain: I would like to use the finite difference method with the discretization implied by the image ...
-1
votes
0answers
61 views

Finite difference method for conservative form of equations

My question is about how do we discretize the equations in the conservative form using finite difference method. I'm trying to solve Euler equations in conservative form. $$ \frac{\partial u}{\...
2
votes
1answer
55 views

Generate high n quantum harmonic oscillator states numerically

How can I generate the higher $n$ quantum harmonic oscillator wavefunction (in position space) numerically? Here, higher means around $n=500$, or say $n=2000$, where $n$ is the $n$th oscillator ...
-1
votes
0answers
26 views

Approximation of ODE solution using Taylor series methods

This is my first post on here, so please excuse mistakes if any. I am trying to plot out the difference between two ODE solvers based on Taylor series: 1st order acccurate: $x(t_0 + h) = x(t_0) + ...
0
votes
0answers
13 views

Determining the pseudo-time period of a system of $n$-pendulums via Kane's method in Python

We can use Kane's method to integrate the equations of motion for a system of $n$ pendulums with arbitrary masses and lengths (see derivation). In particular, if $(x_i,y_i)$ denotes the Cartesian ...
1
vote
0answers
33 views

$H^1$-convergence rate of finite element method for Poisson equation, depending on element order

I wanted to verify my FEM-program by applying the method of manufactured solutions, while solving the Poisson equation in two dimensions using the continuous Galerkin method $$-\nabla^2u=f$$ with $$u=...
0
votes
0answers
23 views

In-exact line search

In my class notes, the author says: "If $f:\mathbb{R}^n \to \mathbb{R}$ is bounded below and $p_k$ is a descent direction and the $\alpha-\beta$ also known as Armijo-Goldstein condition is met then ...
-1
votes
0answers
16 views

How to model a hysteresis behavior using MILP on CPLEX?

The question is below: 1: y[t]=10,if x[t]>=2; 2: y[t]=-1,if x[t]<1; 3: y[t]=y[t-1],if 1<=x[t]<2. How to model the function in cplex using c++? Thank you very much! My model is added as "...
0
votes
0answers
41 views

gsl-config: command not found HPC cluster [on hold]

I am trying to install the gsl libraries in a HPC cluster, so I don't have root access. I am following the instructions here. The problem is that when I type ...
-1
votes
0answers
30 views

System of coupled differential equations

I have a system of non linear coupled differential equations. I would like to use the finite difference to solve t but some left BCs are missing (though I have enough BCs to make it well posed). Can I ...
0
votes
0answers
82 views

Calculate distance between observer and cube excluding the distance inside the cube

I am trying to calculate the distance between two points where one is an observer and has no size and where the other point is a cube with the dimensions {1, 1, 1}. The distance will be the distance ...
-1
votes
0answers
41 views

MHD - How to impose a solid, perfect insulator as a boundary condition?

Consider the following MHD equations: $$\frac{\partial \rho}{\partial t}+\nabla\cdot(\rho\vec{u})=0,$$ $$\rho\frac{D \vec{u}}{Dt}=\vec{j}\times\vec{B}-\nabla p,$$ $$\frac{\partial\vec{B}}{\partial t}=\...
1
vote
0answers
69 views

How to simulate water, falling under gravity, and impinging on a curved surface, which is kept/present in a domain, containing air?

TL;DR: How do I simulate a hole, at the bottom of a (full) water tank? I am attempting to simulate water, flowing out of a hole/slit, at the bottom of a tank (Water Domain) (under the influence of ...
2
votes
1answer
237 views

Solve a differential equation with finite difference method

I want to solve this equation $$ -\frac{1}{2}f''(x)+2a\ f(x)^3 = f(x)\mu $$ One exact solution (there are a lot of different kinds) of this equation is $f(x) = f_\infty \tanh(\sqrt{2a}f_\infty x) $ (...
2
votes
2answers
134 views

C standard for computational science

Which C standard should be used for computational science code ? Should we keep compatibility with C89/90/ANSI or jump to C99 or C11 ? Context: Code will use third-party : BLAS, LAPACK, MKL, ...
0
votes
0answers
19 views

Linear Programming with Integral Contraint

If I calculate that one of the contraints is integral, can I accurately say this is a correct result? Ultimately, is it acceptable?
50
votes
5answers
24k views

How do I take the FFT of unevenly spaced data?

The Fast Fourier Transform algorithm computes a Fourier decomposition under the assumption that its input points are equally spaced in the time domain, $t_k = kT$. What if they're not? Is there ...
2
votes
0answers
56 views

Best way to numerically compute elliptic integrals of the third kind with complex arguments?

I need to compute elliptic integrals of the third kind with complex arguments, preferably in C++. Is there code out there to do this? I have discovered the Arb library, but that does much more than I ...
0
votes
1answer
69 views

Poincare map for Arnold-Beltrami-Childress Magnetic Field in Python

I want to plot the Poincare map for Arnold-Beltrami-Childress magnetic field for parameters $A=1, B=0.816, C=0.5773$ in Python for the Poincare section $z=0$. Also, I am not able to understand what ...
1
vote
0answers
29 views

Computing a Flux Integral in Paraview

I am currently looking into post-processing of simulation data using Paraview. I would like to compute certain integrals of field quantities. As an example, consider the following surface integral of ...
1
vote
1answer
228 views

Solve a fourth order differential equation

I want to solve $$ \frac{\partial^2}{\partial t^2}u(z,t) + a\frac{\partial^2}{\partial z^2}u(z,t) + k\frac{\partial^4}{\partial z^4}u(z,t) = 0 $$ with $u(z,0) = 1+0.1e^{-\frac{z^2}{2}}$. I'd like to ...
1
vote
1answer
72 views

Computing the Inverse of a matrix, using the Cholesky decomposition

I have to compute $CA^{-1}B$ and $CA^{-1}x$, where $A,B,C$ are conformable matrices and $x$ is a vector. I've read that the a very computationally stable way to compute these inverses is by computing ...
-1
votes
0answers
10 views

Use data from VRML 2.0 UTF-8 file to make a 3D representation of object with mplot3d

I have a VRML file with three types of data, points; normal-vectors; coordIndex. I have successfully, using re, imported the data into Python. I thought I had a way of using this data to make a nice ...
4
votes
2answers
181 views

HPC reading material

I am an undergraduate, and enthusiastic about HPC. I am currently familiar with the tools OpenMP, MPI, CUDA, OpenCL, thrust libraries etc. But I want to know the core functioning of these tools, I ...
0
votes
1answer
134 views

Regarding streaming operator in Lattice Gas Automata

The classical streaming operator used in FHP lattice gas automata is this: $$n_i(r - c_i, t + 1) = n_i(r, t)$$ However if you think in terms of the streaming itself, it should be something like $$n_j(...
1
vote
1answer
42 views

Average value divergence in spectral method for Poisson equation

I'd like to know how to deal with a divergence when trying to solve the Poisson equation for electrostatics with a simple spectral method. I'm not sure how to best state my problem, so I'll explain ...
-1
votes
0answers
62 views

How well do finite volume methods ensure that no flux flows perpendicular to the flux vector?

Finite volume methods find approximate solutions to equations of the form: $$\frac{\partial \vec{u}}{\partial t}+\nabla\cdot(\vec{f}(\vec{u}))=0.$$ My question is has anyone done any analysis on how ...
-1
votes
1answer
868 views

Explicit scheme for heat equation with Neumann boundary conditions in Maple

$\displaystyle \frac{\partial u}{\partial t}=\alpha(x,t)\cdot \frac{\partial^2 u}{\partial x^2}+b(x,t)$ $u(x,0)=f(x)$ Initial condition $u_x(0,t)=0$ 2nd type Boundary condition $u_x(1,t)=0$ 2nd ...
1
vote
2answers
136 views

MPI data broadcast or not in C

I have two slightly different but getting the same results MPI code. The first one is from an open-source package having several data exchange steps in between: ...
3
votes
2answers
72 views

Analytical convergent sequence and numerical divergent sequence

Is it possible to construct a sequence that converges in theory but when computed numerically with a computer program is diverging. I feel that today our computer programs doesn't allow such ...
2
votes
0answers
92 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 ...
0
votes
1answer
60 views

Is this a knapsack problem?

I have a set of $K$ keywords. Each of this keywords can have set of bids from $1\$,\dots,N\$$. For each bid for a keyword, it will get a specific amount of clicks and a specific cost. Clicks and Cost ...
3
votes
0answers
54 views

Block matrix and DSYRK

I want to compute the matrix $$ A = \sum_{i=1}^N v_i v_i^T $$ where each $v_i$ is a given vector of length $2500$, so that $A$ is $2500 \times 2500$, and my $N$ is about 2 million. Rather than call ...
7
votes
6answers
5k views

Python implementations of Gillespie's direct method

I'm looking for a decent implementation of Gillespie's Direct Method in Python, as if I code the algorithm myself I'm nigh positive I'll do it inefficiently. Anyone have a favorite?
6
votes
1answer
798 views

Grid mapping from an unstructured triangular mesh to a regular rectangular mesh

I am modeling fracture propagation using a 2-D dynamic unstructured grid. As the fracture propagates over time, the elements move accordingly. For a given time step, I would like to interpolate the ...
-2
votes
0answers
34 views

python Simpson integration [closed]

Currently, I am trying to apply a Crank-Nicolson method on a function that I want to evolve. However, I am only facing one drawback and it is the step when I normalize the initial function using the ...
6
votes
0answers
50 views

Quadrature methods for peaky integrands

Consider $$ I = \int_{-L}^L f(x)dx, $$ where $f(x)$ is real-valued and analytic on $[-L,L]$, but it has a pole in the complex plane whose real part lies in $[-L,L]$. Call it $z_0$, and assume it is a ...
0
votes
0answers
18 views

Is this a form of stochastic gradient descent?

I want to minimize the following with respect to parameters $B$. $$\sum_{k = 1}^{K} f(A_{k}, B)$$ where $A_k$ are $K$ different data-sets and $B$ is a matrix of parameters. Can I do this by a ...
0
votes
1answer
18 views

Gmsh: Recombine 2D in script file or command line

I have many STL files and I want to reduce their size, so I use Gmsh in this way: gmsh -2 -bin -format vtk -o file.vtk file.stl -0 It reduces the size from 7 MB ...
11
votes
3answers
1k views

Least squares approximation question

I am taking a course on scientific computation, and we just went over least squares approximation. My question is specifically about approximating using polynomials. I understand that if you have n+1 ...
2
votes
2answers
105 views

How does a stiff equation solver work?

I am trying to understand how stiff differential equations are solved. For instance the equation, $$\frac{\partial y}{\partial t} = \alpha\frac{\partial ^2 y}{\partial z^2}$$ can be solved using ...
0
votes
1answer
52 views

coupled equations with finite difference method

I have these three differential equations in which I need to solve numerically: $$ \frac{dn_0}{dt}= -n_0(t)W_{01}(t) + n_1(t)K_{10} $$ $$ \frac{dn_1}{dt}= -n_1(t)W_{12}(t) - n_1(t)K_{10} + n_2(t)K_{...
3
votes
1answer
261 views

Suggest methods and basis sets for a variety of systems [closed]

Please help me with any/all of the cases below. In the following cases, the named method and basis set are not suitable for the chemical systems. Why aren't they? Could you suggest a suitable method/...
-1
votes
0answers
81 views

Optimal way of comparing the lines of different files

I have 1600 ASCII files with 1000 lines in each file. Each line has only one entry and is a floating point number e.g. 1.67923. Let's denote the line1 of file1 with ...
3
votes
1answer
99 views

Derivation of backward differentiation formulas(BDF)

I have been reading upon numerical techniques that are used to solve stiff ordinary differential equations. From the description given here, I could follow the steps till equation (5). I am finding ...
0
votes
1answer
334 views

Proper boundary conditions for potential flow around cylinder

I am computing the stationary, incompressible, inviscid and irrotational flow around a circular cylinder using a discretization in general coordinates. I derived a PDE and proper boundary conditions ...
5
votes
1answer
443 views

Help with Fourier beam propagation method

I am working on implementing the Fourier beam propagation method in C++. I am really more of a programmer than a physicist but I think I have a good understanding of what I am trying to do. Here is ...
3
votes
2answers
79 views

DFT of $g(\omega) \exp(i C \omega^2)$. How to do it ,if uniform sampling requires too much memory?

I have a following problem : I want to transform a function $g(\omega) \exp(i C \omega^2)$. $g(\omega)$ is real and limited. It changes slowly compered to $\exp(i C \omega^2)$. I have a black box that ...
1
vote
1answer
81 views

Use Slepc from Matlab

Is there a direct way to use SLEPC from Matlab? I remember that in some old manuals there was some Matlab interface. However, in the last one, I cannot find any reference to this. For me it would be ...
11
votes
2answers
1k views

Solid mechanics with finite differences: How to handle “corner nodes”?

I have a question concerning coding boundary conditions for solid mechanics (linear elasticity). In the special case I have to use finite differences (3D). I am very new to this topic, so perhaps some ...

15 30 50 per page