instruction stringlengths 43 28.1k |
|---|
I want to prove the LBB condition for the Stokes Equations discretised by the Crouzeix-Raviart element.
The continuous Stokes Equation in the weak formulation is
Find $u \in H_0^1(\Omega, \mathbb{R}^d)$ and $p \in L_0^2(\Omega)$ with
\begin{align} \int_\Omega \nabla u : \nabla v dx - \int_\Omega
p \text{ div} (v) dx ... |
From a given data set, I set out to complete a task which is below
Fit the data of the previous exercise to fit Eq. (8.18) using the SciPy function scipy.optimize.curve_fit(). Plot the data as symbols and the fit as a line on linear and on log-log axes in two separate plots in the same figure window. Compare your res... |
While solving a 2D heat equation in both steady-state and Transient state using iterative solvers like Jacobi, Gauss seidel, SOR. Should the answers, I mean the converged results of Temperature contour on the 2D surface be the same?
As transient state is solved using certain time steps to get to steady-state. So does ... |
I guess convergence in general means it is in asymptotic sense but what does non-asymptotic convergence mean?. Can someone please explain with an example?
|
I'm trying to implement the algorithm outlined in https://arxiv.org/abs/1211.5608 on a small scale. I have a linear operator $\mathcal{A}$ which is defined as $$\text{trace}(A^*_l(hm^*))$$ where $$A_l = \hat{b}_l\hat{c}_l^*$$, where $\hat{b}_l$ and $\hat{c}_l^*$ are columns and vectors of different matrices.
I've used ... |
I want to solve this integral using RK4 by coding in Fortran:
$$R=∫1/a(t) dt → dR/dt=1/a(t) =f(t)$$
Initial point: t=0 (or a=0.001) and R=0
And I have to get a(t) by solving another differential equation:
$$da/dt=1/a+1/a^2 =g(a)$$
Initial point: t=0 and a=0.001
I wrote this code to get a(t):
PROGRAM R... |
I am simulating Ising model for NiO. I have simulated for 2d,3d,triangular lattices, and have tried to do the same with NiO model.
There are papers which say that the ground state energy is around -36 mev per particle. Where as I am getting -21 mev per particle (should I not consider Oxygen atoms?, then it will be -42... |
I have been digging into some numerical linear algebra lately, and reading in particular about how LAPACK solves symmetric eigenvalue problems. I noticed that the *stegr routine for computing eigenvalues and eigenvectors of a symmetric tridiagonal matrix (to which the more general cases are reduced) is $\mathcal{O}(n^2... |
Based on this LAPACK routines list, it looks like there is no relatively robust representation (RRR) driver routine for either packed or banded symmetric eigenvalue problems. According to the relevant LAPACK documentation though, it appears that the RRR driver is the fastest algorithm in most cases and uses the least w... |
Say I have a set of numerous probabilities given by their logarithm : $\{\ln p_i, 1 \leq i \leq N\}$.
I want to compute $\sum p_i$, if possible without exponentiating $\ln p_i$, since some of those probabilities are really small and I would suffer a dramatic loss of precision by doing so.
Do you know of any clever tric... |
I am trying to build understanding on the Helmholtz wave equation $\Delta p + k^2 p = 0$, where $p$ is the deviation from ambient pressure and $k$ the wave number, in order to use it in numerical simulations. However, I'm not sure how to interpret the results. Take as an example the figure 5 on this work
More precisel... |
I'm terribly green, please forgive me. I need to plot the difference between a chosen calculated Taylor expansion
$e^x=1+x+\frac {x^2}{2!}+\frac {x^3}{3!}+\frac {x^4}{4!}+\frac {x^5}{5!}$...
and the true value of $e^x$ as a function of the number of terms included. I'm excited to work through this but am unsure how to ... |
My application calls for solving a dense, 40,000 x 40,000, ill-conditioned linear system. The native SciPy GMRES solver with preconditioning has worked well for my application and solving a single system is within the ability of my local hardware. I am now looking to perform many such calculations and would like to mov... |
I'm working in ETABS. There are few columns of dimension 300mmx1400mm. The height of building is 36.6 meter above ground level and the dimension of building is 26mx68m. I'm getting the time period of this model as 3.08 which is way too high. Hence i thought of changing the above mentioned columns to shell elements whic... |
Is there any way to make a bode plot without using the MATLAB/GNU Octave function bode()?
As an example, here is a function I am working on:
$$H(s) = \frac{1}{2s^2+3s+4}$$
|
I'm using scipy's solve_ivp for solving a stiff differential equation. I'm using method BDF for solving the same.
I have already used MATLAB's ode23s and I'm getting correct results in MATLAB.
However, solve_ivp returns the wrong results. The problem might be in computing X.
My code is :
X0=np.array([0,0,0,0,0,0])
swd=... |
TLDR: I used Python to write a 2D Finite Element program using 'Constant Strain Triangles' and my beam keeps pointing slightly upwards instead of straight sideways (like the force). I'm new to FEA and have very little linear algebra experience so I don't have the insight to know if I did something fundamentally wrong.
... |
CONTEXT
I need to combine the probability of occurrence of many thousands of events for millions of individuals (trees) in an agent-based/individual-based simulation model developed in NetLogo (agent-based simulation) and Go (to parallelize probability calculations). For those interested, the probabilities are for infe... |
I'm trying to find a way to sample new points that have maximum minimum-distance (maximin distance).
The current situation is where there are ns number of pre-existing sample points. I want N number of new sample points that are filling the space as much as possible (hence, the maximization of minimum distance).
The m... |
I'm trying to perform the inverse Laplace transform of a (noisy) dataset $y_i$ using Tikhonov regularization:
$$\min \sum_{i=1}^{N} \left(\int_0^\infty e^{-s_i t} f(t) \, dt - y_i \right)^2 - \lambda^2 \int_0^\infty f(t)^2 dt$$
where I know that $f(t) \geq 0$ for $t\geq 0$. I therefore convert that to a Non-negative le... |
I would like to solve the linearised, ideal, MHD equations, where the gas pressure is zero.
$$\frac{\partial u_x}{\partial t}=v_A^2(x,z)\left[\nabla_{||}b_x - \frac{\partial b_{||}}{\partial x}\right],$$
$$\frac{\partial u_\perp}{\partial t}=v_A^2(x,z)\left[\nabla_{||}b_\perp - \nabla_\perp b_{||} \right],$$
$$\frac{\p... |
I have heard the term 'computational microscope' used to describe the practice of molecular simulation (in the context e.g. computational chemistry, materials science) and its use as a numerical tool for predicting scientific properties of materials, etc. I have also heard 'numerical microscope' in the same context.
Is... |
(I have asked this question on StackOverflow previously but it has been pointed to me that CSSE or MSE could be more appropriate)
I have to solve a constrained optimization problem of the following form, where the only unknown is $x$:
$$ x^{*} = \arg \min_{x} \left \| Ax - b \right \|^{2} \qquad x \in \mathbb{R}_{\ge... |
For Navier-Stokes problems we can often choose a relatively simple verification problem such as the lid driven cavity, flow over a cylinder, or flow over a backward facing step to verify our implementation.
What are the typical reference problems for the time harmonic Maxwell equations?
Edit: With a focus on finite ele... |
I have a sparse lower-triangular matrix $L$, and a right-hand side $b$, and I'd like to solve the linear system
$$L^T x = b$$
but without explicitly creating $L^T$. Ideally, I could write something like:
L.selfadjointView<Lower>().triangularView<Upper>().solve(b).
It seems that this would be valid if $L$ were dense, b... |
I've learnt the hard way that you should avoid:
computing small numbers as the difference of two large numbers
evaluating chaotic functions with imprecise inputs.
Are there any other red flags a novice should look out for?
Edit
The comments made me realize I have stumbled onto a studied field. I'd like to know:
What... |
Consider the 1D nonstationary convection-diffusion PDE
$$
\begin{alignat}{2}
\partial_t u &= -a \partial_x u + D \partial_{xx}u, &\qquad x \in (0,1), t \in (0,T), \\
f(t) &= \left.\left( a u - D\partial_x u \right) \right|_{x=0} & \qquad t \in (0,T), \\
0 &= \left. -D\partial_x u \right|_{x=1} & \qquad t \in (0,T), \\
... |
I'm sure this question has been asked before yet after many hours of searching I am unable to find a definitive answer.
The problem at hand is solving the linear system: $$A \mathbf{x} = \mathbf{0}$$ with the constraint: $$ x_i \geq 0 $$
At present I apply SVD to obtain a set of vectors which span the nullspace of the... |
I need to develop a code to solve Stokes Equations in 3D in cubic geometries (structured grid, uniform mesh spacing).
My code needs to take a pressure gradient in one direction as a BC (pinlet=p1, poutlet=p0) and no-slip BC's in the other 4 faces of the cubic geometry.
I started to develop this code in Python, using a ... |
I'm trying to analyze the change in system thermodynamic entropy of an ideal gas system.
For reference, I'm analyzing solution techniques for solving the 1D compressible Euler equations:
$$
\partial_t \rho + \partial_x (\rho u_x) = 0\\
\partial_t (\rho u_x) + \partial_x (\rho u_x^2 + P) = 0\\
\partial_t e + \partial_x ... |
I am looking for tasks that
are unsuitable for GPUs
gain significant speedup as more CPU nodes are added
don't require large data transfer or inter-thread communication between nodes.
Do any problems of this type still exist?
|
All of my yearlong graduate-level Linear Algebra course notes from my professor—an algebraist/representation theorist—shows his love for the exponential map $e^A$ and the Jordan canonical form—and one main reason given by him is that they help solve linear differential equations.
But how true is this in practice?
I hav... |
I'm doing some numerical calculations involving Hermitian matrices, and derivatives of the eigenvectors.
Essentially, I have an n x n, Hermitian matrix H(x), which is dependent on some continuous parameter (x). I then need to calculate the Berry connection for this system. So suppose $U^\dagger(x) H(x) U(x) = \epsilon_... |
I am modeling a Helmholtz Coil as two dipoles from far away and I want to plot the magnetic field.
$$\mathbf{B}(\mathbf{r}) = \frac{\mu_0 |\mathbf{m}|}{4\pi r^3}\left(2\cos\theta\,\hat{\mathbf{r}} + \sin\theta\,\hat{\boldsymbol{\theta}}\right)\, .$$
I am struggling to plot the magnetic field in spherical coordinates in... |
For this problem
\begin{cases}
&\frac{d^2 u}{dx^2}=Log(1+x+y),in \quad\Omega=(0,1)^2\\
&u=0,\qquad on \quad\Gamma_{1}: x=0\\
&u=0,\qquad on \quad\Gamma_{3}: x=1\\
&\frac{du}{d\eta}=0,\qquad on \quad\Gamma_{2}: y=0\\
&\frac{du}{d\eta}=0,\qquad on \quad\Gamma_{4}: y=1\\
\end{cases}
Where $\eta$ is the unit normal vector... |
I am computing the nullspace of a sparse rectangular $m$ x $n$ matrix $A$, where $m$ << $n$. I do this by computing the QR decomposition of $A^T$ and extract the $n-m$ right-most columns of the resulting $Q$. Symbolically:
$$A^T=QR, Q=[Q_1 Q_2] , Q_2 = Nullspace(A)$$
Using this technique, I get the results I want but I... |
I am trying to solve the following linear PDEs
$$\frac{\partial u_x}{\partial x}=-[i\omega b_{||}+\nabla_\perp u_\perp],$$
$$\frac{\partial b_{||}}{\partial x}=-\frac{i}{\omega}\mathcal{L}u_x,$$
$$\mathcal{L}u_\perp = i\omega\nabla_\perp b_{||},$$
for $u_x=\texttt{ux}$, $b_{||}=\texttt{b_par}$ and $u_\perp=\texttt{u_pe... |
I have this
I want it to be single bended wire.
How to accomplish?
|
I know a little about fenics and freefem.
There exists a big difference between those and OpenFoam?
They are used in a similar way (editing a file and writing code)? or perhaps it is made for other types of problems? Is it appropriate for solid-structure coupled problems?
Finally, is it better than the previous ones in... |
I have tried to do a trapeze integration with f(x)=x^2, where I know how the antiderivative looks like, so F(x) = (1/3)x^3
Here's my code, just like I tried:
x = np.arange(-10,10, 0.01) # start,stop,step
f = x**2
l=it.cumtrapz(f,x, initial=0)
plt.plot(l)
Then I get this plot (1):
But the plot should look like thi... |
Background I wanted to learn how to couple FEM and BEM (for the Poisson equation), because I wanted to better understand how open boundary conditions look like. Therefore I worked through the relevant sections of “Principles of Boundary Element Methods” by Martin Costabe, summer course lecture, 1986 (28 pages). The las... |
I am trying to understand the FDM which is a widely used method solving differential equations by using approximation below.
$$\dfrac{\partial u}{\partial x}=\dfrac{u(i+1)-u(i-1)}{2\Delta x}$$
How can I apply the approximation the equation given below?
$$\dfrac{d}{dx}(z(x)\dfrac{d}{dx}u(x))=0$$ where $u(0)=a$ and $u(1)... |
Let $n = 10^6.$ Let $A \in \mathbb{R}^{n\times n} $ be the lower triangular matrix having 1's on and below the main diagonal.
We want to solve the following linear system:
$$ (A + uv^T)x = b$$
by the Sherman-Morrison formula:
$$(A+uv^T)^{-1} = A^{-1}-\frac{A^{-1}uv^TA^{-1}}{1+v^TA^{-1}u}.$$
We are asked to compute:
$A... |
The Gauss-Kuzmin distribution gives the probability of an integer appearing as a partial denominator in the continued fraction of a real number $x$ as
$$
P(a_k = k) = -\log_2\left(1 - \frac{1}{(k+1)^2} \right)
$$
The entropy (in bits) of this distribution is
\begin{align*}
H = \sum_{k=1}^{\infty} \log_2\left(1 - \frac... |
A current problem that I am working on requires me to compute the solution from the heat diffusion evolution on a discontinuous function. More precisely - I have a Delaunay triangulation and within each triangle a polynomial function is defined such that it can be discontinuous at the edges. For a constant function wit... |
I was wondering how specific symmetries or constraints such as property-invariance transformation are imposed on any (deep) neural net when they are trained.
I'll appreciate it if anyone can aware me of the relevant researches in this direction.
|
I’m trying to write the weak form of the Navier-Cauchy equation in the component form, where $u_1$ and $u_2$ are the displacement components:
$$-(2 \mu +\lambda) \frac{\partial ^2 u_1}{\partial x_1 ^2} - \mu \frac{\partial ^2 u_1}{\partial x_2 ^2} - (\mu + \lambda) \frac{\partial ^2 u_2}{\partial x_1 \partial x_2} - \r... |
What is the result of the method for multiple eigenvalues? Is there any case for which this method will not work altogether?
|
I'm working with a Matlab codebase wherein I'm attempting to solve A*c = b by approximating the (square) matrix A with its q largest principal components (basically using the rank-q PCA approximation of A). I'm currently doing that by writing c = pinv(A, tol)*b, where tol is the qth largest singular value of A. This ... |
I have a system of 4 nonlinear 1st-order PDEs. I want to solve them numerically by method of lines, first discretizing space. This leads to the system of $N\times 4$ coupled ODEs.
$$
\mathbf{u}_{i} = (u^{1},u^{2},u^{3},u^{4})_{i},\quad i=1,\dots,N\\
\frac{\mathrm{d}u_{i}^{1}}{\mathrm{d}t} = q_{1}(\mathbf{u}_{i}) \\
\... |
I have a large system of boundary value problems of the form
$$ \frac{d^2 y }{dt^2} = C(t) y + b(t), $$
where the variable $y$ is a vector that has anywhere from 50 to around 500 components, $C$ is a dense matrix whose entries come from data from a simulation, so there is no closed form for the entries, and $b$ also co... |
Are there $P0$ (zero degree/constant element) nonconforming methods for approximating solutions in $H1$? More specifically, I have the equation:
$$u-f - T\Delta u = 0$$
Which can be interpreted as heat diffusion for time $T$ with an implicit step in time. I know that this can easily be handled with CG (continuous Galer... |
Is there an iterative solver that can handle potentially zero entries on the central diagonal? I am implementing a polynomial fitting algorithm (up to $10^{th}$-order) and my matrix is a "Vandermonde-like" system that results in zeros for the odd-powered polynomial basis functions when my sample space is symmetric with... |
I have to integrate expression f(x) * g(x) for many different functions f but just one g.
I want to integrate it as sum of weighted values of f(x) * g(x) instead of calculating the table. Note that in Python I may write:
sum(w[i] * f(x[i]) * g(x[i]) for i in range(2 ** k + 1))
as:
wg = [w[i] * g(x[i]) for i in range(... |
I'm looking for a method to solve a 20000 variable, 20000 residual non-linear PDE with a Galerkin method.
I have Fortran subroutines for:
The residuals: $\vec{r}(\vec{x})$;
Their Jacobian multiplied by a direct algorithmic derivative seed: $\dot{r}(\dot{x})=\frac{\partial \vec{r}(\vec{x})}{\partial \vec{x}}\cdot\dot{... |
I wish to compute
$$
\frac{1}{1 + \frac{1^3}{1 + \frac{2^3}{1 + \frac{3^3}{1+\cdots} } } }
$$
to high accuracy. To start, I tried computing
$$
\frac{1}{1 + \frac{1^2}{1 + \frac{2^2}{1 + \frac{3^2}{1+\cdots} } } }
$$
whose limit ($\ln(2)$) was known to Euler. Using the modified Lentz's method, I found that increasing th... |
I have to solve the following PDE for a Call option :
$\partial_tV + \{ \alpha - (\mu - \lambda/ \alpha -log(S))\}S\partial_SV + 1/2 \sigma^{2}S^{2}\partial_{S}^{2}V - rV = 0$
Where V(S,t) is the price of the option as a function of stock price S and time t, $\alpha$ the strength of mean reversion, $\mu$ mean rate of r... |
I'm studying up on methods for numerically solving the Schrodinger equation. The Schrodinger equation with a zero potential is formally identical to the heat equation in the sense that we just make one of the coefficients in the equation imaginary.
A practitioner of finite-difference methods for the heat equation has t... |
I have a set of linear equations, $Ax=b$. And about half of the elements in the right-hand side (vector $b$) are equal to zero. My system matrix $A$ is a sparse complex matrix. And $A$ is in the size range of $2000 \times 2000$.
I am currently using LU decomposition to solve the system.
Is there a way that I can take b... |
I have a coupled set of PDEs that need to be solved as part of a larger problem. I am currently approaching this by computing spatial derivatives with finite differences and using PETSc's nonlinear conjugate gradient solver. This does converge in terms of an absolute tolerance, however, when I started thinking about th... |
I'm solving an elastic homogenization problem and I'm having problems with mesh artifacts.
I would like to first give a brief summary of what I do: I have a system with inhomogeneous (but isotropic) elastic properties, and I want to compute the system-scale (i.e., effective) shear modulus. Specifically, I compute the s... |
I am trying to obtain the weak form of the Navier-Cauchy equation, which is
$$- \rho \omega ^2 \textbf{U} - \mu \nabla ^2 \textbf{U} - (\mu + \lambda) \nabla (\nabla \cdot \textbf{U}) = \textbf{F}$$
and can be written in the component form
$$-(2 \mu +\lambda) \frac{\partial ^2 U_1}{\partial x_1 ^2} - \mu \frac{\partial... |
I have a saddle-point system of the form
\begin{equation}
\begin{bmatrix}
A & B \\
B^T & O
\end{bmatrix}\begin{bmatrix}
x\\
y
\end{bmatrix} = \begin{bmatrix}
f \\ \vec{0}
\end{bmatrix},
\end{equation}
where $A$, $B$ are matrices, and $O$ is a matrix of zeros, and $x$ is a solution vector of length $n$. Clearly, $y$ is ... |
I'm trying to figure out how to create a surface mesh from a set of labeled 3D points. The 3D object could be something like part of a cave system or asteroid where there would be parts of the surface not visible from looking on the outside. Each point has a radius and not all points are on the surface. The output shou... |
Given an $m \times n$ matrix $A$ and a vector $x\in\mathbb R^n$, with $m<n$, what's an efficient way of computing the projection of $x$ onto the kernel of $A$?
|
https://stackoverflow.com
Krylov solvers for iterative computation of the smallest singular value and the corrensponding singular vectors of a matrix
Edit:
This is a follow-up question to How to implement flexible gmres in matlab?.
I am a student and I am working for the topic of "Krylov solvers for iterative computa... |
I am working on a problem with very large sparse matrices. I'd like to compute $A^{-1} B$, that is a crucial part of converting DAE to ODE (and there is no workaround). Here size of $A$ is 2E+5 x 2E+5 with 0.7% density (especially all diagonal entries are non-zeros). And $B$ is 2E+5 x 1E+6 whose density is only 1E-6.
I... |
For stable time steps for the RKDG method for transport equations we require that
$$
\Delta t \le \frac{\Delta x CFL}{(2k + 1)|\lambda|},
$$
where $\lambda$ is the eigenvalue of our conservation law and $k = 0, 1, \dots$. For diffusion I believe we require that
$$
\Delta t \le \frac{\Delta x^{2}}{\nu},
$$
where $\nu$ ... |
In Fourier Optics one often needs to compute approximations to bivariate integrals like
$$
\int_{-\frac{l}{2}}^{\frac{l}{2}}\int_{-\frac{l}{2}}^{\frac{l}{2}} {\rm e}^{i\phi(\xi,\eta)}\mathrm{exp}\left[i\frac{\pi}{\lambda d}\left((x-\xi)^2-(y-\eta)^2\right)\right]{\rm d}\xi{\rm d}\eta
$$
These integrals generally reduce... |
Consider the following function :
$$f(x) = \sin^2(\frac{π\Gamma(x)}{2x})$$
Now consider the following functional :
$$I(x)=\int_0^\infty \frac{f(x + iy) − f(x − iy)}{e^{2πy}-1} dy$$
I need values for of $I(x)$ for large $x$ at least upto 10^2.
I tried it on Mathematica but I couldn't .
Here are some calculated value... |
I have installed openFoam on Debian GNU/Linux and learning from official user guide. I have a problem with generating streamlines. I am trying to generate streamlines as explained in the post processing section (look at 2.1.4.5 Streamline plots).
The configuration setup explained is as follows:
And the expected outp... |
I am writing the code relate to math.
There is some complicated math formulation in the project.
Directly writing the calculation code leads to hard understanding; thus I want to comment on the formulation.
I want the comment can be readable, and easy for understand.
I know we can save the formulation in another docume... |
My background: I have taken some courses on numerical analysis during my PhD and read a few books on the topic as well. I mostly work on low Reynolds number fluid mechanics and use boundary element method for solving Stokes equations on unstructured meshes. I mostly read the mathematical equations and write my own code... |
The directed 3-Cycle cover asks for a vertex-covering set of oriented cycles with at least three vertices per cycle such that every vertex is covered by exactly one cycle.
I have scrutinzed the internet for some time for freely availabe benchmark problems but couldn't find anything useful.
So my question is where I can... |
I have a 1D convection-diffusion equation $\sigma_t = a(x,t) \sigma_{xx}+b(x,t)\sigma_x+f(x,t)$ defined on the unit interval, with nonzero Neumann boundary conditions at both ends. It should be noted that the coefficients are not strictly positive, which explains the negative Peclet number below.
From what I understand... |
https://www.jstor.org/stable/pdf/2157482.pdf, here I have a problem in last equation of (2.6) in section (2.1). When they are considering error equation on the interface $\Gamma$ they get $e_v^{(n)} = \delta_n$, where $\delta_n = \lambda_n - \lambda_{n-1}$(Here I use there definition of $\delta_2 = \lambda_2-\lambda_1$... |
Simple paraphrase of my question is what is the best way to use a table or curve as an input for an optimization problem in Gekko (and/or AP Monitor)?
For example, I have simplified atmospheric density data by altitude. I can fit the data to a a cubic spline in hermite form (slopes at control points are given explicitl... |
I am trapped here for a long time. I wrote a toy Matlab FEM code. I want to run the follow simulation.
Mesh
Suppose we have a cube, and we divide it into subcube along $x,y,z$ axis, then each subcube be divide into 5 tetrahedral elements. The cube along $x,y,z$ axis is divide into $n_x,n_y,n_z$ node, respectively. So t... |
I am trying to solve an equation of the following type
$$\partial_zE(z)=-c_0J$$
with $$J=c_1\beta E^3(z)$$
using the boost::odeint-framework and a fixed time stepper, with $c_0$, $c_1$ and $\beta$ constant values.
The right hand side of the function is calculated by the following procedure (depending on the step size $... |
I'm writing a solver for Boltzmann Equations (BE) including a force term in rarefied plasma, for my PhD. The aim is to see if an instability occurs inside an electric streamer (theoretically it should, basing on the analysis of the dispersion relation).
I used finite differences method with MPI parallelization, but the... |
I have a question about the Markov Chain Hamiltonian Monte Carlo (MCHMC).
Hamiltonian Monte Carlo is known as Hybrid Monte Carlo too. I'll describe the steps of the algorithm.
We have at the beginning a coordinates configuration {$q_i$} and generate momenta configuration {$p_i$} from a gaussian distribution at the des... |
I am in a context of forecasts in astrophysics. Don't be too rude if questions seem to you stupid or naive but rather indulgent, I am just looking for better undertsand all these numerical methods of Monte-Carlo alone/ Monte-carto coupling with Markov-Chain and the difference between a sampler and an estimator. This is... |
Consider a potentially high-dimensional (say, $N$ up to 20) integral of the form
$$
\int_0^\infty \rho_1(x_1)\rho_2(x_2) \cdots \rho_N(x_N) \bigg(x_1+x_2+\cdots+x_N -K\bigg)^+ \, dx_1 \cdots dx_N.
$$
where $(z)^+ = \max(0,z)$ is the positive part of the argument $z\in \mathbb R$, $K \in \mathbb R_{>0}$ and all $\rho_m... |
I am simultaneously trying to learn computational physics methods, chaos, and C++. I think this is the right site for the question, and I apologise if not.
I started working through Thijssen's Computational Physics textbook, and the first question (exercise 1.1b) is to solve the Duffing equation,
$$
m\ddot x = -\gamma\... |
I am learning about multigrid methods from the textbook section 6.3 Multigrid Methods, which shows a geometric multigrid algorithm for 1-D examples in detail, including how to build restriction/interpolation matrices (i.e., eqs.1, 3) and how to get a coarse coefficient matrix (eq. 6).
I realize that these matrices and ... |
I am trying to solve the Poisson equation numerically using the FDM method in C++. But I have a little confusion with the iterative process. I understand that the number of iterations should go until the solution converges, but how to calculate if the error is greater/less than the tolerance level? Here is a small piec... |
I have a function
$$
f(z) = \frac{1}{(z-z_1)(z-z_2)(z-z_3)(z-z_4)}
$$
All of $\{z_1,z_2,z_3,z_4\}$ are simple poles. The residues
for this function are given as
$$
\text{Res}(f(z),z_i)= \lim\limits_{z\to zi} \frac{(z-z_i)}{(z-z_1)(z-z_2)(z-z_3)(z-z_4)}
$$
For example to find $\text{Res}(f(z),z_1)$ one first cancels the... |
The Q2-P1 element is one of the popular finite elements for incompressible flow problems in the mathematics community. For this element, the velocity field is approximated using bi-quadratic shape functions and the pressure field using linear shape functions. What makes this element pretty odd is the fact that the appr... |
Let $A$ be the well known tridiagonal matrix coming from the 1D Finite difference discretization of the Laplacian, with stencil $\frac{[1 \quad-2 \quad 1]}{h^2}$.
The system $Ax = b$ is very large, so an iterative method must be used. Also, it is symmetric and positive definite, so I could employ PCG to solve it. The b... |
Can you provide a jargon-free (as much as possible) explanation of what is meant by "dense ODE systems", and "sparse ODE systems"?
Some hints I have gotten from Googling:
dense ODE systems' computation cost increases quadratically with the size of the system
sparse ODE systems' computation cost does not correlate wit... |
I want to compress an array of time series floating point data as much as possible.
Currently the only algorithm I've found for this is XOR compression which works well, but doesn't compress the data enough. What is the highest compression ratio algorithm for relatively smooth time series floating point (double precisi... |
I have a point $y \in \mathbb{R}^d$ and a convex polytope $\mathcal{P}$ given as the intersection of half-spaces:
$$\mathcal{P} = \{x \in \mathbb{R}^d \mid a_1 \cdot x \le b_1, \dots, a_n \cdot x \le b_n\}.$$
I would like to project $y$ onto the polytope, i.e., to find the nearest point $z \in \mathcal{P}$: in other wo... |
I apologize in advance if this post is at all ignorant or elementary, I am a pure mathematician who is newly getting into the world of scientific computing.
For my research, my advisor would like me to analyze a few 3d numerical simulations in C++ all of which are in a VTK format. To be more specific, we are modeling f... |
I implemented a solver for the 2D steady-state heat equation (without heat generation and homogeneous material) $\nabla. (k\nabla T) = 0$, using finite volume method, however, I am having some confusion about flux direction and face normal.
First, using divergence theorem (applied to a mesh element): $$\int_V \nabla. (... |
What are the pros of Fourier-Galerkin spectral methods while solving PDEs?
Here's the one that came in my mind first:
Easy implementation: using this method, differentiation operator computation is really simple since
$$\partial^p\hat{u}_k=(\imath k)^p\hat{u}_k$$
Exponential convergence: let $u \in C^m$ the exact solu... |
I have a short question about Time evolving block decimation (TEBD). During a lecture I was told that this method is very efficient in evolving 1D quantum spin systems with only nearest neighbor interactions. Unfortunately no one bother explaining why this algorithm is so efficient in this case and what exactly its lim... |
I have a physical model which takes $\sim50$ parameters and gives $\sim2000$ outputs taking tens of minutes to run. I need to optimize these parameters to give outputs as close as possible to data. The problem of course is that it is expensive to evaluate and, probably worse, that there are so many parameters.
The best... |
I have found a toy implementation of RK-Dopri(4,5), written in Python.
I am concerned however, about line 118:
y = y + h * (b1*K1+b3*K3+b4*K4+b5*K5+b6*K6)
Has the term b2*K2 been omitted on purpose? I have a feeling that it is not, given (1.8) in Hairer, Wanner and Norsett:
Can you confirm?
|
I have a question about implementing traction boundary conditions in 2D and 3D linear elasticity. Consider the picture above. I want to apply traction boundary conditions on the boundary in red. My question is: How is the node order/connectivity for the traction elements defined? In 2D the boundary term $({\bf{w}},{\b... |
I was wondering if anyone could enlighten me about the convergence properties of the truncated newton method in case of a non-positive definite hessian $\nabla^2 f = H$. From the Book 'Numerical Optimization' from Nocedal & Wright, the Algorithm consists of two loops, one inner to compute the (Newton-)search direction ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.