instruction stringlengths 43 28.1k |
|---|
Imagine we have a simple 2D FEM solver (we are dealing with solid mechanics) and we would like to develop it to a 3D FEM solver (let's say for the same solid mechanics problem) in this case what are the inevitable changes/modifications to be made in the code?
I understand that some might answer "It depends on the type ... |
I was messing around with some numerical integration functions. I wrote an arbitrary differential equation to test my understanding, the code is as follows:
import numpy as np
from scipy.integrate import odeint
intT = np.array([0,1,2,3,4,6,8,10,13,16,19,20,21,22,27,40,80])
def dydt(y,t):
dydt = np.random.choice(... |
I know that, in general, finite volume (FV) methods are more (numerically) diffusive than spectral methods. However, I can't find any information on how the advection scheme changes that.
For example, WENO schemes are supposed to decrease numerical diffusion and presumably would get numerical diffusion of FV methods cl... |
Let us suppose that I have a full cycle LCG, following the standard equation
Hence, as it has a full cycle, it will have a period of m, and will output values ranging from 0 to m. However, I want to limit the output values to somewhere between 0 to some arbitrary constant a, where a is less than m. All the while main... |
I need to generate an image with 11x11 pixels having in the center of the image a square of 5x5 pixels, with the gray level of the background 0 and the gray level of the square is 50. I need to compute the gradient of the image given by the compass operator, taking into account that the image is not noisy(simple deriva... |
Inspired by this answer, I tried to understand when floating point errors come into visibility and to check it also comparing the plot of the numerical solution with Explicit Euler with the analytical one for this simple problem.
\begin{cases}
y'(x)= L \sin(x) \\
y(0)= 0
\end{cases}
where $L$ is a number. The Solution ... |
I want to solve the following Cauchy problem
\begin{equation}
y' = y^2 + \frac{t^4 - 6t^3 + 12t^2 - 14t + 9}{(1+t)^2}
\end{equation}
with initial condition: $y(0) = 2$ for $t \in [0,1.6]$ using a 3 steps Adam-Moulton method implemented in Matlab as follows:
function [t,u] = AM3(fun,t0,T,y0,N)
h = (T-t0)/N; % integrat... |
I am modelling a problem that is "driven", not by typical boundary conditions but, by contractions in its interior.
In a finite element analysis, I can specify the new lengths (not displacement vectors) of a set, $\mathscr{S}$, of element edges. I do not know the final positions of the vertexes that make up edges in $\... |
Given the location of $n$ points on a 2D plane ($P_1, P_2, \ldots, P_n$); and the location of a special point $X$.
Find three points $P_i,P_j,P_k$ ($i \neq j \neq k$) such that point $X$ is inside the triangle $P_iP_jP_k$, and the minimum distance between point $X$ and the three sides of the triangle is the largest.
In... |
I want to approximate $uu'$ with a finite difference. On the one hand, it seems to be
$$(uu')_i=u_i\frac{u_{i+1}-u_{i-1}}{2\Delta t}=\frac{u_iu_{i+1}-u_iu_{i-1}}{2\Delta t}$$
On the other hand,
$$(uu')_i=\left(\frac{d}{dx}\frac{u^2}{2}\right)_i=\frac{u^2_{i+1}-u^2_{i-1}}{4\Delta x}$$
I might be wrong but I think that t... |
I have a problem with computing gradient of each node in finite element method. I can get the value of each node. But how can I get the gradient?
I know $u = \sum u_i \phi_i$ where $\phi_i$ are the test functions. So $\frac{\partial u}{\partial x} = \sum u_i \frac{\partial \phi_i}{\partial x}$. But if it is one-dimensi... |
I realized an usual way to scale an N-body problem for an N-body simulation is by choosing units such that gravitational constant $G = 1$, but I'm probably doing it the wrong way. Suppose I simply have a planet moving around the Sun (which I consider as the center of my reference frame). For example I choose
\begin{equ... |
I would like to have an algorithm that interpolates the values attached to nodes in a concave mesh mesh.
To be me precise, assume we have a point cloud P (e.g. in 3 dimensions) and a list of edges E connecting it with form a concave mesh in the form $E=[[i_1,i_2],[j_,j_2],...]$, where $i,j$ are nodes.
Further assume th... |
Let $A \in \mathbb{R}^{m \times n}$ where $m \geq n$.
Let $B$ and $\tau$ be the result of applying LAPACK's dgeqrfp method (R on the upper right triangle, and the Householders reflectors below the diagonal).
How would you use the reflectors and $\tau$ to perform a projection of any matrix on the space orthogonal to the... |
I need to do a simulation for my thesis project involving some piezoelectric nanoparticles in a fluid beamed with ultrasounds. I'm looking for a software for such simulation and for now it seems me only COMSOL Multiphysics has acoustic and electrostatic modules for finite element analysis. Do you recommend it? Can you ... |
I have been trying to figure out what I did wrong for the last two days. I do not know if I actually did something wrong or if the error is supposed to be this large in usual leapfrog problems. I tried checking my numerical solution with an exact one. Specifically, where the initial condition of the string is
$$y(x,0) ... |
I have read different approaches on how to solve pdes in parallel which are discretized using finite element method. For example:
Non-overlapping domain decomposition approach as mentioned in https://imsc.uni-graz.at/haasegu/Papers/Douglas-Haase-Langer/textbook.pdf at chapter 5.2 . Each process works on each own domai... |
I believe, I have a parametric nonlinear optimization problem.
The non-convex constraints depend on some parameters, and I seek a solution that satisfies these constraints for all parameters in a specified continuous range.
Let $ {\bf A}(\vec{x},\vec{\theta}) := {\bf A} \in\mathbb{R}^{n\times n}$ be a matrix-valued fun... |
Say you have a tensor $T$ and the components are represented by a 3 by 3 by 3 matrix. And you want to use that tensor to map a vector $u$ into a new vector $s$, both of which are 3 by 1 column vectors.
How do I know how to convert the 3 by 3 by 3 matrix into a matrix that is compatible with multiplication with my vecto... |
I want to construct a gauss integration for the weight function $w(x) = x^{1/2}$ for
$$\int_{0}^{1}x^{1/2}f(x)dx = a_{1}f(x_{1})+a_{2}f(x_{2})$$
Solving
\begin{align*}
a_{1}+a_{2} =& \int_{0}^{1}x^{1/2} dx = \frac{2}{3} \\
a_{1}x_{1}+a_{2}x_{2}=&\int_{0}^{1}x^{1/2}x dx =\frac{2}{5}\\
\end{align*}
Solving this s... |
I am trying to numerically solve the following equation:
$\frac{\partial^{2} \phi}{\partial t^{2}}-\frac{\partial^{2} \phi}{\partial x^{2}}+V(x) \phi(x, t)=0$ On some domain, with:
$\phi(x, 0) = I(x)$
$\frac{\partial \phi(x, 0)}{\partial t} = 0$
And with non-reflecting (absorbing) boundary conditions.
I am using finite... |
Original Stack Overflow Question: https://stackoverflow.com/questions/65683788/indexerror-index-31-is-out-of-bounds-for-axis-1-with-size-31?noredirect=1#comment116218335_65683788
PDE: u_t = u_xx + u(u_x)^2
The backward difference was used the time derivative meanwhile a central difference was used for the first space d... |
I am using the Galerkin method (Discontinuous to be precise) to discretize in space the scalar linear wave equation and the explicit second order centered finite difference scheme to discretize in time, resulting in a semi-discrete system of the kind:
$M\ddot{U} + KU=0, \quad U(0)=U_0, \quad \dot{U}(0) = U_1,$
where $M... |
I am looking for finding or rather building common eigenvectors matrix X between 2 matrices A and B such as :
AX=aX with "a" the diagonal matrix corresponding to the eigenvalues
BX=bX with "b" the diagonal matrix corresponding to the eigenvalues
where A and B are square and diagonalizable matrices.
I took a look in a... |
I am trying to write a function to compute 1st derivative with backward difference approximation. $ u'(x_i) = \frac{u(x_i) - u(x_i - \Delta_x)}{\Delta x} \equiv D_- u(x_i).$
And for the first point, I use the forward difference approximation that mirrors the one I just found.
My problem is the function is not accurate... |
I am puzzled by the Wikipedia entry discussing many online algorithms for computing the sample variance, including the Welford's online algorithm.
In particular, the sample variance $s_n^2$ can be computed from the sample $\{X_1,..,X_n\}$ as:
$$
x_n = \frac{n-1}n x_{n-1} + \frac 1n X_n
$$
$$
s_n^2=\frac{n-2}{n-1}s_{n-1... |
Following the advise of @Federico Polonion a previous post, one suggested, to find a basis of common eigen vectors between 2 matrices, to simply do :
Generate 2 random scalars x and y
Compute the eigen vectors and values of the quantity x*A + b*Y by doing in Matlab :
eig(x * A + y * B)
But I would have thought that... |
A MATLAB library seems to overcomplicate a computation:
exp( (log(a) - log(b))/b )
which is mathematically equivalent (assuming real & positive a, b) to
(a/b).^(1/b)
Another computation in log-exp cancellation makes sense for greater numeric stability, but I can't see any advantages here. What could be the motivation... |
Hi I am trying to solve a set of pde converted into ODE and DAE using central finite difference method. I have used the MATLAB 'solve' command to determine the coefficients of fictitious nodes for boundary conditions. I am using the ode15s solver and getting "This DAE appears to be of index greater than 1" daeic12 (lin... |
i am implementing a Matlab code to solve the following equation numerically :
$$
(\frac{\partial c}{\partial t} =-D_{e} \frac{\partial^2 c}{\partial z^2} +U_{z}\frac{\partial c}{\partial z})
$$
with the folllowing boundary conditions:
$$ at \ \ z = 0 \ ; \ c= c_{i0} \\ \\
at \ \ z = L \ ; \ \frac{\part... |
I am new to Fortran and I am trying to write a code using random data instead of binned data in x, y, z as shown in my sample code.
implicit real*8(a-h,o-z)
dimension rm(4),rp1(4),rip1(4),rp2(4),rip2(4),rp3(4),rip3(4),
d rn(4),u1(4),u2(4),u3(4)
do ix= 1000,25000,1000
x = ix/1000000.
do iy = 1000,25000,1000
... |
I am trying to self-learn SciPy and evaluate the following quadruple integral using scipy.integrate.nquad:
$$\int_{0}^{1} \int_{0}^{1} \int_{0}^{1} \int_{0}^{1-x} (w+y) \:dz \:dy \:dx \:dw $$
I wrote the following code:
from scipy import integrate
def f(z, y, x, w):
return w + y
def bounds(z):
return [0, 1-z]... |
I am struggling with implementing an algorithm that does one simple thing:
Consider two polygons (one can just draw any two polygons and number their vertices), whose connectivities in a node list are:
A = [1, 2, 3, 4, 5]
B = [1, 6, 7, 8, 3, 2]
These two polygons share 2 faces (1, 2) and (2, 3).
What I want to do is to... |
I'm in search for a library for solving large systems of non-linear equations, similar to MINPACK, but unlike MINPACK, can accept a Jacobian in band-storage.
My Jacobian is sometimes not invertible, so a method like the Levenberg-Marquardt algorithm in MINPACK, which can deal with singular Jacobians is important. Also,... |
I am trying to use CVXPY to optimise signal-to-noise-plus interference ratio (SINR) for a visible light communication (VLC) system. I have one of my SINR constraints stated as
\begin{equation}
\mathbf{h}^{\textsf{T}}_{l,u}\mathbf{p}_{l} \geq \sqrt{\gamma_{u}\sum_{j\in \mathcal{L}\backslash\lbrace l\rbrace}\left(\ma... |
How frequently scientific code uses comparisons NaN == NaN?
Reason of asking: from time to time compilers / software floating-point library implementations have bugs w.r.t. comparisons with NaN. For instance, NaN == NaN incorrectly returns true, which is a bug.
The end user may face with this bug if the end user relies... |
In my research, I need to invert a Fisher matrix in order to get a covariance matrix for me to do parameter estimation. Unfortunately, the values of Fisher matrix vary by many orders of magnitude, and the numerical errors are significant (see image at end).
I first attempted this in python using scipy.linalg.inv, and i... |
The version of Fortran used comes from Montreal Ecole Polytechnique in 1980. I need a compiler for Fortran for Windows 7 or Windows 8.
|
i trying to solve this integral
$$\int_{-\infty}^{\infty} e^{-x^2}dx$$
I'm using this
CODE
from scipy.integrate import quad
def integrand(x):
return exp(-x**2)
I = quad(integrand, -np.inf, np.inf, args=())
>>>I = (1.7724538509055159, 1.4202636780944923e-08)
Can i use any other numerical method to solve it?
|
The model is
$$y_i=\beta\big(x_{i1}^\alpha+x_{i2}^\alpha+...+x_{im_i}^\alpha\big)+\epsilon_i\textrm{ for }i=1, 2, ..., n$$
I want to minimize the MAE, i.e.
$$\Sigma_{i=1}^n{\big|y_i-\beta\big(x_{i1}^\alpha+x_{i2}^\alpha+...+x_{im_i}^\alpha\big)\big|}$$
I tried gradient descent, but I'm worried that the solution is no... |
My question is around the efficiency of AMG. In which case AMG can perform better,as solver or as a preconditioner(for example a Krylov space method as CG)? Assume the case of elliptic pdes.
|
I want to try simulation-(and not experimental)-driven approach to design custom fireplace fuel burners.
What software applications, libraries, code and model templates can I use to model and visualise a combustion process on a 3D object?
I want to design a 3D model of a static solid object, assign properties to it (e.... |
I'm trying to verify the order of convergence for implicit Euler method to numerically solve Black-Scholes PDE. Theory says that it should be $O(\Delta t + \Delta S^2).$ My code is working absolutely fine. I'm getting almost zero error when I compare my solution to the one obtained by Black-Scholes formula. However, I'... |
How to solve/assess the following problem?
Given: $N$ ingredients like apples, bread etc. Mass of an ingredient $j$ is in this simplified model a sum of macro nutrients carbohydrates, proteins and fats in proportions $c_j$, $p_j$ and $f_j$:
$(1)\ M_j = (c_j + p_j + f_j) * x_j $ (in grams)
$(2) \ c_j + p_j + f_j = 1$
Al... |
I am a newbie to convex optimisation and I am learning with the aid of CVXPY. I am requesting for clarity on the illumination problem as described in Boyd & Vandenberghe lecture 1 slides here. I have adapted the code from here and tried to visualise what the illuminance from within a room would look like. I have insert... |
I have N matrices that are positive definite, and I have to solve for a M vectors.
As M is large in my case, doing all solves simultaneously using np.linalg.solve burdens my RAM and sometimes not possible.
However, splitting to batches using and solving on them unnecessarily performs the factorization step multiple tim... |
I am quite new in this field. For my university I prepared a stiffness matrix to solve for a project group. This matrix consists of 450 equations with 450 unknows (it's a Matlab script) and I have the associated load vector $\{L\}$ of 450 rows. since I need to calculate the displacements would you advice me to simply d... |
Lately, I have encountered the following problem, namely how to recognize the shapes of particular polygons. I have realized that quite straightforward to do so when the polygons are separated by using OpenCV library as shown in the following topics
example 1
example 2
My question, however, is quite more complex and co... |
I'm trying to integrate a function which is defined as func in my code below, a cumulative distribution function is inside:
from scipy.stats import norm
from scipy.integrate import quad
import math
import numpy as np
def func(v, r):
return (1 - norm.cdf(r / math.sqrt(v)))
print(quad(lambda x: func(x, 1) , 0, np.... |
I am looking for references showing how to analytically solve the heat equation with Neumann boundary conditions in two dimensions.
So far, I have found the problem solved analytically in one dimension. I have also found analytical solutions to the heat equation in two dimensions, but with Dirichlet boundary conditions... |
To explain my problem I'd like to go with an example first.
Suppose I have many bills of grocery purchases in the same shop. On the invoices I can only see the total amount of the invoice and which products I have bought and in what quantity.
I would like to find out how much a single product actually costs by looking ... |
I have a simulation which gives a scalar result depending on the choice of some continuous design variables. I am trying to minimize the output of the simulation. As a first step, I want to study the convexity of the problem. Is there a methodology that allows us to determine whether a black box function (no analytica... |
I am attempting to create a conditional statement that compares four (4) true/false conditions. Depending on the state of these four conditions (either true or false) the conditional statement will either pass or fail. I have a table that tells me the outcome (pass/fail) of all possible permutations. 2^4 = 16 possible ... |
With the increased popularity of 3D imaging and scanning I thought it would be easy to transform a xyz point cloud into a Height Map (xy matrix of z points), but after a couple of hours searching I found nothing. Maybe I'm looking in the wrong direction, isn't there some C++ library for this type of conversion?
|
I am currently doing a project in which my aim is to write a program that can be used to calculate single and multi-channel shape resonances. So I'm looking at bound states and quasi-bound states.
Specifically, I'm looking at the hydrogen molecule in spherically symmetric potentials.
So the method I follow (renormalize... |
I am using petsc to solve a linear elasticity problem discretized by finite elements.The initial mesh is read by a mesh file and the distribution in each processor is done using METIS.I am using only the basics routines from petsc in order to create the submatrices and vectors.After solving I want every processor to wr... |
I have a system of two coupled differential equations, one is a third-order and the second is second-order. I am looking for a way to solve it in Python.
I would be extremely grateful for any advice on how can I do that or simplify this set of equations that define a boundary value problem :
Pr is just a constant (Pra... |
I am trying to use METIS-5.1.0 edition in order to partion a FE mesh. For demostration purposes I created 2x2 rectangle mesh and tried to partition it. However, I notice a weird behaviour in my code. When i am using 2 parts to partion the mesh everything works file, but if i increase the number of partions at 3 or 4 I... |
I tryin to plot the position of electron in the hidrogen atom by Coulomb's law,
$F=K \frac{q_1 q_2}{r^3}$
This is mi code
import numpy as np
import matplotlib.pyplot as plt
def coulomb(re, v0):
#Set parameters:
N = 500
dt = 2.2222222 / N # Time Step:
#Create an array, for all variables, of... |
Following the documentation of Julia's Arpack package (Cf. https://julialinearalgebra.github.io/Arpack.jl/stable/eigs/) I have computed some largest and smallest magnitude eigenvalues of sparse matrices encoded in the required CSC format and noticed major discrepancies concerning the smallest magnitude eigenvalues $\th... |
I have been using python to do algebraic calculations, but at many times when writing 1/2 Python writes 0.5, but I wanted you to write 1/2 and only when needed, convert it to a float.
I'm having a hard time imposing a simplification because Python doesn't recognize 32.0 as being 32, in short example situation where I h... |
In the Wikipedia article on magnetic moments, subsection "Effects on environment" defines the magnetic field H of a magnetic dipole moment. Additionally the magnetic field lines of this field are drawn:
I want to reproduce this picture using Python - Matplotlib. I believe that my result is correct but it is visually p... |
I am developing an Abaqus UEL with 3D 8 nodes brick elements and I need second order derivatives of the shape functions, I have already mapped the first order derivatives from the element coordinates to the physical coordinates through: $\frac{\partial N}{\partial \textbf{X} } = J^{-1} \frac{\partial N}{\partial \textb... |
I have a 2D SDF describing my shape, but it's fine to think of it as a black/white image (black="inside" white="outside").
I want to generate a small set of rectangles (say, 8 of them) covering the image, which are allowed to overlap, and which minimize the amount of error. Error would be any leftover "black" areas of ... |
I want to find the trajectory $x(t)$ which minimizes the action $S = \int_{t_i}^{t_f} L(x(t), \dot{x}(t)) \mathrm{d}t$ numerically.
I am trying to do it by discretizing the action so it is more of a function which takes in a vector rather than being a functional. More precisely, given an initial guess for the trajector... |
I need to find a relation between the tangent stiffness $L_1$ of the first Piola-Kirchhoff stress tensor with the tangents stiffness $L_2$ of the second Piola-kirchoff stress tensor. They are defined as
\begin{align}
&L_1 = \frac{dP}{dF}\, ,\\
&L_2 = 2\frac{dP}{dC}\, ,
\end{align}
with $F$ being the deformation gradien... |
For animation purposes (see below) I need to use a parametrization which 'slows down' near a specific value;
More precisely, I am looking for a 'nice' monotonically increasing function $r:[0,1] \to [0,1]$ satisfying $
r(0)=0, r(1)=1, $ whose derivative is relatively small around the point
$r^{-1}(\frac{1}{2})$.
Afte... |
I am toying with the idea of using current libraries available with SCF (Self-Consistent Field) subspace iteration codes to train an ANN (Artificial Neural Network) to solve for SCF eigenvalue problems. Are there any obvious deficiencies with this idea?
Firstly, I would like to make sure that it is possible to train an... |
I've generated a solution for a planet motion around the Sun (placed at the reference frame center). I wanted to test what would I get for the error of the method I'm using (Runge Kutta with 4 stages, with semimajor axis and Sun mass as distance and mass units, and time units evaluated in order to have $G=1$) by evalua... |
Let $X = [0,1]$, $h$ the Gaussian function (i.e. $\forall x \in X, h(x) = e^{-\frac{x}{2}}$) and $p \in L^2(X^2)$
I would like to compute numerically the following function :
$$
\forall x \in X, \quad f(x) = \int_{X^2} p(s_1,s_2) h(s_1 - x) h(s_2 - x) \,\mathrm{d}(s_1,s_2)
$$
meaning that i have, a discretized grid fo... |
I have recently started to delve into someone else's code, and there is a part in there I don't quite understand. The authors of the code use some form of pre-conditioning to speed up the optimization. I wanted to inquire if you are familiar with this pre-conditioning, and could recommend some literature to read up on ... |
Goal:
I want to use Python to illustrate how a magnetic dipole with magnetic moment m2 moves in a non-homogeneous magnetic field in a 2D-Plane. This field is generated by another magnetic dipole with moment m1. However, I get results that are not plausible.
For the calculation of the trajectory of m2 I use the equation... |
Based on my basic understanding of the BFGS method, the algorithm will iterate until the gradient norm is less than or equal to a set value called "gtol" in the case of Python.
However, when using this method, and checking the output the following is showing:
Iterations: 2
Function evaluations: 76
Gradient evaluations:... |
In some problems we are currently working on, we are working with discontinuous functions that are defined on a finite element mesh and are established using Lagrangian particles. To obtain them on a finite element basis, we calculate the L2 projection. This works quite well and gives us a piecewise continuous represen... |
I am implementing a logarithmic quantizer which is defined as follows:
$$ q(u) = \begin{cases} u_i , \frac{u_i}{1+\delta} < u < \frac{u_i}{1-\delta} \\
0 , 0 \leq u \leq \frac{u_o}{1+\delta} \\
-q(-u), \ u < 0 \end{cases} $$
where the different parameters are computed based upon these expressions:
$$ u_i = p^{1-i}u_o, ... |
I have discretized a PDE with continuous finite element method in spatial variable and with implicit Euler or Crank-Nicolson in temporal variable. In both cases, I have error estimates in $L_2$ norm in form $\mathcal{O}(\Delta\,t^j + h^2),$ where $j=1$ for backward Euler and $j=2$ for Crank-Nicolson. In both cases I ha... |
Can someone explain me at a high level the difference between an SCP and an SQP to solve a nonlinear (nonconvex) program?
Assume my problem is something like
$$\min\limits_x. \quad f(x)$$
$$s.t. \quad g(x) \leq 0 $$
where both $f$ and $g$ are (in general) nonconvex.
My understanding is that (regardless or trust-region... |
In SU2 documentation about the numerical schemes (https://su2code.github.io/docs_v7/Convective-Schemes/) FDS is mentioned as a "standalone" method.
Yet, when looking online for more information about FDS scheme, it seems it is just a preconditioning for the ROE scheme. And this seems coherent with the fact that has rep... |
I need some (direct) sparse linear solver for fortran, which works with REAL16 data type. Any suggestions? Both Pardiso and MUMPS support only REAL8. (identical question: https://math.stackexchange.com/questions/4016856/sparse-linear-solver-in-fortran-working-with-real16?noredirect=1#comment8293130_4016856)
|
In the center of a 2D-Plane a positive static charge Q is placed with position r_prime. This charge creates a static electrical Field E.
Now i want to place a test particle with charge Q and position vector r in this static E-Field and compute its trajectory using the 4th order Runge-Kutta method.
For the initial condi... |
I need to plot the following functional with accuracy:
$$
I(x,s) =\int_0^\infty\mathrm dy \frac{F(x + \mathrm iy,s) − F(x −\mathrm iy,s)}{\mathrm e^{2πy}-1},
$$
Where $ F(z,s) = \dfrac{1}{z^s\Gamma(\sin^2[π\Gamma(z)/(2z)])} $.
And let us restrict $s\in[0,1]$
What is the most efficient way of computing this integral?
... |
The goal
Implement some Python code to find the extrema points of a function that is strongly oscillating.
The background
Let $G$ be a connected graph with $n$ points with Laplacian matrix $L(G)$. We may represent each vertex of $G$ as a canonical basis vector $|k\rangle$ for $k\in \{1, ..., n\}$, spanning a position H... |
I intend to check the diagonal of L, where A = L'L, for negative elements. However, I don't know if Cholesky is meaningful in theoretical / computational sense if there are some negative eigenvalues.
|
I want to solve a nonlinear ODE of matrix $A(t)$
$$\mathrm{i}\dot A = A(t)M(t),\:\mathrm{with}\: M(t)=A^\dagger(t)H(t)A(t)$$ where $H(t)$ and hence $M(t)$ are Hermitian. Therefore, I presume the time evolution of $A(t)$ is unitary. Is there any algorithm that can maintain this unitarity? I've heard of Crank-Nicolson, b... |
I am learning about simulated annealing algorithm and want to create a general purpose one for optimizing continuous functions.
The problem I have is how to generate the neighbor points as candidates. Random shift of steps is one strategy available in literature, but it seems more applicable for discrete problems.
What... |
Find the solution to the Cauchy problem consisting of the wave equation :
$$u_{xx}-u_{yy}=0$$ together with initial conditions: $$ u(x,0)=0,$$ $$u_{y}(x,0)=g(x)$$ for some known initial datum $g$.
Is the problem well-posed or ill-posed?
Why?
My thoughts:
By changing variables we have :
$$ u(x,y) = \xi(x-y)+\eta(x+y) $$... |
I would like to create an optimization solution for black-box software calculations. Currently, I am using the Levenberg-Marquardt algorithm to update a vector of parameters, $\beta$, with residuals, $r$, determined by outputting the black-box calculation and model parameters to a readable table.
$(J^TJ+\lambda diag(J^... |
Say, we have a Hamiltonian which for simplicity does not mix particle hole sectors. It is just a simple Hamiltonian in real space as shown,
$H=\sum_{ij,\sigma} A(i,j)(c_{i\sigma}^{\dagger}c_{j\sigma} +h.c.) $
In a specific spin sector (as spin sectors are decoupled) , we use the transformation $c_{i\sigma}=\sum_{n} \al... |
I am running a CFD simulation with a 200,000-vertex mesh. I've decomposed the mesh into 2 load-balanced sub-domains to test my parallel implementation. In the specific function that I am time-profiling, each sub-domain has to send a 3D gradient vector of MPI_DOUBLEs for each of the ~2000 vertices that lie on the parall... |
I have a finite element solver where I am using tetrahedral elements. I am solving for electric potentials and then calculate the current densities in each element, which are constant in each element. Now, assume that I want to calculate Fourier transforms for current density in the $x$ direction ($J_x$).
$$F(J_x(x,y,z... |
I need your helps about solving the problem below with MATLAB. I am trying to solve 2D Stress Wave Propagation problem by using FDTD(Finite difference time domain) method on the cylindrical coord. I have discretize the domain and now ı am trying to apply boundary conditions. I have the boundary condition equation below... |
Given $\mathbf V_t=\mathbf v_t\mathbf v_t^H$ where $\mathbf v_t=\left(e^{j\theta_{1}},e^{j\theta_{2}}\right)^H$:
\begin{equation*}
\begin{array}{ll}
\underset{\mathbf V}{\operatorname{minimize}} & 1 \\
\text { subject to } & \operatorname{diag}(\mathbf V)=1\\
&\|\mathbf V\|_*-\operatorname{trace}\left[\boldsymbol\lambd... |
There are 3 sensors (A, B, C) on a plane, located in the corners of a (known) equilateral triangle.
I want to calculate the (2D) location of an object (X) inside that triangle.
One sensor returns one scalar value per reading, but in order to compensate for environmental effects, I always use the values relative to each... |
Let $A$ be a symmetric matrix. It is then well known that computing the LU factorisation of $PAP^T$ instead of $A$ for a suitably chosen permutation matrix $P$ can greatly reduce fill-in. My question is: Can we show that considering nonsymmetric permutations, i.e. $PAQ^T$, cannot reduce fill-in even further?
|
I have a finite element solver that I implemented in MATLAB. I am calculating a specific potential function that is constant in each tetrahedral element. The question is, I want to be able to interpolate this potential on a rectangular grid on a slice. How can I achieve this? I can take the middle points of each elemen... |
I'm trying to bin a 2d array of points such that each bin has an equal number of samples contained in it. This would mean having bins of differing ranges and possibly shapes.
I have seen this stackexechange thread asking about the same thing. The answer there points to using a kdtree.
My question is: can scipy.spatial.... |
I'm working on a Monte Carlo project similar to the Ising model. I've found many examples on which I've based my code.
From some papers I read on binning analysis, the errors after each binning step are supposed to converge. Mine ended up oscillating after some binning step. And so I'm getting negative auto correlation... |
I want to solve the equation of inflation involving a scalar field numerically using Python libraries such as odeint or scipy. The equation is:
$$φ''(t) + 3Hφ′(t) + V′(φ(t))=0\, ,$$
with given condition: $3Mp2H2 = V(φ)$.
Can anyone help me with the code and advice on how to progress on this?
|
I have a question regarding the positive definiteness of the stiffness matrix. Specifically, I believe that it should be positive definite only when at least one Dirichlet point is given, so I would like a clarification on which is the precise moment that the stiffness matrix becomes positive definite. Let us consider ... |
I've implemented the Hodgkin Huxley model, which worked fine in my visualization, I got the spiking etc.
Then I've build a network with a few thousand neurons and experienced random NAN (not a number) flooding the network; I could track it down to how sodium and potassium are updated. e.g.
VoltageDelta = MembranVoltage... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.