instruction
stringlengths
43
28.1k
I want to solve a system of ordinary differential equations with Matlab. I need this to solve a mechanical engineering related problem. If $n$ is the number of degrees of freedom of my mechanical system, then the number of variables (and also of equations, obviously) is $n^2$. I can easily numerically integrate the OD...
Recently, I read a paper [1] and then I want to handle the two-dimensional linear integro-differential equation \begin{equation*} -\triangle u + q\Big(\frac{\partial u}{\partial x} + \frac{\partial u}{\partial y} \Big) + \gamma\int^{y}_0\int^{x}_0 \mathcal{K}(x, y, s,t) u(s,t)ds dt = g(x, y),\quad\ (x, y) \in \Omega. \...
I have a little question that might be basic for some experts, but right now, its not clear for me. I want to implement temperature depending viscosity in a finite difference scheme (incompressible fluid). Therefore, I get for the viscous term $\frac{\partial}{\partial x_j} \left( \nu \left(\frac{\partial u_i}{\partial...
As the title suggests, I'm looking for a very accurate algorithm to find the area under an oscillatory function. For instance, I would like to integrate the following graph I'm currently using simpson's method to integrate this, but I was wondering if there are more accurate methods.
I have a 3-tensor $A = A_{ijk}$ with each dimension between 9 and 25 (roughly), and an integer $n > 0$. I would like the factor this tensor as $$A_{ijk} = \sum_{0 \le \alpha \lt n} B_{\alpha i} C_{\alpha j} D_{\alpha k}$$ such that that $B$, $C$, and $D$ are optimally conditioned possibly rectangular matrices. I'm no...
I have a large vector with complex numbers. How do I check whether it a conjugate symmetry vector? If not, is there any way to transform it?
Let $\Omega\subset \mathbb{R}^d$, $d\in \{2,3\}$ be an open bounded polygonal/polyhedral set. Suppose I want to solve the following pde \begin{align*} \vec{q}+\vec{\nabla}u &=0\,&x&\in \Omega\\ \vec{\nabla} \cdot \vec{q} &= f\, \quad& x&\in \Omega\\ u&=0\,& x&\in \partial\Omega_{\mathrm{dir}}\\ \vec{q}\cdot \vec{\eta}...
I am considering approximating the operator of the BVP \begin{cases} -u''+u'=g,&\quad x\in [a,b]\\ u'(a)=-1, u'(b)=1, \end{cases} by a matrix. I tried to use the idea of finite difference method. I first consider the operator of the homogenuous BVP \begin{cases} -u''+u'=\lambda u,&\quad x\in [a,b]\\ u'(a)=u'(b)=0. ...
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 want to know how exactly these environments work to get the most of the hardware. It would be great if someone would sugges...
Suppose I have a complicated structure given in 2 or 3 dimensions as a polygon mesh. For example, this could represent a "cave" or an assembly of irreguar shaped particles or a tree, whatever. Now I'd like to "smoothen" this structure to end up with a finer and smoother polygon mesh. It's not just about refining the me...
I am interested in implementing pressure inlet boundary conditions for the 2D compressible Euler equations. My equation of state is an ideal gas ($p=\rho R T$) which is thermally prefect but not calorically perfect, i.e. $c_p\equiv c_p(T)$ is a non-constant functions of $T$ alone. The boundary condition specifies total...
Recall that a unit lower triangular matrix $L\in\mathbb{R}^{n\times n}$ is a lower triangular matrix with diagonal elements $e_i^{T}L e_i = \lambda_{ii} = 1$. An elementary unit lower triangular column form matrix, $L_i$, is an elementary unit lower triangular matrix in which all of the nonzero subdiagonal elements ar...
Are there benchmarks for how many multiplications of various integer types compared to floating point types can be achieved per second on modern CPUs? I'm trying to get some hint if it would be worth to make a c implementation of an integer arithmetics algorithm. I.e. would there be speed gains to be had on modern CPU...
I need to implement a 3D version of the Corner Transport Upwind (CTU) finite volume method (in python); and so I've been reading Leveque, "Finite Volume Methods for Hyperbolic Problems" which I think is quite good. Shown below is the critical section regarding how to generalize CTU for linear advection to arbitrary vel...
I am trying to solve the drift-diffusion model with generation, $$\frac{\partial N_e}{\partial t} = \alpha(x) \left| \Gamma_e (x,t) \right| - \frac{\partial \Gamma_e}{\partial x} (x,t)$$ $$\frac{\partial N_i}{\partial t} = \alpha(x) \left| \Gamma_e (x,t) \right| - \frac{\partial \Gamma_i}{\partial x} (x,t)$$ where $$\G...
I'm trying to solve the optimization problem below with MatLab, but I'm unsure of how to modify the constraints in the quadprog function (or how to add the constraints with the Portfolio object). In the formulation below, omega is the weight of the asset in the portfolio (which we are trying to find). The capital sigm...
I'm interested in using a SWT to perform Multi Resolution Analysis over 3D data arrays. However I could not find any software package that implements it. The Matlab Toolbox of wavelets (the most complete I think) only has 3D DWT and 2D SWT, so my questions are: There exists a working implementation of 3D SWT out there...
I want to obtain the convolution of two discretized real functions $f$ and $g$, $$ c(t) = \int_{-\infty}^{+\infty} \mathrm{d}{x} \, f(x) \, g(t-x) \tag{1} $$ via discrete Fourier transform (DFT). As a concrete example, let $x \in [-6, 6]$ be the $x$-axis on which the functions are defined, with $$ f(x) = \Theta(x) \, e...
I've been trying to find an applicable PDE solver for cases such as this: Although when dealing with stiff equations in the complex domain, applying existing packages has been problematic. I've looked into FiPy but it doesn't seem to be able to handle complex numbers well. A possible method was to split each function...
I am currently working on a physics problem that turns into a non-linear boundary value problem. I need an efficient numerical solver that I could run on my laptop with i5 dual core CPU. I am discretizing my 15 equations on an N x N x N cubic grid using fourth order finite difference derivatives. I am interested in usi...
I have quite simple problem of FEM solution of 1D differential non-linear equation. Altough the problem itself is simple, the numerical solution of the arising system of non-linear algebraic equations takes hours. The system is tridiagonal type, typical for 1D FEM problems. At the moment I am using Picard or Newton me...
I'm having difficulty with numerically solving the inviscid burgers equation.Godunov's scheme is used in most of what I've found in literature . Now my question is if using a crank nicolson shceme is wrong or not? $\frac{\partial u}{\partial t} + u\frac{\partial u}{\partial x}=0$ with this BC: at $t> 0 ,x=0$ : $u=1$...
I am running octave and i have been trying ode45, ode54, ode23 etc to integrate the equation ` $$Q''(t) = B\cos(Q)\sin(\omega t)$$ $$Q(t=0)=0.$$ When the time interval to be integrated increases, the execution time increases non-linearly. Integrating from t=0 to t=T takes 1.2 seconds. For 10T it takes 12 seconds, fine!...
Lately, I was reading some seminal papers on Fractional Step Algorithms and I found this one: Kim, D., Choi, H. A Second-Order Time-Accurate Finite Volume Method for Unsteady Incompressible Flow on Hybrid Unstructured Grids. Journal of Computational Physics, Volume 162, Issue 2, pp. 411-428 (2000) And I am confused o...
I have implemented a Quasi-Newton method based on the Hessian approximation. I am noticing that the algorithm takes too many iterations to converge, even though it does converge. What I am not able to understand is the really small step size ($l_{\infty} \text{norm} \le 10^{-5}$) for many of these iterations. The probl...
In d'Halluin et al. (2005) (http://imajna.oxfordjournals.org/content/25/1/87.short) the authors claim that the correlation integral $$ I(x) = \int_{-\infty}^{\infty} V(x+y) f(y) dy $$ can be approximated with FFT methods by $$ I_{k} = IFFT((FFT(V)_{k})(FFT(f))_{k}^{*}) $$ where $(.)^{*}$ denotes the complex conjugate. ...
It is easy to prove that, $$\{p_1(x,y)=1-x-y\;,\;p_2(x,y)=x\;,\;p_3(x,y)=y\}$$ is a Lagrangian basis of $\mathbb{P}_1(\hat{T})$ (polynomials of total degree less that 1 living on $\hat T$), where $\hat T$ is the triangle with vertices $a_1=(0,0)$, $a_2=(1,0)$ and $a_3(0,1)$. It is clear that $p_i(a_j)=1$ if $i=j$ and $...
I have an $n$ by $m$ numpy array representing a rectangular lattice $L$, where each site contains a one or a zero, representing two different materials. I'm modelling heat flow across this lattice. The idea is that the conductivity between two lattice sites depends on the material in both sites. To solve the heat equat...
Suppose you are attempting to solve $Ax = b$ using linear stationary iteration method defined by $$x_k = G x_{k-1} + f$$ that is consistent with $Ax = b$, i.e., for which $f = (I - G)A^{-1}b$. Suppose the eigenvalues of $G$ are real and such that $|\lambda_1| > 1$ and $|\lambda_i| < 1$ for $2\leq i \leq n$. Also, supp...
I need to model a "fishing rod" in 2 dimensions by joining several "rigid sticks" by flexible/elastic joints. The joints act as plate/torsion springs with different spring constants. The "fishing rod" will bend at these joints. The segments of the rod become lighter and the springs softer, towards the tip. The only inp...
I have an ODE for a scalar function $u=u(t)$ of the form: $$ \frac{du}{dt}=L(u). $$ Here the function $L=L(u)$ satisfies: $$ L(0)=0, \quad L'(u)\le0. $$ Then it is easy to see that the solution $u=u(t)$ has the following property: (i) If the initial value $u(0)\ge0$, then $u(t)\ge0$ for any $t>0$; (ii) If the initial v...
Many sources present the Euler, Verlet, velocity Verlet, and leapfrog algorithms for integrating Newton's equations. Based on the order of accuracy, it is agreed that velocity Verlet, Verlet, and leapfrog are superior to the Euler method. It can also be shown that the Verlet and velocity methods are algebraically equ...
I am trying to run a pbs file which runs a script on a cluster. The script prompts for a user input. I wish to write this user input in my pbs file, what is a good way to do this?
Let $A\in\mathbb{R}^{n\times n}$ is symmetric positive definite and consider solving linear system $Ax = b$. Show that the symmetric Gauss-Seidel iteration converges for any $x_0$. Solution - Since $A$ is symmetric positive definite and $A = D - L - U$ is the usual partitioning into diagonal, strict lower and strict ...
I have a large scale system with the following equations of motions $M\ddot z(t)+K z(t)=F(t)$ $M$ is the mass matrix $K$ is the stiffness matrix And I want to solve the equation for displacement $z(t)$, the eigenvalues and the eigenvectors with load dependent Ritz Analysis ( the algorithm is described succinctly in her...
I would like to solve 3D transient incompressible Navier-Stokes with FEM, Newton method, Schur-based preconditioner, Lagrangean P2/P1 elements (no stabilization), in a rigid pipe discretized with tetrahedrons. The fluid is initially at rest, I impose constant inlet and outlet pressure boundary conditions (and therefore...
I know that when modeling incompressible flow in a pipe, it is common practice that when you have a velocity inlet, there should be a zero pressure gradient at the inlet as well. Also, when you have a pressure outlet, you should set the velocity gradient to zero at the outlet. But when you have both a pressure inlet ...
I am simulating in COMSOL a system of 3 coupled PDEs (parabolic & elliptic) along with 10 stiff ODEs. In order to have the system working, I am downsizing the time step size too much to achieve convergence. I am lucky enough that I am doing 1D simulations which don't take too much time, but this drives me to think abou...
I have simple code, which flags nodes with in region enclosed by cylinder. On implementing the code, the result is mild tilt of the cylinder observed case with $\theta=90^{\circ}$. The algorithm for checking any point inside arbitrarily oriented cylinder is as follows. Let $\vec{r}$ be the vector joining center $\vec{c...
I am engaged with the syntheses and DFT calculations of coordination complexes. I wonder how can I set up the basis set for carried out using B3LYP method and mixed basis sets of LanL2DZ for Pd and 6-31+G(d) for all other atoms, in the use of DFT theory by Gaussian 09W. can any one please explain for me?
This is my first question. I have the following data that I'd like to approximate as a parametric function: \begin{align} y = a + (bx_1 + cx_2 + dx_3 + ex_1x_2 + fx_1x_3 + gx_2x_3 + hx_1x_2x_3 + i)*(j*\sin(kx_1x_2x_3) + l\cos(mx_1x_2x_3)) \end{align} testdata <- read.csv('..path_to_file/gistfile1.txt', sep = "") plot(...
NVIDIA's Tesla GPUs for Servers includes market segments called "Hyperscale HPC" and "Strong-Scale HPC". How different is "Strong-Scale"ing from "Hyperscale"ing ?
I coded a finite element method with linear basis elements for the problem $$-u'' = f(x), x\in[0,1], u(0) = u(1) = 0$$ The nodes are uniformly spaced and I will denote them as $x_i$. I initially calculated the error of my method as $$\text{error} = \max_i |u(x_i) - \hat{u}(x_i)|$$ where $\hat{u}$ denotes the FEM soluti...
The simple average is commonly used to combine the predictions out of different predictive models. Apart form the simple average, what are the other methods that can be used for combining the predictive models to get more accurate predictions?
I am doing a project on the finite element method. I want to know how to form the mass matrix. Can you please point me out to the resources on the finite element method, where the procedure of assembling a mass matrix is described in detail.
I am interested in the numerical solution of the following system of non-linear partial-differential algebraic equations, where the independent variables are $X$ and $T$, representing non-dimensional space and time, respectively. The fields are: $$ f = f(X,T)$$ $$ g = g(T)$$ $$ \xi = \xi(T)$$ $$ \psi = \psi(T)$$ The sy...
So I have a collection of systems of equations, basically $n$ systems of equations, each composed of $k$ equations: $$\frac{a_1x_{1j}}{a_1x_{1j} + \cdots + a_kx_{kj}} + \log x_{1j} + 1 - B_{1j} = 0$$ $$\frac{a_2x_{2j}}{a_1x_{1j} + \cdots + a_kx_{kj}} + \log x_{2j} + 1 - B_{2j} = 0$$ $$\vdots$$ $$\frac{a_kx_{kj}}{a_1x_{...
I'm attempting to implement velocity Verlet with a harmonic oscillator in C, but I have some errors: Energy is not being conserved Energy oscillates much more than I would expect I believe the error has to do with my position function or definitions, as the PE is blowing up much faster than the KE is going down, but ...
How to define a variable which is an integral involving cauchy principal value inside in any computer programming language? I want to know how to break down the procedure step by step from a computational science viewpoint. This is the integral I encounter: $S(\omega') = \int_0^\infty d \omega \frac{1}{\omega} \left( ...
Using the SciPy/NumPy libraries, Python is a pretty cool and performing platform for scientific computing. I just wonder: When I have to go parallel (multi-thread, multi-core, multi-node, gpu), what does Python offer? I'm mostly looking for something that is fully compatible with the current NumPy implementation. The c...
The Schrodinger equation for time-dependent Hamiltonian is $$i\hbar\frac{d}{dt}\psi(t) = H(t)\psi(t) \, .$$ I try to implement solve the Schrodinger equation for time-dependent Hamiltonian in ODE 45. However, because the Hamiltonian $H(t)$ is dependent on time, I do not know how to do interpolation in ode45. Can you g...
I'm having some performance problems with my code dealing with the multiplication of big sparse matrices (stiffness and aerodynamic influence coefficient matrices). Mainly I have to multiply such matrices frequently in my code with each other. Basically, one should of course not multiply sparse matrices but rather use ...
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 explain why the Collocation method also belongs to the projection methods? I find a reference "Projection methods and the cur...
tldr: Can space-time Galerkin schemes applied to convection-diffusion problems lead to effects on the convection velocity? For time $t\in (0,1)$ and the spatial variable $\xi \in (0,1)$, I am considering the viscous Burger's equation $$\dot z + \frac 12\partial_\xi (z^2) - \nu \partial_{\xi\xi}z = 0 \tag{*} $$ with a ...
Let $f:(0,1)\rightarrow [0,1]$ be a $\mathcal{C}^{\infty}$ function. We say that a function $D_r^f:\{1,...,r\}\rightarrow [0,1]$ is an $r$-discretization of $f$ if $$D_r^f(j) = \frac{1}{|a(j)-b(j)|}\cdot\int_{(a(j),b(j))} f(x)\;dx$$ where $a(j)=\frac{(j-1)}{r}$ and $b(j) = \frac{j}{r}$. In other words, we divide the in...
I've been running some complicated Finite Element Models. In most cases, the stress repartition seemed to be absolutely correct. However, on several point (complicated geometry), it appears that stress is way beyond the overall stress in that area. The same goes for calculus of hydrostatic pressure. While all the model...
I've recently finished an introductory course on the finite element method from a more mathematical perspective (following Brenner and Scott) and we were introduced to the finite element mass matrix in elliptic problems as the matrix arising from terms without a derivative. For example, a one-dimensional Helmholtz type...
To be specific, let's consider Support Vector Machines. In the 1 vs all case, one has $n$ binary classifiers where $n$ is the number of classes. In each classifier one has two labels 0, 1 and for a given test data set, one can predict $\rm Prob(0)$ and $\rm Prob(1)$. But how to compute prediction probability $\rm Prob(...
I am trying to simulate elastoplastic seismic wave propagation using Fenics Solid Mechanics Application. The app. provides some quasi-static demos to show elastoplastic behaviour in a cube/ beam/ square. The weak form they implement is taken from page 199 of this paper written by the developers themselves, and is given...
I am trying to use a projection method that deals with the viscous effects implicitly to model flow around a cylinder. I'm having trouble figuring out what the boundary conditions should be, particularly on the inflow and outflow. I think we can consider the Stokes equations without loss of generality: $$ \mathbf{u}_...
I am a little confused about the connection between variables for the plain advection pde: $$u_t+au_x=0$$ So initially I thought $x$ and $t$ are independent and $u$ is a function of those, but then we can write the same PDE and say that there are characteristics and then we have ODE for them: $$\frac{dx}{dt}=a$$ So, no...
I want to solve the advection equation: $u_t+au_x=0, a > 0$. Here is our method: $$U_j^{n+1}=U_{j-1}^n-\left(\frac{ak}{h}-1\right)(U_{j-1}^n - U_{j-2}^n)$$ I am trying to answer the following question: "Say we fix $h$, then for which values of $k$ is this method exact? Note that there's more than one value." I know tha...
I'm simulating a biological phenomena with reaction diffusion equations. There are multiple diffusing materials and there are some complex relations about consumption and production of such materials. What is the best way to simulate these interactions? Is finite elements method appropriate? and is there any tool, whic...
I am writing a Fortran program that does fairly light weigt computation on fairly large data files. The output must be readable by some Java-script (that i have no insight in) and preferably also by other languages/programs like PHP and Matlab. Using formatted data the I/O requires about 50 times more time than the pr...
I have a 2D square mesh and a 3D beam shaped mesh and I want to propagate a seismic wave in them. I am trying to simulate them using Open source FEM codes (fenics). I have left the top surface to be free because that is where we would see a response (ground motion). I have also set the other boundaries except the botto...
I would like to find the intersection points e.g. $M_x$ and $M_y$ as in the attached figure. The boundary (solid line) is defined by the Lagrangian points. I am working in C++ (basic - medium proficiency). In this regard, I need a computer algorithm or code to get the intersection points both in x- and y-in a separate ...
I am working on an program to compute the structure factor of a given configuration of particles, and I need an efficient algorithm to generate all the possible vectors with integer coordinates and magnitude between $n-\delta$ and $n+\delta$, where $\delta$ is small compared to $n$. This is equivalent to finding all th...
I am looking for a discrete Fourier transform (DFT) library that can be run with MPI on Python. Usually, in other languages (C, Fortran) FFTW is used. There's a Python wrapper for FFTW called pyFFTW, it does support multithreading but seemingly not MPI.
I am actually confused about time stepping for PDEs. Before, I was distretizing time using backward Euler method for implicit formulation and I get a system of Algebraic equations to solve. Now during my research when I read papers, I find they disctretize space only leaving time derivative which yields system ODEs? W...
I have been reading about the heat equation and I am confused about uniqueness in the case when the domain is bounded and when it is not. In the book I am following, it is common to write the heat equation over [0,1], with zero values on the boundaries and shows that a series solves that equation. I can follow that, an...
I am having a hard time understanding the very first example in "A Tutorial on Stochastic Programming". More specifically the authors show that one can formulate the stochastic variant of (1.2) with Eq (1.8). My question: How should one interpret (1.8) (i.e. how do the new inequalities allow us to explore two differ...
Recently, I obtain a linear system, $Ax = b$, where $A$ is a nonsingular, strictly diagonally dominant $M$-matrix. Then I also got a matrix splitting $A = S - T$, where $S$ is also a nonsingular, strictly diagonally dominant $M$-matrix. So I establish a stationary iteration scheme as follows, $$Sx^{(k+1)} = Tx^{(k)} +...
I'm relatively new to fenics and I just looked through all questions related to Dirichlet boundary conditions. I don't seem to find a well-described question or answer about what I'm about to ask. I'm solving a PDE-constrained optimization problem and I have "measured data" from experiment defined on all nodes of my me...
I am working on moving least square approximation. To well-define of this method, the following matrix of size $n \times m$ must be of rank $m$. For $m=3$ $${\bf A }=\begin{pmatrix} 1&x_1&y_1\\ 1&x_2&y_2\\ \vdots & \vdots & \vdots\\ 1&x_n&y_n \end{pmatrix},$$ where $x_i,y_i$ are point's coordinates lie in the supprt an...
I want to find the roots for $\kappa$ for the equation $$\sqrt{\alpha - 1} \cos{\left (\frac{\sqrt{2} \sqrt{\alpha - 1}}{2 \sqrt{\epsilon}} \right )} \cosh{\left (\frac{\sqrt{2} \sqrt{\alpha + 1}}{2 \sqrt{\epsilon}} \right )} - \sqrt{\alpha - 1} \\ -\frac{1}{\sqrt{\alpha + 1}} \sin{\left (\frac{\sqrt{2} \sqrt{\alpha -...
I am solving a partial differential algebraic equation (PDAE) system which has the following dependent variables: $f=f(X,T)$ and $g=g(T)$, along with a few others My current method for coupling is to use fixed-point iteration with constant under-relaxation factors for the two coupled variables $f$ and $g$. The issue is...
A problem I have had on my mind recently has been a compact way to compute the size of an $N$-Dimensional Polynomial basis of some order $p$, where a linear basis is $p=1$. I have attempted searching for such a formula online but haven't been able to stumble upon one. I have to believe a formula for this computation e...
In what sense is the weighted Frobenius norm "adimensional"/"scale-invariant" for any symmetric positive definite weight matrix $W$? If we plug in a positive diagonal matrix into $W$ wee see that $||A||_W$ is not always $||TA||_W$ for a one-to-one transformation $T$. See page 196 of Nocedal's book on numerical optimiz...
I'm working on a MD simulation using the Lennard-Jones potential and the Velocity Verlet algorithm. The code compiles and runs, but the energy for each time step is not conserved; it decreases constantly when run. The magnitude of the potential energy is much larger than that of the kinetic energy, but I haven't been a...
I need to find the smallest few eigenvalues of a Hamiltonian (exact diagonalization) I use Python, and SciPy's built-in sparse eigenvalue solver. I notice, however, that for my small system (only a 40k x 40k matrix) the program takes hours, maybe even days. I began to suspect something was up. One thing I note is that ...
During the past ~4.5 years of my PhD, I have written an MD code, based largely on LAMMPS and NAMD, however reparallelized to suit my computational scenario better. One important thing to mention possibly for this discussion is that the code runs in SPDP mode to take advantage of the wide vector registers on xeon phi co...
Admittedly, I'm new to the subject, so this is probably a really simple question. Let's assume I want to solve the (large sparse) linear system Ax = b multiple times with algebraic multigrid and b changes (slightly) every time. As I understand it, AMG selects its coarse grid based on the smoothness of the error, which ...
I wrote a Matlab code for solving 2D Poisson equation $u_{xx} + u_{yy} + f(x,y) = 0$ on $[a,b]\times [c,d]$ with neumann boundary condition on $x = b$ and the other boundary conditions are dirichlet,I used finite difference methods.My code is as follows: function [u,err] = poissonFDM(a,b,c,d,j1,j2,fun,g,typebound,boun...
Looking at the plain heat equation $u_t=u_{xx}$ the explicit scheme for it would look like the following iteration: $$u_{m,n+1}=\rho u_{m-1,n}+(1-2\rho)u_{m,n}+\rho u_{m+1,n}$$ I noticed this equation resembles some probability equation: basically If I look at it as: $$u_{m,n+1}=p_1 u_{m-1,n}+p_2u_{m,n}+p_3u_{m+1,n}$$ ...
Actually I am reading a book about the Lattice Boltzmann methods, and here is a quotation: After introducing BGKW approximation, the Boltzmann equation (without external forces) can be approximated as, $$\dfrac{\partial f}{\partial t}+c\cdot \nabla f=\dfrac1\tau\left(f^{eq}-f\right)\tag{1}$$ In lattice Boltzmann me...
I have a linear elastic wave propagation code and an elastoplastic wave propagation code based on FEniCS. For now, I keep the 2D mesh (100, 100) fineness unit square and give a source wave of $\sin(40 \pi t)$ in form of Dirichlet BC on one edge of square. For Newmark time discretization method, using $\beta = 0.25$ gi...
How difficult is it to program an automatic software using C that is able to read astronomy images of up to 4096x4096 pixels (or other sensor geometries), search for bright or faint blobs, calculate its subpixel centroid, compare with the same locations of other the previous or next image, look for other blobs in those...
$\DeclareMathOperator{\diag}{diag}$ Consider the generalized eigenproblem $A\mathbf{x}=\lambda B\mathbf{x}$. When solving PDEs numerically (specifically, I am interested on finding the Dirichlet eigenmodes of the 2D laplacian in orthogonal coordinates, i.e. $\nabla^2 u=\lambda u$) this problem takes the form $$ A_1X + ...
I would like to draw a texture (in Matlab - Psychtoolbox) which is composed of a sinusoidally-modulated isoluminant (magenta & cyan) grating. I do have the RGB matrices of the two phases (for magenta and cyan) and I need them to get blended into the background gray at zero-crossing points. Could you please help me in f...
I'm currently trying to implement a FEM to solve a type of wave equation with homogeneous Dirichlet boundary conditions by using standard $\mathcal{P}_1$ triangle elements and an explicit scheme for the time discretization. In every discrete time step, the solution of a linear system with the mass matrix $$M_{i,j} = \...
In my program I have a complex symmetric tridiagonal matrix. In order to perform some algorithmic optimizations I am searching for a (ideally linear) mapping from $n\times n$ complex symmetric tridiagonal to $2n \times 2n$ real symmetric tridiagonal. Does such a mapping exist?
Suppose we are given an RRQR factorization for some matrix $A \in \mathbb{R}^{m \times n}$, $A\Pi = QR$ where $m > n$. Is there a cheap way to update $A' = A + uv^{\top}$ given this factorization? I am aware of how to update the QR factorization given a rank-one update, but I am unsure how to update $\Pi$ as well to g...
I am using the FDFD method to calculate eigenmodes for an empty wave guide. It's a 1x1meter structure with a PEC boundary. (Here I have 6x6 points to make it simple). Sounds simple, but I can't get it right. At each mesh point my source free E-Field is allocated and calculated using the Helmholtz-equation: $(∇^2-\lambd...
Are there numerical methods of solving the following fully nonlinear time-dependent PDE: $$\nabla^2u\left(\textbf{r}(t), \dot{r}(t), t\right)=f\left(\textbf{r}(t), \dot{r}(t), t\right),$$ for $\textbf{r}(t)$, where $\nabla^2 = \frac{\partial^2}{\partial^2 x}+\frac{\partial^2}{\partial^2 y}+\frac{\partial^2}{\partial^2 ...
I am trying to solve the following problem via a finite difference approximation: $u_t = k \, u_{xx}$, on $0 < x < L$ and $t > 0$; $u(0,t) = u(L,t) = 0$; $u(x,0) = f(x)$. I take $u(x,0) = f(x) = x^2$ for my problem. Programming is not my forte at all, so I am having some issues with the implementation. Here is my code:...
To implement hybridizable discontinuous Galerkin methods, one needs finite element spaces defined on the skeleton of the mesh. deal.II has support for HDG through FE_FaceQ class which provides discontinuous Lagrange functions supported on the skeleton of the mesh. I want to know if there are other libraries which provi...
I have recently acquired a server that I will be using for distributed simulations. However, I was wondering how do I determine which MPI version the server is compatible with? The reason that I am asking this is that I acquired it from a reseller who buys old computer equipment (for those wondering, it is an IBM blade...
Does anyone know of references discussing the solution of 4th order PDEs by way of spectral/hp-finite element methods? Specifically, I'm interested in the extension of the spectral element method, which uses high-order Lagrange polynomial interpolants (at a suitable distribution of nodes) as shape functions. In this ...
I apologize if this is a relative simple question. I am very new to setting up a cluster computer and I am attempting to make heads and tails of the information. I was reading on setting up a cluster with MPICH in ubuntu. And it seemed like it was a "simple" process. The process was a simple 1,2,3 step process. Then I...
I am solving a 3D heat transfer equation with variable boundaries (insulated, convective, radiative or free) using a F.D.M. technique. My geometry of choice is a cube. The purpose of my work is to get more familiar with such problems -- out of interest -- and their parallelizations using both distributed (MPI) and shar...