instruction
stringlengths
43
28.1k
What is the difference between an explicit and implicit preconditioner?
Suppose we have a $f(x)$ to be minimized (we only know that $f(x)$ is three-differentiable), and a feasible, convex set of $S$ such that all $x$ belong to $S$. Using line search method, how we can "mathematically" prove that a descending direction pointing from previous $x$ towards a new $x$ within the $S$ exists? And,...
I'd like to take an photograph, subdivide it into a tesselation, either of squares, or (ideally), hexagons, and then find the centre of gravity (or, if you prefer, centre of mass) of each cell of the tesselation. The output, for any image, would be a matrix of points. For the attached diagram, something like this (in p...
The set of constructable numbers is commonly defined in one of two ways: the set of finite numbers reachable from the rational numbers through a finite sequence of addition/subtraction, multiplication/division, and square root operations. They are also defined as an infinite chain of "field extensions" on the rational...
Consider a real symmetric matrix of dimension N~10^5 and rank m~2000. What is the most efficient algorithm for determining the top m eigenvectors? If the answer isn't obvious, are there existing routines for this in languages like MATLAB or Python?
(a) Consider the following differential Equation $$Y'(t)=\frac{1}{1+t^{2}}-2[Y(t)]^2$$ $$Y(0)=0$$ The exact solution is $$Y(t)=\frac{t}{1+t^2}$$ Using the Euler method to solve the following differential equation with the help of matlab (code given below), run the program for $t=10$ and $h=0.1$ compute the error.Then...
I have a data file with some points equally spaced. These represent some function. I have to calculate the Fourier transform of this set of points. The thing is, I'm tempted to take a cubic spline of these data points to calculate the Fourier transform by FFT (actually I'm more than tempted, since I have done it alread...
Consider random variables $X$ and $Y$, their distributions are given. $Z = f_a(X, Y)$ where $f(\cdot, \cdot)$ is a deterministic, not random function $f_a: \mathbb{R}^2 \to \mathbb{R}$ depending on a deterministic real parameter $a$. For example, let $f_a(X,Y)=\sin X + e^{aXY}$. I've read a lot about Bayesian modellin...
(Note: Corrected code is posted below the original code.) For an exercise in optimization, I am interested in coding a simple example from scratch: a Tikhonov denoising routine using gradient descent, that matches exactly in output the LSQ-based Tikhonov denoising result. For regularisation of a noised signal $b$ to re...
I'm interested in testing some algorithms on the heat equation, and I'd like to assess their accuracy. When evolving a Hamiltonian system, one has the energy to check the validity/correctness of the algorithm, which turns out to be (arguably) the most important quantity to check. Is there a similar quantity for the hea...
I am doing a little project on solving the heat equation using finite-volume method on a solid cube, I converted the polyhedral mesh of the cube to an OpenFOAM mesh. I have a Python code where I parse the points, faces, owner, neighbour and boundary files of the OF case mesh, I've managed to create a hash list (let's c...
I have crude idea that numerical diffusion arises while using upwind scheme and causes solution to deviate from its original one. But I am unable to understand how numerical diffusion phenomenon is (directly) related to advection phenomenon?
I am trying to implement Adaptive Mesh Refinement. I am not a Mathematics/Computational Science person so I will try to write the algorithm in a simpler way. I will be grateful if experts can comment on the correctness of steps: Aim: To solve Laplace Equation with Dirichlet boundary conditions i.e. $\nabla^{2} u = 0 $...
I need to compare two computers and decide which one I want. My goal is to run faster simulations. The current run time is 3.5 hours and I would like to reduce that as much as possible. The code I am running has the capability of running on multiple processors (parallel). Which specifications of the pc should I pay at...
I have a question regarding the treatment of Robin boundary conditions in a multigrid solver. I am solving the Poisson equation in $\Omega=(0,1)^2$ with Robin boundary conditions on the boundary, $$- \Delta u = f \text{ in } \Omega$$ and $$\frac{\partial u}{\partial n} - au= g \text{ on } \partial \Omega.$$ I use a fin...
In my optimization problem, the hessian has a structure such that it can be written as the sum of two matrices. Populating the first of the matrices is efficient. Populating the second one is computationally very heavy and practically makes methods like truncated Newton useless. However, the second matrix is block diag...
I simply want to know whether the Dormand-Prince Numerical Method or the Cash-Karp Numerical Method is more accurate.
I have two graphs with nearly n~100000 nodes each. In both graphs, each node is connected to exactly 3 other nodes so the adjacency matrix is symmetric and very sparse. The hard part is I need all eigenvalues of the adjacency matrix but not eigenvectors. To be accurate, this is going to be once in my lifetime (as far a...
I know that, from numerical point of view, computing Ax = b B=inv(A), x= B*b are completely different things, and we should factor the matrix using TRF routine then solve with TRS/TRI routine, or in a combined gesv call. Anyway is there an efficiently routine to specifically deal with C = A* inv(B) BTW, I know some ...
I would like to program the following difference equation. Find numbers $v_{i,j}$ so that for $1\leq i\leq 4$, $0\leq j\leq 5$: $$ v_{i,j+1} = (0.1)v_{i+1,j} + (0.8)v_{i,j} + (0.1)v_{i-1,j} $$ In addition it satisfies the conditions, for $0\leq j\leq 5$: $$ v_{0,j} = (0.2)j \text{ and }v_{5,j} = 25 + (0.2)j$$ And fi...
Dekker's method and in its evolution Brent's method have as design goal to combine the certainty of a root, certified by function values of opposite sign in an increasingly smaller interval, of bracketing methods like bisection and regula falsi with the fast convergence of the secant (and higher degree of (reverse) int...
I have made a 2d slice cut of a 3 dimension figure. When I select "mesh" to display the mesh on the slice, tecplot seems to connect the vertices in a strange way (it seems like two 2d meshes are superimposed). I found a similar question in the forum of tecplot but they did not answer it. Edit: Here is a capture of the ...
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 distorted triangles. Let us assume my vertex P(x,y,z) moves to P'(x',y',z') How to calculate the resulting change in mesh quali...
I am playing around with Elemental's distributed singular value decomposition and am running into two particular issues. Building the test at tests/lapack_like/SVD.cpp, and running with mpirun -np 4 ./SVD --height 3 --width 3 I get SVD residual was unacceptably large for the distributed Complex<float> test (but seque...
In physical problems, it's quite common that we need to solve for specific eigenvalues in the complex plane, e.g. with a positive real part and negative imaginary part. In this case, we are looking for eigenvalues and associated eigenvectors in the second quadrant. I am curious if the FEAST algorithm could deliver fast...
From my knowledge if you fit geometrical objects into point clouds you want in general minimize the squared distances of the point cloud to your fitted objects. I do so with the downhill simplex method by minimizing the average squared distance. I fit cylinders. In rare input scenarios I end up having not good fitted c...
I heard about Ramdisks some years ago and even set up one for testing on mymachine. I didn't test it thoroughly so I couldn't really judge the performance improvements (in comparison to plain a SSD). Ramdisks are in short parts of your working memory, which are allocated to a logical(software) disk. Therefore you can a...
Recently,I dive into a set of somehow ancient Fortran codes and try to fully understand them. A large fraction of these codes are multiple layers of loops over many state variable dimensions, which are aiming to find policy function(fixed point). That's OK, but what's really annoyed me is the messy expression of the gr...
I am a beginner in computational science and programming. I am doing research in non linear solid mechanics analysis and using C++ for coding. I have been exploring various finite element open source programs and saw some nice works like Deal.ii, FEniCS, OOFEM, libmesh. But as a beginner in C++ programming and finite e...
I have a problem with the following equation: $$ V_r\frac{\partial C_A}{\partial r} + \frac{V_\theta}{r}\frac{\partial C_A}{\partial \theta} = \frac{2}{Pe_A} \left[ \frac{\partial ^2 C_A}{\partial r ^2} + \frac{2}{r} \frac{\partial C_A}{\partial r} - k C_A\right] $$ I'm trying to solve this with finite difference tech...
I am looking for a PDF describing Chinese character component-based layout engine algorithms. These should allow for recursive encodings of radical and non-radical components, and the encodings should account for the structural layout of characters based on these layouts. Thank you.
my aim is to interpolate a function like this: I have |<--- h -->|<-------- k ----------->| o----------o------------------------o x(i-1) x(i) x(i+1) with respective values $f(x_i-h), f(x_i), f(x_i+k)$, now I want to approximate $f(x+k/2)$ using centered formula. I know for ex...
I am not very familiar with differential equations, nor physics in general. I am trying to program an object falling with air resistance with the use of a numerical algorithm called Runge-Kutta. The object is going to fall from the same position every-time $x=0$, with the same start speed $v=0$ every time. I think I t...
The Dirichlet boundary condition is $n \times \vec{E} = n \times \vec{g}$. I don't know how to calculate the boundary value. Any kind of help would be appreciated.
For 1D finite difference, the resulting linear system is tri-diagonal and can be solved in O(n) using the Thomas algorithm. I am trying to solve a finite difference system in 3D. Numerical Methods by Quarteroni et al goes over some theory behind extending the Thomas algorithm to block linear systems. This method seems...
Motivated by this top answer to the question: Why is convexity more important than quasi-convexity in optimization?, I am now hoping to understand why convex problems are easy to optimize (or at least easier than quasiconvex problems). What are some of the most efficient algorithms for convex optimization, and why can'...
I'm trying to do biologically based locomotion animation. I have a Hill-Type Muscle Model (see reference 1) that I've implemented in code. I can find the initial lengths of the tendons, then do a step and find the new velocities and forces. My question is, how do I use this information to simulate the muscle? Specifica...
I have a 2-dimensional system which I would like to solve numerically (I'm using finite difference method right now), and its an eigenvalue problem. I have a term that looks like $H\psi(x,y) = [-\frac{1}{2}(\frac{\partial^2}{\partial x^2} +\frac{\partial^2}{\partial y^2})+ i(y\frac{\partial}{\partial x} - x\frac{\parti...
I have read this and other threads on this site on BFGS, but I still don't have a clear understanding of what it's meant by low-rank updates. For example, I read the following in this book: The approach adopted by quasi-Newton methods (of which the BFGS algorithm is the most prominent) is to approximate the inverse ...
The last couple of hours I have been looking for an unconditionally stable method to solve the convection-diffusion equation within a 3D inhomogeneous material. Here's the well known diffusion-convection equation: $$\rho(\vec{r})C_p(\vec{r})\frac{\partial T(\vec{r},t)}{\partial t}=\nabla [\kappa(\vec{r})\nabla T(\vec{...
I'm trying to learn SPH by implementing different methods. I am currently following Divergence Free Smoothed Particle Hydrodynamics By Jan Bender [1]. I believe I understand the method and the math behind it. However I am not a able to correct the density error by finding the pressure forces because they are very small...
I'm somewhat struggling with how they are getting this scheme. This is a problem from Morton & Mayers book on numerical pde solutions. I think they are using a forward difference approximation for the 2nd order x-derivative but I just can't seem to figure out how. Sad day for me, but I would appreciate any insight. I t...
I'm trying to solve the PDE for $c(r,t)$ $$c_t=(1/r)(rJ)_r$$ using Crank-Nicolson, and I'm having difficulty with the boundary conditions. $J$ is the flux, the initial condition is $c(0,r)=c_{init}$, and the flux is 0 at both boundaries $r=r_0$ and $r=r_1$. The flux is $J=rDc_r-s\omega^2r^2c$; $D$ and $s$ may be functi...
I am wondering how to draw a sample complexity plot similar to the following figure which shows the estimated number of samples to incur no more than 10 percent generalisation error on average for the least squares algorithm for classification. The problem assumes that we have $m$ patterns $\mathbf{x}_1,...,\mathbf{x}...
Is there a faster way to compute the nuclear norm (trace norm, sum of singular values) of a matrix A than computing SVD(A) directly (or diagonalizing A^*A)? I am particularly interested in the case where A is square. Assuming that A is real would be OK too. I am thinking in the limit of large matrices.
I am trying to solve a differential equation system $$x´=Ax\quad \text{with } x(0) = f(x)$$ in Python, where $A$ indeed is a complex sparse matrix. For now i have been solving the system using the scipy.integrate.complex_ode class in the following way. def to_solver_function(time,vector): sendoff = np.dot(A, np.tr...
Question Below is a plot of a graph $y$ and its derivative $dy/dx$ calculated using python's numpy.gradientwhich approximates the derivative with finite differences using a central scheme. Clearly there is a problem in that unphysical kinks have been introduced in the result. Since differentiation will act to amplify ...
Most mesh generation software seems to be aimed at building nicely shaped elements for FEM. I'm curious about a different situation: I need to numerically integrate over an irregular region. I don't need to solve for any unknowns in this region -- just integrate a known function. And I need to integrate over many such...
For some time I wrote every bit of my code by myself without using external sources. However after my problems became more complicated I decided to use external libraries. For example to save and inspect the solutions of my computations, I chose to use vtk. I understand, that I cannot write everything on my own, but I ...
I have the following question. I have a code function that computes right-biased and left-biased approximations of the derivative of a function using WENO5 for Hamilton--Jacobi equations as described in @Article{Jiang2000, Title = {Weighted {ENO} Schemes for {Hamilton--Jacobi} Equations}, Author ...
Introduction to Problem I'm using a Truncated Signed Distance Function to perform 3D reconstruction from depth images. Essentially I have a large voxel grid where each voxel contains the signed distance to an implicit surface. The surface can be extracted form the Voxel Grid using a marching cubes algorithm to generate...
I have two computers, both with 4-cores and I am running some heavy computational stuff in one of them using Intel Parallel Studio Cluster edition. I am coding in fortran and making extensive use of OpenMP to parallelize the loops. I read that it should be possible to run this code using the two computers at the same ...
I am trying to evaluate the Exponential Integral $Ei(x)=-\int^{\infty}_{-x}\frac{e^{-t}}{t}dt$ for $x>0$ (interpreted as the Cauchy principal value) by using rational Chebyshev approximations, which can be found in a paper by Cody & Thacher "Chebyshev Approximations for the Exponential Integral $Ei(x)$". The paper is a...
Now I have been believing that FEM/CFD is supposed to be faster on a GPU unit - here I am using CUDA as solid example. However, I have not been able to find a convincing paper where the benchmark actually appear to me that 'Yes, this is true!'. Can I please be pointed to one? Or if not, is there any reasons why GPU u...
It is my understanding that the multigrid solution techniques are generally the preferable method to solve large Poisson problems. Now assume I have written a multigrid solver that is tailored to my special needs that actually works quite well, i.e. the residual norm decreases by a factor ~10 with every successive V-cy...
I am applying a 4th order Runge-Kutta code, using the method of lines, to solve the following: \begin{equation} \frac {\partial y_1}{\partial t} = y_2 y_3 - C_1 y_1 \end{equation} \begin{equation} \frac {\partial y_2}{\partial t} = y_3y_1 - C_2 y_2 \end{equation} \begin{equation} \frac {\partial y_3}{\partial z} = y_4...
There is a huge literature on efficient preconditioners for saddle-point problems. In computational physics, the case where the Lagrange multipliers enjoy a weak formulation (say, the Stokes equations) is almost always considered. In such cases, very fast solvers can be designed. Unfortunately, in structural mechanics,...
I was trying to understand how to use the inverse interation method to compute the page rank as an exercise. In this chapter (page 4) about page rank (by Cleve Moler), the author suggests to use the following statements to compute the page rank using the inverse iteration: c = sum(G, 1); k = find(c ~= 0); D = sparse(k,...
I have a discrete contour represented by a set of points. The contour looks like a polygon but if you zoom you see that the edges are rugged (that's because it was obtained while working on a finite differences grid) I would like to fit a polygon to this contour (which is closest in the least-squares sense). Are there ...
I have a working SPH simulation in 2D. When the particles are in motion everything works fine. But once the simulation comes to a rest particles at the bottom begin to oscillate violently and eventually penetrate the boundary particles. I have tried dampening the simulation with two types of viscosity, XSPH and Artific...
I am interested in writing a simple, cell-centered, 2D FVM code for the unsteady, compressible Navier-Stokes equations (including shocks). Most of my experience is with finite difference and finite element methods. I did develop a finite volume code for Sod's problem as a learning exercise a while back. I've been se...
The equation is: $\partial f/\partial t + \nabla \cdot (v f) = 0$ $, \;\; f \in [0,1] $ and $v$ is a velocity known at every grid cell. A more precise constraint is that $f$ is either 0 or 1 but I can also live with it being in the domain [0,1]. The geometry is 2D cylindrical R-Z coordinates. For the Initial condit...
I am running a PCA analysis on a data set using Python's (v2.7.10) NumPy. I validated that my program works by running the PCA analysis on a smaller dataset and then confirming that I get similar results using sklearn.decomposition. When I run my full dataset (with 60000 variables and 93 samples), I experience some st...
I am solving the simple 2nd-order wave equation: $$ \frac {\partial ^2 E}{\partial t^2} = c^2 \frac {\partial ^2 E}{\partial z^2} $$ Over a domain of (in SI units): $ z = [0,L=5]$m, $t = [0,t_{max} = 5]$s, $ c = 1$ m/s and boundary/initial conditions: $$ E(z=0) = E(z=L) = 0 $$ $$ E(t=0) = -E(t=t_{max}) = sin(\frac{\pi ...
I am currently trying to get through Pattern Classification by Duda et al (for a course). However, the book seems too dense for me. Pattern recognition seems like a topic that could be better learned through guided discovery. That made me think... There is a a thread over at mathematics SE about books that teach math b...
I am using an open source FEM platform, which requires you to convert your equation system to non-dimensional form. So, there are no units specified for the parameters in the problem. If you use compatible input units, you should expect the output in matching unit - just like one would do in a normal python or C++ code...
I am currently working on my bachelor’s diploma. The research concerns mixed finite element method for the 2D Stokes system $$ - \Delta \boldsymbol u + \nabla p = \boldsymbol f, \quad \boldsymbol x \in \Omega \subset \mathbb R^2, \\ \nabla \cdot \boldsymbol u = 0, \quad \boldsymbol x \in \Omega, $$ with homogeneous Dir...
I'm looking to numerically evaluate $\log f_p(z)$ and its derivative $f^\prime_p(z)/f_p(z)$ accurately and efficiently in floating-point, where $$ f_p(z)=\int_0^\infty r^{p-1} \exp\left(-\tfrac{1}{2} (r-z)^2\right)\,dr \ . $$ Let $\phi(x)$ and $\Phi(x)$ be the PDF and CDF of the standard normal distribution $x \sim \m...
I am solving Biot equation with sparse matrix in MATLAB. I have no problem with global sparse matrices assembly, but when I assign Dirichlet boundary condition, it is so slow. From this topic, How to efficiently implement Dirichlet boundary conditions in global sparse finite element stiffnes matrices, @James also menti...
Consider the equations $$\int_0^L \mathbf W(\mathbf u, s) \, \mathrm ds = \mathbf 0$$ where $0 \leq s \leq L$ and $\mathbf u$ is a vector of constants. Numerically, what is the best way to determine $\mathbf u$ that satisfy the equations?
I have two large-ish matrices (~100K cols x ~100K rows). They are sparse and symmetrical (about 0.1% of them values are non-zero). I want to do element-wise multiplication between them. Also, I plan to perform this operation about 1,000,000 times, so speed is is definitely going to be an issue. Does anyone know of a go...
I'm kind new in the Computed Tomography field and I'm trying to understand and implement ART technique. Said it, I started to read the book The Mathematics of Medical Imaging - A Beginners Guide by Timothy G. Feeman. In the chapter 9, author describes the ART method. Well, If I understood fine (correct me If I'm wrong,...
I have an objective function that I can write either in quadratic programming (QP) such as $$\sum_{i=1}^N \sum_{j=1}^N C_{ij}^2$$ or as an LP problem $$\sum_{i=1}^N \sum_{j=1}^N |C_{ij}|$$ which can be done by splitting $C_{ij}$ into two parts $C_{ij} = C_{ij}^+ + C_{ij}^-$ and imposing $C_{ij}^{+}>0$ and $C_{ij}^{-}>...
I want to simulate a molecular system at a certain temperature. It would be best if it could be implemented by NVT molecular dynamics. However, if one were to use a NVE simulation (like velocity Verlet), how could I fix the temperature, or let the temperature only fluctuate a little bit around the desired value?
I'm comparing some of the different ODE integrators in scipy.integrate.ode on solving the logistic function: $$x(t) = \frac{1}{1+e^{-rt}}$$ $$\dot{x} = rx(1-x)$$ I've heard that LSODA should be very good, so I was a bit surprised to find that it fails completely for $r>4$. The dopri5 integrator, on the other hand, seem...
I have two identical computers, both with 4 dual cores and MATLAB installed on them. They are connected to the same network. Is there anyway I can run a parforloop using the computation power of both machines without relying on MATLAB distributed computing server? I do not have a license for this, and seems to expensiv...
I am preparing to do a MD-simulation of a system which consists of two phases. The gaseous phase consists of $H_{2}$, $Ar$, $He$, $N_{2}$, $CH_{4}$ and $CO_{2}$. In this system, $p=0.355 ~bar$ and $T\approx 350 K$. In direct contact with this phase is an aqueous phase, consisting of the same components and water. I've ...
I need to build a new desktop PC, where ab-initio DFT calculation going to be performed. I am searching for a CPU in value range 600 - 1000€. I was thinking about six-core Intel Core i7-6850K or 8-core Intel Core i7-6900K. However Intel Core ix processors are desktop processors so they are optimized for multimedia appl...
I am looking for an open source solver to solve the a quadratic programming problem with an additional piecewise linear objective, as show below. The problem is fairly small ($\mathbf{x}$ is a vector of dimension 120). \begin{equation*} \max_{x}: \mathbf{x}^{T} \mathbf{q_0} - \mathbf{x^{T}} P_0 \mathbf{x} - f(\mathbf...
I wonder how one manages to use BLAS level 3 operations in the multifrontal sparse decomposition algorithm. As far as I understand, the algorithm proceeds as follows: For each row/column pair, assemble the dense matrix corresponding to its nonzero entries. Write this matrix as $$ M = \begin{pmatrix} \alpha & a...
After trying to use RK4 to solve the below system of equations, it appears the output had large and fast oscillations even with an adaptive time step I incorporated using the Cash-Karp method. I am now looking to existing solvers with more sophisticated tools (e.g. BDF methods) to solve PDEs, and came across odespy whi...
I am trying to reproduce this figure of nodal lines of a wavefunction from this work of Berry $$\psi = \sin 2r\,x \sin y + (1 + \epsilon) \sin x \sin 2r\,y$$ Here the image. The first is $\epsilon = 0$ and the second is $\epsilon > 0$: I produced a script to evaluate the value of sine at many points using numpy. Her...
I came across this form of damping implemented in an elastodynamics problem. The stress tensor without the damping would look like: $ \sigma = 2 \mu \epsilon + (\lambda \, \text{tr} (\epsilon)) I $ where, $\mu$ and $\lambda$ are Lame' parameters dependent on the Young's Modulus and the Poisson's ratio. Trace is repres...
I'm sorry for this silly question. Several times I faced with optimization problems which can be expressed as $$\begin{array}{ll} \text{minimize} & \mathrm x^T \mathrm A \mathrm x\\ \text{subject to} & \|\mathrm x\| = 1\end{array}$$ where $\mathrm A$ is square matrix and $\mathrm x$ is vector. (This kind of problem ar...
If I take the step too large I will get error, while if I take the step too small I also get an error. In my case, instead of seeing the function decreasing, i have it increasing if I take the step too small.
I am implementing higher order derivatives for FEM. Example, to solve a Poisson problem, biharmonic or triharmonic PDE one needs first, second or third order derivatives respectively. As usually done in FEM, there is a mapping from a reference element to a physical element e.g. $F : \hat{K} \rightarrow K$ with the ass...
In NVT molecular dynamics, Nosé Hoover thermostat is a method defining an extended system. I can understand perfectly how the Nosé Hoover differential equations are derived (Frenkel&Smit's book). However, when it comes to practice, I have no idea how to solve it numerically. I tried a method similar to velocity Verlet ...
I've been using HDF5 for years, but as the size of the dataset grows I'm starting to experience the same problems listed here http://cyrille.rossant.net/moving-away-hdf5/ Can you point me to a format like HDF5 with - Good support for parallel writes - Support for chunked access of huge matrices My typical use case is a...
I've the following Matlab code: r = symrcm(A(2:end, 2:end)); prcm = [1 r + 1]; spy(A(prcm, prcm)); where A should be sparse connectivity matrix. I understood what it does: Finds a permutation vector r of the submatrix of A A(2:end, 2:end) (produced by the reverse Cuthill-McKee algorithm) Creates a vector prcm which...
I am solving a quadratic program with regularization parameter $\alpha\geq0$ to get the solution to a problem of the form $$ p(\alpha):= \arg\min_{p\in\mathbb{R}^n}\ [\alpha(v^\top p)+f(p)], $$ where $f(\cdot)$ is a strictly convex, continuous, and piecewise quadratic function of $p\in\mathbb{R}^n$. I'm hoping to say s...
Assume we use FEM with piecewise linear finite elements to discretize the BVP over $\omega = (0,1)$: $-u''+ bu' + u = 2x$, $u(0) = u(1) = 0$ for parameter $b\in R$. Given a mesh $T = \left\{x_i\right\}_{i=0}^{N}$ where $x_i = 1 - (1-\frac{i}{N})^{\beta}$ for some $\beta > 1$. Using principle of error equilibration, fin...
The Schrodinger equation for time-dependent Hamiltonian is $$i\hbar\frac{d}{dt}\psi(t) = H(t)\psi(t) \, .$$ Assuming I knew $\psi(t)$, I want to know $\psi(t+\Delta t)$. Should I take exponential or use ode solver? I know that the mathematical solution after one timestep should be (or not?) $$\psi(t+\Delta t) = e^{-\f...
If this isn't the right SE site, please suggest the right one? Can software remove all distortion from a 180-degree lens? In other words, if the goal is to optimize for distortion-free images, would a stereo configuration with two 100-degree lenses and two sensors (overlapped to provide 180-deg coverage) be better tha...
In a system where energy theoretically should be conserved, the most accurate simulation would conserve energy (as well as giving accurate positions, velocities and etc). RK4 is more accurate than leapfrog, yet leapfrog conserves energy and RK4 doesn’t. Why is this?
The main motivation behind my next question is that I think I derived a higher order numerical scheme for linear advection equation that is unconditionally stable using Von Neumann stability analysis. In the stability analysis of the numerical scheme I have to find the maximal value of so called amplification factor $|...
Is there any method to deal with this problem? I am using Mathematica to solve the differential equations, but the calculating time is so long because of the large domain $x\in[0,10^{6})$. In fact I don't need the valves of y at x=0,0.01,0.02,0.03....I just need the values at x=0,1000,2000... or even less dilute. But t...
In an N-body simulation where forces between particles are attractive and particles do not lose energy on colliding with walls or each other, should energy be conserved? How could it be, with total kinetic energy increasing to unlimited values and total potential energy capped by the number of particles and their close...
Basically, FEM seems to be a problem that is pretty much "solved". There are numerous powerful frameworks existing, like Trilinos, PETSc, FEniCS, Libmesh or MOOSE. One thing they have in common: They are extremely "heavy-weight". First, the installation normally is super painful. Second, their interface/API is thick an...
I want to vary the input parameter of a physical dynamic mechanics problem, as a Gaussian Random variable and view the resulting Probability Density Function (PDF). I used the Finite Element Method to create deterministic codes in C++ and Python language. However, before I go there, I want to begin by applying this tec...
So I'm working with a rather complicated dynamical system. Instead of writing it all out. It's probably easier if you just clone my git repository. git clone https://gitlab.com/mdornfe1/vortex_acoustic The dynamics of the system is encoded in the function flow inside vortex_acoustic.py. If I integrate the system from ...