instruction stringlengths 43 28.1k |
|---|
I'm working with a finite element model in which I'm interested to minimize the average temperature at a surface. I have 15 independent variables in my model, including geometry, materials, flows, process times, etc. Most of my variables are continuous but some are discrete; and it takes me ~10 mins to run one simulati... |
I'm discretizing the following Poisson equation using FVM where the domain $\Omega$ of the solution is a regular hexagon of side $1$ centered about the origin.
$$\Delta u =k,\text{ $k$ constant}\\
\partial_n u = 0\\
\Omega \subset \mathbb{R^2}$$
I'm not really quite sure if my discretization and especially the argument... |
I am searching for an optimization solution, which is a 8d vector representing 4 complex elements, where each element is within the complex circle with maximal radius 1.2.
The objective function is:
$$f: \left\|\mathbf{c}_{ref}-\mathbf{c}\right\|_{2}+\left|2-\|\mathbf{c}\|_{2}\right|$$
I am using the scipy.optimize.bas... |
I'm trying to improve the speed of the following iteration to calculate $s_k$:
$$B_k^{-1} = \Bigg( I + \frac{s_{k}s_{k-1}^T}{||s_{k-1}||^2}\Bigg)...\Bigg(I+ \frac{s_1s_0^T}{||s_0||^2}\Bigg) B_0^{-1}\\s_{k+1} = -\frac{B_k^{-1}r_{k+1}}{1+\frac{s_k^TB_k^{-1}r_{k+1}}{||s_k||^2}}$$
If we calculate $B_k^{-1}$ explicitly then... |
We have the following generalized eigenvalue (set of) problem(s)
$$[K_R(\kappa)]\{u_R\} = \omega^2[M_R(\kappa)]\{u_R\}\quad \forall \kappa \in [\kappa_0, \kappa_1]$$
with
\begin{align}
&K_R(\kappa) = T^H(\kappa) K T(\kappa)\, ,\\
&M_R(\kappa) = T^H(\kappa) M T(\kappa)\, ,\\
&u = T(\kappa) u_R\, .
\end{align}
Where $K$ ... |
Given a large matrix $A$ with eigenvalues $\sigma_1\ge \sigma_2 \ge \dotsc $, I want to determine only a subset of these values, say $\sigma_5,\sigma_8$ and $\sigma_{19}$. Is there an algorithm that can do this, or is finding the top 19 eigenvalues the best that can be done?
|
I have a linear system of the type
$$Ax = b$$
I want to minimise $|b - Ax|^2$.
I know there are different approaches to directly solve the system (Normal equation + Cholesky, QR decomposition, SVD decomposition) that have different numerical stability.
I would like to ask how it is possible to estimate the impact of th... |
I am trying to write on paper the piecewise polynomials given by the splinefit function, but I am having some problems figuring out what the coefficients should be. So, the output from the script gives me the following:
scalar structure containing the fields:
form = pp
breaks =
Columns 1 through 15:
-1.00000 -... |
I would like to solve the following differential equation numerically in 2D,
$$\frac{\partial z^-}{\partial t}+(\vec{B}\cdot\vec{\nabla})z^-=0,$$
see Wikipedia if you are curious about what the symbols mean, where
$$\vec{B}=(B_x,B_y,0).$$
I have attached some code which can solve this to first order accuracy in python ... |
I have read a lot about numerical integrators (ode solvers) lately and tried reading a few papers but I have stumbled upon something that I can't understand and it's something called ABA and BAB.
For example in this paper New families of symplectic splitting methods for numerical integration in dynamical astronomy the... |
I'm trying to read papers on numerical ODE algorithms and I always seem to stumble upon huge amounts of exponentials multiplied by each other. For example in New families of symplectic splitting methods for numerical integration in dynamical astronomy there are a few of them. Is it the ordinary exponential that is mean... |
I have noticed arpack comes with a driver dsdrv1 that exploits symmetry of a real-valued matrix.
Is there a way to analogously exploit a Hermitian matrix in some way via z--- drivers?
The manual discusses Hermitian matrices in section 3.2.1, but I'm not sure if this analysis and proposal is already present in the ARPAC... |
An optimization problem has 3 main components: decision variables, constraints, and an objective function. Such a problem can be mathematically modelled and solved using an optimization solver. For example, a SUDOKU puzzle can be modelled as such and solved using a solver.
What are examples of famous real-life problems... |
When solving a system of ODEs, as part of a preconditioner, I get the system
$(A + D(t))x = b(t)$
where $A$ is a sparse matrix and $D(t)$ is diagonal. I'm currently solving this by taking the LU-decomposition of the system for each $t$. $A$ is constant throughout the solution.
Is there an algorithm that would allow me ... |
I am writing some simple code to raise a base value to a power
then perform some operations on the output. I have included the code I am
using now, below ( see end of this message ), also see immediately below
what this looks like when I run my script from the console ;
C:\PYTHON34>python tst.py
INPUT Value: 431.1
INP... |
I am using ARPACK's zndrv1 to diagonalise a matrix (the context is quantum chemistry). While all vectors have a norm 1, as expected, vectors corresponding to degenerate eigenstates aren't always orthogonal (often their inner product will be roughly 0.01).
Are there any parameters I can adjust to improve orthonormality ... |
The equation is $$\frac{\partial}{\partial x}\left(u\frac{\partial u}{\partial x}\right)=f(x)\\ 0<x<1, u(0)=u(1)=0$$
I'm discretizing this PDE using FVM as follows:
$0=x_0=x_{1/2}<x_1<x_{3/2}<\dots<x_{N+1/2}=x_{N+1}=1$
$h_i:=x_{i+1/2}-x_{i-1/2}$
$h_{i+1/2}:=x_{i+1}-x_i$
$$\int\limits_{x_{i-1/2}}^{x_{i+1/2}} \frac{\part... |
Consider a Boundary Value Problem:
$$
\delta u''+u(u'-1) =0 \Leftrightarrow u''=\frac{-u(u'-1)}{\delta}=:f(t,u',u), \\
u(0)=a, u(1)=b
$$
$\delta,a,b$ are known parameters. I want to implement Newton's method on a uniform grid. How do I derive the Jacobian?
|
I developed the code below for performing gaussian elimination in order to evaluate the determinant of a matrix:
program det3
REAL, DIMENSION(3,3) :: matriz = RESHAPE([1,2,3,-7,13,5,4,-21,8],[3,3])
REAL :: temp, m
INTEGER :: n = 3
INTEGER :: i, j, k
INTEGER :: fator_cor = 1
REAL :: det
DO k=1, n-1
DO i = k+1, n... |
I am recently starting with OpenFoam. I have a Mac as my personal laptop, but I would have to use OpenFoam on linux in my lab. So my questions are:
1) Is the OpenFoam software independent of OS, so that I can use interchangeably on both Mac and linux.
2)I am fairly good with C programming(I am not really comfortable wi... |
I want to discretize the following parabolic PDE:
$$u_t = \nabla\cdot(\alpha(x)\nabla u)- \beta u\\
x\in\Omega \subset \mathbb{R}^2\\
\partial_n u = 0\\
u(t,0) = u_0(x)\ge 0, \alpha(x)>0$$
Given the Neumann boundary condition above, one can integrate this PDE:
\begin{alignat}{2}
\frac{\mathrm d}{\mathrm dt}\int_\Omega ... |
I am writing some functions to interpolate data. While using interp2D, somehow, a sample matrix works but when I change the size of the matrix, it returns an error.
#!/usr/bin/python3
#
# Useful interpolation functions in python.
#
import numpy as np
import scipy.interpolate
def interp_2d(x,y,fxy,x_desired,y_desir... |
I am putting into MATLAB code the equations that describe a plastic extrusion process. From a paper, I found I should use a spatial grid that translates with the extrusion speed, being the reference coordinate system the centerline of the extrudate.
In particular, $s = 0$ is the extruder die and the length of the doma... |
Are there any circumstances under which using a value $w < 0$ would help us find a solution in over-relaxation faster than we can with the ordinary relaxation method?
Over Relaxation Method:
$$x'= [1 + w]f(x) - wx$$
Example
Calculating $x = 1-e^{-3x}$
Take x = 1 as initial value, and w as 0.2
x' = (1+0.2)f(1)-0.2(1) = ... |
Essentially I want to use paraview to recreate a flow visualization like the one shown in the picture above. I am able to create the 3d flow lines using a pipeline that looks like
data (csv)-> TableToStructuredGrid -> Calculator-> ExtractSubset -> StreamTracerwithCustomSource
where I have used the subset as my seed. ... |
I am trying to finish a series of interpolation functions.
The problem is more related with organizing the data than how to do the interpolations.
Using the RegularGridInterpolator, I created this function:
def interp_3d(x,y,z,fxyz,x_desired,y_desired,z_desired):
interp_func = RegularGridInterpolator((x,y,z), fxyz... |
So I am trying to do some further tests on a 2nd-order code Incompressible Navier Stokes equations, by studying transition to turbulence in a Poiseuille flow. Specifically, I'm interested to see whether the code is energy-conserving by modelling a 3D TS wave in a Poiseuille flow. Note that I have tested the code for a ... |
My friend in the statistics department asked me how to do the following calculation efficiently.
Suppose we have data $X\in\mathbb{R}^{N\times 2}$. He needs to do the following calculation:
$$C_{i,j}=\sigma^2\exp\left(-\frac{||X_i-X_j||_2}{\theta}\right)$$
where $X_i$ is a tuple with two elements and $\sigma,\theta$ ar... |
I am solving the following biconvex problem:
$$\min_{x,y} f(y)$$
$$s.t. ~~ g(x) \leq 0$$
$$~~~~~h(x,y) = 0$$
$$x \in X, y \in Y$$
where $X$ and $Y$ are compact convex sets, $g(x)$ and $f(y)$ are convex and $h(x,y)$ is affine for fixed $x$ or $y$.
I wonder if there is any efficient algorithm to solve this type of optim... |
ReLU activation is defined as follows
$$\sigma(x)=\max(0, x).$$
Let's assume that I have deep network of 1 hidden layer, than output from my layer has form
$$ f(x)= \sigma(Wx +b), $$
where matrix W represents the weights, b is bias and x stands for input data (output of previous layer).
What is connection between $f(... |
I wanted to test the numerical accuracy of my program. For that I wanted to interpolate the function $$f=I_0\exp\left(-100x^2\right)\exp(-100y^2)$$ onto a grid, defined on $$\Omega=[0,1]^2$$ by using the equation $$u=f$$ and the continuous galerkin method.
In addition I compared the result with the expected (interpolat... |
Reading ARPACK documentation, I see that ARPACK will return an "orthogonal basis for the invariant subspace corresponding to the eigenvalues in D" if eigenvectors are not requested. Can this subspace be exploited in some kind of restart capacity? Documentation discusses restarts but I'm not sure how these have been imp... |
Assume I have a system of at least (but generally only) $N+1$ points in an $N$-dimensional space ($N > 3$ is possible). At each of these points $x_i, i=1,...,N+1$ I know an initial potential/concentration/quantity $P_i$. I can evaluate the possible connections between all points. I also have an isotropic diffusion coef... |
Please note: this question is not a duplicate of this question since, while the PDE is the same, the nature of this question is different, i.e. the other question treats a different aspect of this PDE.
Here is the PDE system I am working with:
$$\partial_tu = \nabla \cdot (a(x)\nabla u)-\beta(x)u\\
\partial_nu=0, x \in... |
The PDE I am working with:
$$\partial_tu = \nabla \cdot (a(x)\nabla u)-\beta(x)u\\
\partial_nu=0, x \in \Omega \subset \mathbb{R}^2\\
\beta(x)>0$$
Integrate the PDE:
$$\int_\Omega \partial_t u=\int_\Omega \nabla\cdot (a(x)\nabla u)dx-\int_\Omega \beta(x)udx$$
Apply the Divergence theorem:
$$\int_\Omega \partial_t u... |
With a truncated Whitaker-Shannon series (cardinal series)
$$
f(t) = \sum_{j = 0}^{n-1} y_{j} \frac{\sin\left(\pi( \frac{t-t_0}{h} -j)\right)}{\pi\left(\frac{t-t_0}{h}-j\right)}
$$
we can naively evaluate the sum by repeated calls to sinc routines, such as the following code does:
Real naive_sum(Real t) const {
... |
I'm wondering if someone could help me out, or point me in a direction of how I can understand the following oscillations that occur when I solve the Porous Medium Equation $$u_t = u_{xx}^{m+1}$$ using FTCS method. The following plots occur for a the following initial condition
$$
f(x) =
\begin{cases}
1 & \text{if}\ |... |
First Part: (First-order derivative)
Assuming $f$ is an infinitely differential function everywhere, the Taylor series of $f(x + h)$ at $x$ is
\begin{align}\tag{1}
f(x + h) = f(x) + hf'(x) + \frac{1}{2}h^2f''(\xi)
\end{align}
where $\xi$ is a number between $x$ and $x+h$.
After rearrangment of terms in (1), we can wri... |
I am currently trying to solve some PDEs with FiPy. At page 56, the manual mentions (https://www.ctcms.nist.gov/fipy/download/fipy-3.0.pdf).
The largest stable timestep that can be taken for this explicit 1D diffusion problem is $∆t ≤ ∆x^ 2/(2D)$.
A few questions that might appear basic but I'm having a really hard t... |
Now I have wave functions $\psi_a$ and $\psi_b$ of two states in Gaussian CUBE format. I'd like to evaluate the transition dipole moment integral $\pmb\mu$ between these two states. As my simulation cell is cubic periodic with length of $L$, I will need the Berry phase formula to calculate $\pmb\mu$:
$$\pmb\mu= \rm{IMA... |
I have a 32 cores machine, and I need to run 16 different dynamics simulations in parallel on it. I want the 16 jobs to run in parallel, not sequentially, on the same machine. The 16 dynamics input are in different folders and they requires the same time to complete.
pbs script:
#!/bin/bash -l
#PBS -l nodes=...:ppn=3... |
I currently have 2 different functions with options to vectorise them: acc_rej_sine(max_iter, algorithm=None) and analytical_sine(max_iter, algorithm=None) for which I'm trying to compare their run time against the number of iterations computed. i.e. compare all 4 methods; 2 looped, 2 vectorised. Essentially my code go... |
Consider the advection equation (1D in space)
$$
\frac{\partial u}{\partial t} + V\, \frac{\partial u}{\partial x}=0
$$
and we solve it numerically on $[0,1]\times [0,1]\ni (t,x)$ using a forward scheme in time and a backward decentered in space.
This scheme is of order $1$ in space and of order $1$ in time and is sta... |
I am trying to implement a routine to solve a differential equation in Python. Basically the kind of equation that I am interested in solving is of the form:
$$\displaystyle \frac{d}{dx^2} \left(x y(x) \right) = 2 x ((U(x)-a) y(x)+ 2 b y(x)^3)$$
where $a$ is an unknown constant and $b$ is a known constant and $U(x)$ is... |
I'm looking for current references on solving stiff ODEs. Most of what I know (say, BDF methods) apparently date back to the 1980's, and I feel like a lot of progress should have been made in that time, but I'm having trouble finding the "right" search terms to get what I need. What are the (current) best methods for s... |
I was trying to implement the algorithm from the paper "Adapting a Fourier pseudospectral method to Dirichlet boundary conditions for Rayleigh–Benard convection".
I am having a hard time to understand the way the boundary conditions are imposed.
The author rewrites the no-slip (on upper and lower boundaries) boundar... |
I have heard of space-time finite element methods. Although I was able to find some articles that describe the different possible methods from a mathematical point of view (thanks to Space-time finite element discretization for time-dependent PDEs for instance), I would like to know with more detail what are the main a... |
I have a system of 10 ordinary differential equations of the form,
$$\frac{dy_1}{dt} = f1(V1,k1,y1,y2)\\
\vdots \\
\frac{dy_{10}}{dt} = f_{10}(V_{10},k_{10},y_{9},y_{10})
$$
I want to estimate the parameters $V_1 ,V_6,V_7,V_{10}$ using a global fit.
From the approaches suggested in the literature, I understand least-s... |
I’d like to solve the below equation for the unknown $T$:
$$\int_0^\infty \frac{x^2}{\exp\left(\frac{x}{T}\right)-1}\kappa_x \mathrm{d}x = C,$$
where $C$ is a known constant and $\kappa_x$ is some function of $x$, although the actual function is unknown – all I have as an array of values of $\kappa$ over different valu... |
I have a $200 \times 200$ matrix representing the values taken by a function over an equally spaced grid. I would like to perform derivatives on it.
I am interested in its gradient (i.e. its derivative in direction $x$ and its derivative in direction $y$) and in its Laplacian.
I work on the Matlab platform, where I u... |
I have a cost function with 2 parameters. The variables are dependent on each other. So, if I just take a partial derivative with respect to one variable the slope is in terms of the other variable and vice-versa. So, how can I compute the optimal values for these variables that minimize my cost function?
|
I have a bunch of data points in 3D that lie along a few planes. What would be the best approaches to estimate the normals of these planes?
Edit: There are roughly equal number of points lying along each plane. All the planes contain the origin (0,0,0).
|
Let $A$ be an $3\times N$ matrix (where $N$ is large) with nonnegative real entries. I'd like an algorithm for determining when a vector $v\in\Bbb R^3$ can be written as $Aw$ for some vector $w\in\Bbb R^N$ with each entry of $w$ in the range $[0,1]$. In other words I'd like to find the image of the unit hypercube in $\... |
The theta-method is a popular solution for solving time-transient PDEs (or ODEs), which consists of solving the general equation for each time step:
$$
\frac{u^{n+1} - u^{n}}{\Delta t} + (\theta f(u^{n+1}, t^{n+1}) + (1-\theta)f(u^{n}, t^{n})) = 0
$$
Some values of $\theta$ are often use and their pros and cons are wel... |
Solve the following minimization problem in $\mathbf{X} \in \mathbb{R}^{m \times n}$
$$\begin{array}{ll} \text{minimize} & \frac 12 \| \mathbf{X}\mathbf{X}^T -\mathbf{A} \|^2_\mathcal{F}\\ \text{subject to} & \mathbf{X}^T \mathbf{X} = \mathbf{I}_n\end{array}$$
where $\mathbf{I}_n$ is the $n \times n$ identity matrix, $... |
I wrote a Lattice Boltzmann Solver in Rust a little while back using both the BGK approximation and the TRT (two relaxation time) method on the D2Q9 lattice. In both cases I run into major stability problems even in simple examples. Here is a video of the output from the simulation of a left-to-right flow with a cylind... |
From the inviscid Burgers' equation: $\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x} = 0$, I get the discretization $\frac{u_i^{n+1}-u_i^n}{\Delta t}+\frac{(u_i^{n+1})^2-(u_{i-1}^n)^2}{\Delta x}=0$. Having the starting conditions $u_0(x)=sin(\pi x)$, $x\in[0,1]$, I wish to plot $u$ after $n$ timesteps. Ho... |
In many CFD text books, usually there is a dedicated chapter for advection term discretization.
Why discretization of such term in advection-dominated problems and near the discontinuities is challenging? I need some mathematical reasoning
And how this is linked to the problem of boundedness and numerical diffusion? ... |
In particular, if Euler's method is implemented on a computer, what's the minimum step size that can be used before rounding errors cause the Euler approximations to become completely unreliable?
I presume it's when step size reaches the machine epsilon? E.g. if machine epsilon is e-16, then once step size is roughly e... |
I'm running a simulation, and some linear solvers are returning a message of ill-conditioned matrix.
Hence, I'm looking for a fast, easy to implement, method to detect if a matrix is ill-conditioned, before using the linear solver. And in case it's ill-conditioned, what's good way to make it well-conditioned?
|
I would like to make a visualization with ParaView for a paper. In order to have a high quality look, I would like the image to be, say, 300 dpi (or vector graphics). Moreover, since I know the column width of the paper, I'd like to somehow specify that width in ParaView so I can adjust the size of the visualization, c... |
Problem
I want to convert the general second order linear PDE problem
\begin{align}
\begin{cases}
a(x,y)\frac{\partial^2 u}{\partial x^2}+b(x,y) \frac{\partial^2 u}{\partial y^2} +c(x,y)\frac{\partial^2 u}{\partial x \partial y}\\+d(x,y)\frac{\partial u}{\partial x}+e(x,y)\frac{\partial u}{\partial y}+f(x,y)u=g(x,... |
Can you tell me these equations come from where in MATLAB fmincg.m?
A = 6*(f2-f3)/z3+3*(d2+d3); % cubic fit
B = 3*(f3-f2)-z3*(d3+2*d2);
z2 = (sqrt(B*B-A*d2*z3*z3)-B)/A;
It is either cubic extrapolation or interpolation.
I have looked for these equations in many websites and books of numerical optimization but but I d... |
Our data set has $10^4$ data points, but has a long baseline and many gaps. As the histogram shows, the horizontal-axis is time and most of the time, there are no data. The vertical-axis is data counts. The total time is, in fact, short (green lines), but gaps make the time baseline very long.
If we bin the data, ther... |
In our assignment, we are required to find the energies of the ground state and the first two excited states of the Schrödinger equation in a harmonic potential:
$$V = \frac{50 x^2}{(10^{-11})^2}\, .$$
I have the Python code for solving Schrödinger equation using secant Runge Kutta method:
import numpy as np
m = 9.109... |
I have an integer linear programming problem of the form:
$$\DeclareMathOperator{\tr}{tr} \min \tr WX$$ subject to:
$$\begin{align}
\sum_j X_{ij} < c_i && \forall i \\
\sum_i X_{ij} = 1 && \forall j \\
X_{ij} \in \{0,1\} && \forall i,j
\end{align}$$
I'm sure this is probably a common problem that's been well studied, b... |
I have a $q$-dimensional grid, known at run, not compile-time, that has $50$ points in each direction and hence $50^3$ combinations that I would like to first build and then call a function with each point as its single argument, to store the output in a data structure that has a pointer to the argument.
Is there a goo... |
I am currently doing a computational physics homework which asked us to use leapfrog to give the relations between timevelocities and time-distance of these two objects.
The full question is as follows:
Consider two parallel wire with distance d. A negative charged object(m1) is moving along the wire with initial velo... |
I'm going to be doing some weak scaling of an $N$-body integrator on AWS. In the past when I've done weak scaling for this integrator I've fixed the number of particles per core ($N/n = {\rm const}$).
However, when I do this I get a weak scaling that is proportional to $n^\alpha$ where $n$ is the number of cores, whic... |
I am trying to solve numerically (obviously) inviscid Burgers' equation with the finite difference method. The equation is the following:
$$ \displaystyle \partial_t u + u \, \partial_x u = 0 $$
which also reads
$$ \displaystyle \partial_t u + \frac{1}{2} \partial_x u^2 = 0$$
And since the discrete solution is positiv... |
My task is to solve $$\eta_k\frac{d^2C_k}{dz}(z)=-e_k, k = 1,2,3$$
$$C_k\ge0$$
$$C_1(0)=0, C_2(0)=A, C_3(0)=0$$
$$C_1(L)=B, \frac{dC_2}{dz}(L)=0, \frac{dC_3}{dz}(L)=0$$
with $$e_1 = -\beta_1-\beta_3$$
$$e_2=-\beta_1-\beta_2$$
$$e_3=\beta_2-\beta_3$$
satisfying the constraints $$-e_k\le \frac{\eta_kC_k}{K_k+C_k}$$ where... |
I'm trying to re-solve the governing equations in hydraulic fracturing modeling as instructed step by step in a paper.
After (A-9), the author stated that by substituting A-6, A-8 and A-9 into equation A-4 we obtain a linear tridiagonal system which is easily solved for $∆W_i^m$ at m =1, 2,… Could anyone please help me... |
I have a diffusion problem with an internal circular dirichlet constraint and a side condition which shall enforce a certain global volume integral.
$\nabla(D \nabla u(x)) = 0$
outer boundary constraint:
$u(x) = 0 ~~\forall~x~\in \partial\Omega$
inner boundary constraint:
$u(x) = 1 ~~\forall~x~\in \Omega_{int}$
$\int_{... |
I am looking for the most efficient way to plot a mesh using Matplotlib given the following information, coordinates of each node, what nodes belong to each element, and the value each node has. Below I have some example data and image showing what the mesh looks like
nodeinfo=[[0.000,0.000],[1.000,0.000],[2.000,0.50... |
I have to solve a set of nonlinear optimization problems in the subspace defined as the orthogonal space to a given vector.
More precisely,
$$
\arg\min f(\vec x) \qquad \text{with} \qquad \vec x \cdot \vec n =0
$$
I am thinking of applying the nonlinear conjugate gradient method projecting the direction of descent ... |
I'm currently trying to solve a problem using numerical methods. The set-up is rather long, so I apologize in advance...
TL;DR: My solutions change depending on how big my steps are and I don't know why.
Set-up
The first part of this problem can be described by a Lagrangian $L(s,\theta)$, which is given by
$$L = \fra... |
Given a singular matrix $A$, what is the fastest method to find a single non-zero solution to $Ax=0$?
Note that we are not looking for the whole kernel, we just want any non-zero vector in it. I know we can use SVD to find eigenvectors, but that seems much too complicated.
|
Consider the continuity equation
$$
\partial_t \rho(x,t) + \operatorname{div} (b(x,t) \rho(x,t)) = 0, \qquad t \in [0,T], \quad x \in \mathbb R^N,
$$
with $b \in L^1((0,T), W^{1,p}(\mathbb R^N))$.
Have any numerical methods been used to approximate the (unique renormalized) distributional solution of this problem? C... |
Consider the explicit midpoint method, i.e
$$y_{n+1}-y_{n-1} = 2hf(y_n).$$
I'm asked to apply this method to the linear test equation, $f(y_n) = \lambda y_n,$ in order to find the method's stability region.
So I have
$$y_{n+1}-y_{n-1} = 2h\lambda y_n.$$
In the problems I've done before I wouldn't have the $y_{n-1}$ t... |
I try to solve numerically the following PDE for $E(r, z)$ with a cylindrical symmetrie (i. e. $E(r, z) = E(-r, z)$).
$\frac{\partial E}{\partial z} = \frac{i}{2k} \Delta E + \mathcal{N}(E)$
Where $\Delta$ is the Laplace operator in transversal direction and $k$ a real number. I want to use the Crank-Nicolson scheme t... |
I have coordinates of a set of points that form a closed loop that lies in a 3D surface. I know the equation of the surface and I can calculate it's surface normal at any point. I found that for a unit speed curve $\alpha(t)$ I can calculate the geodesic curvature as
$$
\kappa_g(t) = \alpha''(t)\cdot (n(t)\times\alpha'... |
I'm currently analysing some spatial point patterns that come from some fluid dynamics simulations and I'm having some difficulty computing the structure factor, $S(\pmb{k})$, from both the positions of the points and the radial distribution function, $g(\pmb{r})$. I have been following the structure factor Wikipedia p... |
This is a follow up to my previous question posted here.
I am solving an optimization problem using fmincon in MATLAB. There are no equality constraints in my model. I want to pass ODEs as constraint to fmincon using, non-linear constraint, nlcon argument.
The function model contains odes
function dz = model(t, z, c... |
I am trying to solve the Poisson problem with Dirichlet boundary condition in 1D:
\begin{equation}
\begin{array}{rcl}
- \mu \Delta u & = & f~in~[0,1], \\
u(0) & = & 0, \\
u(1) & = & 0,
\end{array}
\end{equation}
using the FFT method.
However, I get strange results for the rate of convergence of the method, compared to ... |
I was testing the .fft package of numpy 1.16.1 in Python 3.7.2. In particular I was trying to verify that the transform resembles the analytical one for: $$f(x) = \mathrm{exp}\left[-\left(\frac{x-5}{2}\right)^{2}\right]$$
I get from Wolfram Alpha that $\hat{f} = \mathcal{F}[f]$ looks like this:
Then I tried to replica... |
The eigenvalue problem
$$\frac{d^2u}{dx^2}+2i k\frac{du}{dx}-[k^2-6\sin(x)^2]u(x)=-\mu u(x)$$
gives the first five eigenvalues with $k=0$ or $k=1$ which are $2.06$, $2.26$, $5.16$, $6.81$, and $7.74$.
And those eigenvalues I have calculated, but the corresponding eigenvector that I got did not agree with Fig.2 in th... |
If each edge of a graph $G$ is unweighted or has equal weights, then the shortest path between two nodes in that graph is the path that contains the fewest number of edges. Such a path can be obtained by BFS. Here, i consider that each weight of the edge is the minimum of the end vertices and the weight of the path is ... |
Trying to implement an adaptive step size Runge-Kutta Cash-Karp but failing with this error:
home/anaconda/lib/python3.6/site-packages/ipykernel_launcher.py:15: RuntimeWarning: divide by zero encountered in double_scalars from ipykernel import kernelapp as app
The ODE i am trying to solve (and using in the example be... |
I am working with the following differential equation:
The equation is $$x=\beta +\sqrt{2D} \xi(t)$$ where $\xi(t)$ is a white noise term, with a reflecting wall boundary conditions.
After solving the equation numerically with Euler-Maruyama method, I used the Wiener-Khinchin theorem (Using FFT) to find a numerical ... |
I am working on conductive polymer modeling and supposed to do one-dimensional diffusion model in the thickness of the polymer, however, due to the small value of thickness in micro, when I use the forward approach it leads to instability, no matter how I decrease the number of nodes.
I have to use Backward Euler to co... |
I am currently trying to segment cells from digital pathology images.
The method I use is an algorithm based on color distance. This works for most of the cases, however, when dealing with the images which cells are overstaining, then the segmentation results is pretty bad. Is there any golden-standard method in treati... |
Let us assume that we have a function, $f(A)=\text{vec}(A^{-1})^\intercal B$, dependent on $A^{-1}$. However, due to some machine-precision limitations, the programming language I'm using cannot invert $A$ even if it has $Det(A)>0$. So, I'm thinking of using a pseudo-inverse, instead.
However, I don't know if there's ... |
This is probably a long shot with such a short time, but I've been trying to get theoretical data for a project I'm working on. The project involves using a very simplified version of magnetic particle imaging to analyze fluids.
So I've written some code with some help, and I'm pretty sure all the physics is correct bu... |
Is there either a closed-form expression or fast/elegant algorithm for computing the positive root of the polynomial
$$f(x)=x^q + \beta x - \beta,$$
where $\beta>0$ and $q\geq2$? How about the $q\in\mathbb R$ case with $q\geq1$?
Note there is exactly one positive root of the function $f(x)$, since $f(0)=-\beta<0$, $\... |
I have a function which requires the return type to be a container. The problem is that I need to integrate the contents of the container as efficiently as possible and was hoping to use adaptive Gauss-Kronrod integration or something equally efficient (or better).
I was hoping to use the GNU Scientific Library quadrat... |
I want to use the Crank-Nicolson scheme to solve the equation
$$u_t = iu_{xx}+2iu$$
Here's the analysis: Suppose we make a grid, with $k = dt$ and $h = dx$, the usual notation, and also $u_j^n = u(x_j,t_n)$ . The round-off error equation for the crank-nicolson scheme for this equation is:
$$\displaystyle\frac{\epsilon... |
I have a set of data obtained for the I-V characteristics of an LED.
0.005 -0.004
0.053 -0.003
0.101 -0.003
0.153 -0.002
0.201 -0.002
0.252 -0.002
0.303 -0.004
0.354 -0.004
0.403 -0.004
0.454 -0.003
0.503 -0.003
0.554 -0.003
0.603 -0.003
0.654 -0.003
0.702 -0.003
0.753 -0.002
0.802 -0.002
0.853 -0.00... |
I have a set of data data.txt which can be fit to a Gaussian function, f(x). I want to determine the coordinates of the point of maxima (peak) from both the data given and also from the fit function f(x). How can I achieve this in gnuplot?
|
I am solving the task that is as follows:
Input: a polygon. Can be any kind of polygon without self intersections. Can be a non-convex and with holes inside.
Goal: to cover it with 2 (at least) or more parallelograms that together are equal to or contain the whole polygon. The following criteria should be met:
There i... |
In Matlab, an ILU with threshold and pivoting (ILUTP) can be passed by default as:
setup.type = 'ilutp';
[L, U] = ilu(A, setup);
Looking for an equivalent in scipy, ex:
sparse.linalg.spilu(A, options = ??)
Tried to look up how matlab does the pivot and threshold but didn't seem to find much information.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.