instruction
stringlengths
43
28.1k
I am trying to simulate solute transport of acid (HCl) and consequent mineral dissolution around a grain (calcite). The governing equation for transport is the advection-diffusion equation, given as: where C is the concentration, v is the flow velocity, D is the diffusion coefficient. At a constant flow velocity, the ...
Let $A\in \mathbb{R}^{n\times n}$ and $v \in \mathbb{R}^n$. We recognize $Av=\lambda v$ for some scalar $\lambda$ as an eigendecomposition problem. Suppose $\mu \in \mathbb{R}^n$, and let $\odot$ denotes the Hadamard product. Does this system $Av = \lambda v+ \mu \odot v$ correspond to any generalization of eigendecomp...
Suppose we have a linear algebra problem with a banded matrix A which has nonzero entries on the main diagonal, two nearest sub-diagonals, and two other sub-diagonals (such band structure often arises in the context of numerical solution of PDEs in 2D), $ A x = b $ and we write A as a sum of a 3-diagonal matrix $T_1$ (...
I have a problem which I believe is numerical instability when trying to solve a heat conduction equation using finite difference. The short version is that when the parameter $I=80.3$ I get the blue curve below (positive values and with one local maximum, which is physically reasonable), but when $I=80.4$ I get the or...
It was suggested on math.stackexchange.com that I try to ask this question here. Consider a bounded linear operator $A : U \to V$ where $U$ is finite dimensional and where $V$ is a separable Hilbert space, or with large dimension such that $A$ cannot be stored explicitly, being instead available as an algorithm for co...
I am trying to find the peaks. I have list x_period and y_power. I find the peaks from the y_power using peaks,_ = find_peaks(y_power,height=0). But, when I tried to plot plt.plot(x_period,y_power) plt.plot(peaks,ypower[peaks],'x') The peaks are not exactly on the peaks of the plot. The image is : How can I show the ...
I am using Immersed Boundary Method to simulate elastic particles in 3D Stokes flow. Specifically, one has $\nabla ^2 \mathbf{u}-\nabla p + \mathbf{f}(t) = 0$, $\nabla \cdot \mathbf{u} \; $, where $\mathbf{f} (t)$ is calculated based on instantaneous configuration of some particle assembly that is advected by flow $\ma...
I would like to ask a question on the implementation of finite volume method on a non-uniform grid in solving Navier-Stokeq equations. I will just post the screenshot of a PhD thesis, where I found the evaluation of the derivative term difficult to understand. The screenshot is below You can also see the non-uniform g...
I have a system of PDEs constituting an initial value problem (IVP) consisting of three coupled PDEs: \begin{align} \partial_t \rho + \partial_x(\rho v) &= \left(k_A (1-\phi) + k_B \phi \right)\rho\ \\ \partial_t \phi + v \partial_x{\phi} &= D \partial^2_x \phi + D \frac{\partial_x \rho \partial_x \phi}{\rho} ...
update: I've refactored the question based on helpful advice in the linked meta. I'm a heavy user of Python's NumPy and SciPy (and not much else) and for years I could run anything I need on my laptop. Now I will start to write simulations with 100's to 10,000's of elements that go way beyond what a single CPU can do i...
My current work requires using (Adaptive Mesh Refinement) AMR to resolve multi scale physics. I have a general question whether finite element is better than finite difference in this aspect or not. I know that finite element can solve equations on unstructured grid. Since AMR is nonuniform and can be structured or uns...
I would like to write a simple finite element solver in python in order to solve 2D Poisson equation and then visualize it. $$ -\nabla^{2} u(x,y)=f(x,y), \quad x,y \quad in \quad \Omega\\ u(x,y) = u_D (x,y), \quad x,y \quad in \quad \partial \Omega $$ Why do I wanna do that? I would like to learn how write a simple fi...
I have a set of points $P$ and want to find the ellipse with the smallest area that covers at least a fraction $f$ of these points. How can I do this? These questions ask the same thing, but folks have only provided approximate answers. This question asks for the smallest ellipse that bounds all the points ($f=1$). I d...
I simulated Oja's rule and BCM for a single postsynaptic neuron with two presynaptic neurons, and for 10000 inputs, where I randomly select one of $(0,1)$ or $(1/2,\sqrt{3}/2)$ as input. My learning rate was $1/100$ and I am using the sliding threshold for BCM. (I am following this tutorial: http://www.inf.ed.ac.uk/te...
I am trying to numerically evaluate the following Duhamel's integration: $$ x = \frac{-1}{\omega_d} \int_0^t \ddot{x}_g (\tau) e^{-\zeta \omega_n(t - \tau)} \sin{\left( \omega_d (t - \tau) \right)} d\tau $$ where $\omega_d$, $\zeta$ and $\omega_n$ are constants. From our data, $\ddot{x}_g(t_i)$ are given at each discre...
I have been trying to solve this equation and write the finite difference scheme in matlab for months, but I still am not successful. Given the KdV Equation $$\tag{1}u_{t} -6uu_x+u_{xxx}=0$$ I have come up with a semi-discrete centered difference finite difference scheme which has been checked and confirmed by my profe...
I'm having trouble with the following implementation of the KS model (see below) found on Solving numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods When tN > 300 an overflow occurs on the line: u_hat2[:,j+1] = (1 / nx) * np.fft.fftshift(np.fft.fft(u[:,j+1]**2)) I tried using a workaround with the ...
I am solving a nonlinear least squares problem using Gauss Newton method. Due to the large dimension of the problem, I use the Hessian-free approach. As a linear solver I use either MINRES or CG. To speed up convergence, I began to figure out which preconditioners can be easily added. First, I decided to try the Fishe...
I have some matrix-valued, complex data $Z(f)$ with $f\in\{f_0,f_1,\dots\}$ and $Z(f_i)$ being a 3x3 matrix. I require the inverse $Z^{-1}(f)$ in my workflow. After encountering some problems with my results, I cold narrow the issue down to the inversion, which seems to be performed not very accurately by numpy.linalg....
Given a set of 2D points, I am trying to find the smallest convex hull that encloses an arbitrary point (which, in the general case, is not part of the set). By 'smallest convex hull' I am ideally thinking about its area, but I believe using the perimeter might also be good enough for my purposes. The problem specifica...
As a model of a more complex problem, I am studying a linear advection equation with a rapidly oscillating velocity $$ \partial_t u + a \cos(\omega t) \partial_x u = 0 $$ with initial condition $u(x,0) = \phi(x)$. The exact solution is $$ u(x,t) = \phi(x-a\omega^{-1}\sin(\omega t)). $$ I am trying to develop a finite d...
This is a re-posted question which was poorly defined earlier I have been trying to simulate reciprocating flow of a convective fluid through a heated channel in COMSOL-Multiphysics. The schematic of the domain is as follows: There is reciprocating flow of a convective fluid through the channel through the highlighted...
I have asked this in Mathematic section, but received no reply. Please let me ask here to see if threr is any difference. The Schrodinger equation without potential has the following form: $$\partial_t\psi =i\nabla^2\psi.$$ The finite element software that I'm using does not handle complex function directly, so I solve...
I think this is a question about the energy conservation of a numerical integrator. I'm studying the linearized 1D shallow water equations in python - for reference, here they are: $$ \frac{\partial u}{\partial t} +U\frac{\partial u}{\partial x}+g\frac{\partial h}{\partial x} = 0\\ \frac{\partial h}{\partial t} +U\frac...
For the 2-D Poisson equation $$-(u_{xx}+u_{yy}) = f \ \ \text{where} f = 1$$ For boundary conditions $$\frac{\partial u}{\partial n} = 0 \ \text{on AB and AD}$$ $$ u = 0 \ \ \ \text{on BC and CD no-slip condition}$$ I know how to solve this using both a Gauss Siedel and Jacobian method for normal problems however, what...
We were given an assignment where we had to determine the numerical solution of Dahlquist's equation $\dot x$ = $\lambda x$, ($\lambda$ = $-7$) for time steps ${0.5,0.25,0.125}$ using explicit euler method. When I coded it and plotted the solution on MATLAB, I saw that the solution unphysically oscillates for time step...
From what I read, the "default" go-to method for non-stiff ODEs is the Dormand-Prince Runge-Kutta pair; for instance, in Matlab docs, "Most of the time, ode45 should be the first solver you try". However, from what I understand multistep methods should be able to achieve comparable accuracies (same order of convergence...
Rosenthal's equation lets one calculate the temperature profile of a moving point heat source analytically for thin and thick plates. For simplicity I use the equation for thick plates defined as: $$T-T_0 = \frac{Q}{2\pi kR}\exp\bigg(-\frac{v(R+x)}{2a}\bigg)$$ Where $T$ is the temperature one wants to know, $T_0$ is th...
@Richard's answer to Going to try to move some of my scipy/numpy calculation to a new GPU, how to avoid disappointing results? is quite helpful, and as promised I've added a simple running example below of the kind of project I've started. While there may be "high level libraries" out there that can do this, I always c...
The mixed hybrid finite element method (MHFEM) is based on the mixed finite element method (MFEM). So, I'd recall the implementation of MFEM. The mixed formulation of Poisson equation reads $$\begin{equation}\begin{split}\mathbf{u}=\nabla h \text{ in } \Omega, \\ \nabla\cdot\mathbf{u}=0 \text{ in } \Omega, \\ \mathbf{u...
I'm trying to solve a Differential Algebraic Equation (DAE) in Julia which is very computationally expensive using GPUs. I'm brand new to Julia and don't have much experience coding with GPUs. The below problem is just a sample DAE problem I'm trying to solve. The error I'm getting, which occur on the last line of code...
When we do Hartree-Fock computations by solving the Roothaan equations $FC = SC \varepsilon$ is it a Galerkin method?
I need to solve a boundary value problem (BVP) of second order, where the equation depends on several know parameters, which are geometric parameters and material constants. I would like to solve this equation for several combinations of values of the known parameters. Is it possible to do this using solve_bvp()? I am ...
I want to numerically calculate OTOCs for different quantum mechanical systems. Consider the following Hamiltonian $$H=p_x^2+p_y^2+x^2y^2$$ and I want to calculate the following OTOC $$C_T(t)=-\left<[x(t),p_x(0)]^2\right>_\beta$$ where $$\left<\mathcal{O}\right>_\beta=Z^{-1}\text{Tr}(\mathcal{O} e^{-\beta H}),\qquad Z=...
I am trying to solve the 2D incompressible Navier-Stokes equations for laminar flow over a backward facing step using the finite volume method. This is the plot that I generated of a generic mesh showing u1, u2, and p nodes to help myself derive the discrete integrals in the conservation equations: The grid is stagger...
I cannot remember where I picked this up, but during my time reading about polynomial approximation for floating-point arithmetic of sin(x), I vaguely remember that there is an extra step in argument reduction. Specifically, it seems to involve "constructing a polynomial approximation for sin(x)/x instead", as "floatin...
While looking into the difference between staggered and collocated grids, I came across an effect called $2\Delta x$-oscillations, which happen on non-staggered grids, but not on staggered grids. This phenomenon is explained in an article by Stelling (1984) on pages 101-103, but I don't exactly follow the reasoning. Th...
In Bathe's Finite Element Procedures 2014 P346, the Jacobian is defined as follows: \begin{equation} \mathbf{J} = \begin{bmatrix} \frac{\partial x}{\partial r} & \frac{\partial y}{\partial r} \\ \frac{\partial x}{\partial s} & \frac{\partial y}{\partial s} \end{bmatrix} \end{equation} I need to calculate the following ...
I am aware of a symmetric matrix type in uBLAS as ublas::symmetric_matrix matrix. Is there an equivalent for this in Eigen library that can be used to construct one or do we need to explicitly check if a matrix is symmetric or not which could be a time expensive solution (O(n^2)). Any guidance is appreciated.
I'm looking for a simple, right-traveling wave for the linear shallow water equations (1D). My question: what are the initial conditions (velocity $U_0(x)$ and/or average water height, average velocity) for a simple (single!) right-traveling wave? I want to create a simple wave solution for the 1D shallow water equatio...
I have a grid of points $x_i$ and corresponding function values $y_i=f(x_i)$. I'm interesting in something like the cumulant of $f$, but it has an awkward prefactor. The desired quantity we'll call $$z(x) = e^{x}\int_{x}^{\infty}e^{-q}f(q)dq$$ And this quantity is needed for each grid point, $z_i=z(x_i)$ Let us assume ...
For solving linear problems stemming from PDEs with the FEM, such as the Poisson equation or the wave equation, it is customary to use the "simplest" numerical quadrature that exactly integrates the quantities that define the mass/stiffness matrices. More precisely, given shape functions $\phi_k$ for nodes $k$ on an el...
I have a set of coupled pdes which I want to solve using finite-difference, of which one is nonlinear. The three linear pdes for quantities $T_f$, $T_s$ and $c$ are convection-diffusion-reaction-like equations. The nonlinear equation for $\alpha$ is of the Arrhenius type: $\frac{\partial \alpha}{\partial t}=A_fexp\left...
This question is a continuation of one of my other questions. I've been trying to show that collocated (non-staggered) grids can suffer from negative group speeds in the linearized shallow water system. I do this by solving the equations for a simple, right-traveling wave crest, so that any left-traveling component can...
I was trying to install OpenFoam exactly as mentioned on their website. But when I run simpleFoam -help it says command not found, even after restarting my PC. I am using Ubuntu 20.04 lts. When I run tail ~/.bashrc, this is the output . "/home/hell/anaconda3/etc/profile.d/conda.sh" else export PATH=...
Note (2022/03/07): This question is solved. Unfortunately, I'm not able to accept the correct answer by Lutz Lehmann, because I screwed up my registration and the account which posted this question is different from the one I'm using now, even though they have the same name. I'm trying to find the eccentric anomaly of ...
When running my simulations I usually get result files with typical sizes of 10 GByte and larger. They contain vectors and matrices with data type float, double, complex float and complex double. Initially I used text files, but when storing the data for each simulation step in text files the amount of generated files ...
I want to implement incomplete Cholesky factorization to precondition, the algorithm I refer from incomplete Cholesky factorization, function a = ichol(a) n = size(a,1); for k=1:n a(k,k) = sqrt(a(k,k)); for i=(k+1):n if (a(i,k)!=0) a(i,k) = a(i,k)/a(k,k); ...
The strain energy of an incompressible Neo-Hookean solid is given as: $$ W = C_{10}(I_1 - 3) $$ Implying that at zero deformation $W = 0$, because $F = I \implies C = F^TF = I \implies I_1 = 3$ Strangely though, the second Piola-Kirchoff (2PK) stress is not zero $$ S_{ij} = 2 \frac{\partial W}{\partial I_1} \delta_{ij}...
Consider the following partial differential equation \begin{align} \frac{\partial u}{\partial t}+\frac{\partial f}{\partial x} &= g(x,t), \ \ x\in \Omega = [x_{L},x_{R}] \\ u(x,0) &= u_{0}(x) \\ u(x_{L},t) &= g_{1}(t) \end{align} where the flux function $f(u,x)$ is nonlinear. Let $\{x_{i}\}_{i=1}^{N+1}$ be a partitio...
I am working on a modified version of Schrodinger's equation (time-independent) where $\frac{d^2ψ}{dx^2}=-2(E-V)ψ$, where I have to consider $V = 0$ at all times. I have been asked to use Python in order to solve this equation. I have used the following code: e = 200 dx = 0.01 xlim = 100 p = np.zeros(xlim+1) x = n...
I am building a gradient descent model based on portfolio optimization. Currently, I have finished the model and am able to run it smoothly without any problem. However, there's one issue that I couldn't fix: the optimal vector components have negative values. As my portfolio does not support short-selling stocks, this...
I am doing a physics experiment that involves releasing gas from a reservoir into a vacuum chamber via a pulsed nozzle and I am interested in knowing what would be a simple (and reasonably accurate) way to simulate the gas density distribution over a certain volume in space in front of the nozzle and over time after th...
The diffusion equation is ∂u/∂t =∂^2u/∂x^2. Consider using an explicit finite difference method to solve it. What does it mean for that explicit finite difference method to be conditionally stable?
An arithmetic expression written in Reverse Polish (postfix) Notation is an ordered list of numbers and algebraic operators, which are sequentially evaluated as a stack would process them to return a single numeric result. If the expression contains n numbers, it must contain precisely (n-1) algebraic operators if ever...
At the institution I work for we have a User Exit made in Pro*C (SQL embedded in C language). We are having some troubles because identical shared libraries are generated when compiling different source files. These .so files have no symbols. Everything was working alright just a few days ago, but suddenly this trouble...
I am having trouble getting a good parallelization with FDTD simulations in Meep. Originally, I tried to use the Python interface on a rather big computing cluster, but the runtime of my simulations did not change appreciably upon changing the number of cores for parallelization. I know that this might have a lot of re...
I am solving Darcy flow now with mixed finite element method. The Dary flow is $$\begin{equation}\begin{aligned}k^{-1}\mathbf{q} + \nabla h=0, \text{ in } \Omega\\ % \nabla\cdot \mathbf{q} = 0, \text{ in } \Omega, \\ % h =h_D, \text{ on } \partial\Omega_D, \\% \mathbf{q}\cdot \mathbf{n} = q_N = 0, \text{ on } \partial\...
I'm a PhD working in a computational mechanics lab. I come from a Math department, and I have a good background for what concerns the basics of finite elements, like inf-sup conditions, DG, non-conforming FEs. I also did some basic codes, like Poisson on a square/L-shape/etc. (or other elliptic problems) using the clas...
I want to find some kinds of matrices for testing my code such as GMRES , MINRES and so on. But I can't find some testing matrices and corresponding preconditioner to verify my program. I know some website like MatrixMarket (see this question) ,but I couldn't find corresponding preconditioner of a matrix. Can anyone h...
I ask for help in solving the problem. I am developing an optimization program that selects the coefficients of a polynomial of order $n> 5$ so that all its zeros are just real numbers. And I cannot find sufficient conditions suitable for this, which would include its coefficients. In the article A Sufficient Condition...
I am looking for a MINLP solver that works with Pyomo models which can be used in the Google Colab environment. I have already found MindtPy but it doesn't work in google colab.
This is a follow-up question to my earlier question Stochastic cellular automata - algorithm limited by 1 cell per timestep. I am considering blending two approaches to a cellular automata model of how mold spreads in a petri dish. A probability based approach A quick review: I am trying to model the spread of mold in...
This question is a follow-up of this previous one. I decided to solve the linear elasticity \begin{cases}- \nabla \sigma(u)=f \\ u=0 \text{ on } \partial \Omega\end{cases} with P1 Lagrangian finite elements on the square $[-1,1]^2$. Here I want to highlight and ask for a confirmation the crucial steps, that were totall...
I have some data, (xrd data), that I would like peak fit with a pseudo-Voigt function, a combination of a Gaussian and a Lorentzian function. These are the functions $G(x) = I \exp\left( -\frac{4\ln(2)(x-\Theta)^2}{w_G}\right)$ $L(x) = I \frac{w_{L}^2}{w_{L}^2+\left(x-\Theta\right)^2}$ Where $I$ is the intensity, $\The...
Was trying to implement a poisson 2d solver using Conjugate Gradient Method, so from 10x10 grid the matrix becomes 100x100 (since we have 100 nodes to find the values at), 100x100 grid goes to 10000x10000 matrix, but matrix is sparse with 5 elements on each row (not pentadiagonal!). Hence, receiving segmentation fault,...
I am trying to understand the attached python 3X code. The following dispersion relation is given $$\epsilon (k, \omega) = 1 - \frac 1 2 \left[ \frac{\omega_p^2}{(\omega-kv_0)^2} + \frac{\omega_p^2}{(\omega+kv_0)^2}\right]$$ What I am trying to understand is how to find the minimum grid length $L_{min}$ (as a function ...
I have discrete data of a function plotted below: The "Y" values of the function near "X=1.57" are very close to each other and zero, like 9.25558265263186E-11 and 5.92357284527227E-11. Using "Trapz" function directly, or using "Integral" function indirectly as f1 = griddedInterpolant(x,y); %I used also spline and oth...
I want to use the SDEint package to give a numerical solution (plot) of the following stochastic SIR model. Namely, a system of SDEs. $$\begin{cases} dS = -\beta SIdt - \sigma SIdW \\ dI = (\beta SI - \gamma I)dt + \sigma SIdW \\ dR = \gamma Idt \end{cases}$$ Here is the code I have been trying so far. Below I will ex...
I'm trying to solve \begin{cases} - \Delta p=f \text{ in } \Omega\\ p=0 \text{ on } \partial \Omega \end{cases} with in $\Omega = [-1,1]^2$ by writing it as \begin{cases} u + \nabla p=0 \\ -\operatorname{div}(u) = -f \\ p = 0 \text{ on } \partial \Omega \end{cases} whose weak form is \begin{cases}(v,u) - (\operatorna...
I'm trying to learn about collocation. As an example, I am using Numerical Recipes, 20.7.12, but changing the basis. To wit, I'm trying to solve $$y'' + y' - 2y + 2 = 0, -1 \le x \le 1, y(-1) = y(1) = 0$$ which has exact solution $y(x) = 1 - \frac{e^{x} \sinh(2) + e^{-2x}\sinh(1)}{\sinh(3)}$. Now, Numerical Recipes is ...
Consider the following partial differential equation \begin{align} \frac{\partial u}{\partial t}+\frac{\partial f}{\partial x} &= g(x,t), \ \ x\in \Omega = [x_{L},x_{R}] \\ u(x,0) &= u_{0}(x) \\ \frac{\partial u}{\partial x}(x_{L},t) &= g_{1}(t) \end{align} where the flux function $f(u,x)$ is nonlinear. Let $\{x_{i}\...
I code mostly in Matlab, simulating various simple fluid dynamics models. One particular simulation has the potential to become sort of complex, though I believe the set of coupled equations will still be pretty simple / greatly simplified. Is a 2021 MacBook Air sufficient for simulations? My 10-year-old MacBook Pro ru...
I have some confusion in this diagram My confusion : why is $Hx= x-2u^{H}xu$ ? why not $Hx=x(x-uu^H) + 2((u^Hx)u)^2? $ My thinking is that by using pythogoras theorem blue line(vector) denotes $(x-(u^Hx)u)^2 +(u^Hx)^2= x^2 + ((u^Hx)u)^2- 2xu^Hu +((u^Hx)u)^2 = x(x-uu^H) + 2((u^Hx)u)^2 \neq (I-2uu^H)x$
I am trying to speed up some multi-camera system that relies on calculation of fundamental matrices between each camera pair. Please notice the following is pseudocode. @ means matrix multiplication, | means concatenation. I have code to calculate F for each pair calculate_f(camera_matrix1_3x4, camera_matrix1_3x4), and...
Fast Givens rotations seem like a nice upgrade from standard Givens rotations. They take fewer multiplications to apply and avoid the calculation of a square root. They are, however, given very little focus in the recent literature. They appear as an exercise in Golub and Van Loan. They get a short section in Gentle bu...
My Math SE question determining if a coincident point in a pair of rotated hexagonal lattices is closest to the origin? explains the problem I have. I won't reproduce the whole thing in detail here, but this image illustrates the problem graphically. On the right: the coincident point defined the closed dot point (5,...
Let A and B be sparse matrices in $ \mathbb{R}^{m\times m}$ with (roughly) the same density $p$. I want to efficiently compute a matrix $C$ that in some sense is "closest" to $AB$ while still having density $p$. "Closest" should probably mean "minimizes $||C - AB||_F$" but I'm open to other interpretations. If $\textrm...
I would like to solve following the basic equation of linear elasticity (for simplicity in 1D) $$ \frac{d}{dx} \left( E \frac{du}{dx} \right) = 0 \quad \textrm{with} \quad u(1)=0, \; u(-1)=b $$ Following the example on page 138 (program 33) in Nick Trefethen's book "Spectral Methods in Matlab" (https://people.maths.ox....
Below is kind of a broad question. Was given Poisson equation with BC, on meshgrid of NxM. Rewrote as system of N*M linear equations, Converted to sparse format (CSR/CRS/Yale), solved using Conj Grad method As for 100x100 grid computation time is ~0.3s and if I increase the grid to 500x500, code runs for 11 seconds alr...
I am attempting to evaluate an expression that defines a probability of a particular event. With 3 different events, I can (under some statistical assumptions) characterize the probability of event 1 (for example) occurring as $$\frac{e^{v_1+2 v_2} (v_2-v_1)}{\left(e^{v_2}-e^{v_1}\right)^2 \left(e^{v_2}-e^{v_3}\right)}...
I have a (numerical, noisy) function $f$ that I'd like to optimize (in 3 < dimension < 10). The function $f$ has a fairly prominent valley/ravine structure due to physical symmetries present in the input data. To be more precise: there is a submanifold $V$ of low dimension (let's say 1 or 2) along which function values...
Let's consider that we have large number of boxes being transported in a truck. These boxes contain certain number of vials which in turn contain some other products. Now one would like to simulate the impact of truck vibration during the transport on the vials. An impact such as the shock and other mechanical constrai...
Supposing that $\{B_{ij}\}_{i,j}$ are all Hermitian matrices and $\{c_{ijk}\}_{i,j,k}$ are all real numbers, the corresponding SDP(Semidefinite Programming) problem is as follows: $$ \begin{aligned} &\!\!\min_{\{X_{ij} \;\!\}}\quad \mathrm{tr}\sum_{i,j}X_{ij}B_{ij} \\ &\mathrm{s.t.}\quad\sum_{i,j} c_{ijk}X_{ij}\succeq0...
I want to plot some functions f(x,y) including singularities. For example; f(x,y)=tan(x-y) In Matlab, when I run the following code syms x y; func=@(x,y) tan(x-y); fsurf(@(x,y) func(x,y), [-4 2 -1 1]); I get In Mathematica, when I plot the same function, I can remove the discontinuities using Exclusions -> "Singul...
Sorry in advance if this question has already been asked, I found nothing to help. I want to buid a 3D box whose top surface is topography. This topography is defined by a DEM i.e. a set of points (x,y,z) where z is the elevation and (x,y) are known on a cartesian grid. How to include this set of points to generate a s...
Sorry for question's silly tittle. I don't quite know how to name my problem, that's why I'm here. Imagine you wish do add the collumns of you data ('1','2','3'...'30k' etc.) in such a way as to obtain the numbers in the Goal column. You don't have to combine all the columns, combine only as many as necessary for you ...
I have $d\times d$ real-valued matrices $A_1,\ldots,A_k$, $1000<d<4000$, $k\approx 50$, and need to estimate the trace of the following matrix product $$t=\text{tr}(A_1 A_2\cdots A_k A_k^T \cdots A_2^T A_1^T)$$ $\|u\|^2$ gives me an unbiased estimate of $t$ where $u=A_1 \cdots A_k v$ and $v$ is some random vector with...
This is a time fractional PDE,where $0<\alpha<1$. I would like to know how to describe this equation and where does this equation come from.
I wish to build a simulation of self-assembling wires. Think lots of ball bearings in a 20KV electric field and they form emergent structures. If I use the method of images to figure out what the induced charges on various parts of these ball bearings due to all the other charges, is this enough to specify a general si...
I need to solve a few eigenvalues of a large sparse matrix specified by their index range. These indices are according to the whole eigenspectrum sorted in algebraic (not absolute value) ascending order. For example in python, I notice this is made available by the subset_by_index option in scipy.linalg.eigh for non-sp...
I have developed an Octave script to solve the nonlinear Euler-Bernoulli beam equations with linearized von Karman-strains, i.e. higher-order terms are dropped. The simulation results agree with analytical results in small and moderately large displacements in static analysis. However, when doing a dynamic simulation w...
While browsing a disk image from the Soviet mainframe BESM-6, I've found some bits and pieces of a computational math library for Algol-60, stored in plaintext (if the Soviet GOST 10859 encoding with parity, as if on punched cards, can be considered plaintext). One function is of particular interest because of an error...
I have a parallel code. The code is implemented using MPI. I want to find a package that can help to implement global mesh refine and optimize meshes (avoid very thin element). The mesh in my work is all organized by triangle or tetrahedra. Do you have any state of art packages for suggestions? I know the metis/parmeti...
I am interested in calculating the total potential energy stored in a finite element mesh given its nodal point displacements alone. The forces that created the displacements are irrelevant because the objective is to calculate the strain energy stored in the mesh post-deformation. From what I understand the total pote...
Is it possible to conduct an Eigen-decomposition of a matrix one eigenpair by one eigenpair? And related to this question, what is the time complexity of truncated eigendecomposition? I am trying (hard) to find a way to reduce the time complexity of my algorithm which involves the calculation of eigendecomposition of ...
I'm trying to understand how Lagrange multipliers are applied in order to impose constraints in PDEs. Consider $B \subset \Omega$. For instance, a square inside another square domain $\Omega$. Let's say we want the solution to the Poisson problem $$-\Delta u = f \text{ in } \Omega$$ subject to the constraint $$u = g \...
For integer $k>0$, it is well-known that one can use binary exponentiation to evaluate the matrix power $\mathbf A^k$, where $\mathbf A$ is an $n\times n$ matrix. However, it is not clear to me if that method can be readily modified to evaluate $\mathbf A^k \mathbf v$, where $\mathbf v$ is a vector of dimension $n$. Of...
Suppose that we have $N$ points, and a distance matrix $D \in \mathbb{R}^{N \times N}$ describing the Euclidean distance among those points. For now, assume that we do not necessarily know how many dimensions the original points lived in. Is there a general way to construct a new matrix $B \in \mathbb{R}^{N \times P}$,...
If I have the Poisson equation $\Delta u = f$ a standard transfer operator (for a regular grid) is the full weighting/bilinear interpolation scheme: $$K = \frac{1}{4}\begin{bmatrix}\frac{1}{4} & \frac{1}{2} & \frac{1}{4} \\ \frac{1}{2} & 1 & \frac{1}{2} \\ \frac{1}{4} & \frac{1}{2} & \frac{1}{4}\end{bmatrix}.$$ General...