instruction stringlengths 43 28.1k |
|---|
Does there exists a data structure with these properties
Stores vectors in a dictionary
When given a key that is also a vector, returns the k nearest vectors using a similarity metric (e.g. Euclidean, Cosine)?
Something computationally efficient would be ideal.
|
I have an optimization problem where i need to find an image x, that is very close to x' such that:
monitor(x') is valid but monitor(x) is invalid. (output is valid
when the neural network output is inside bounds of specific box).
x is same classified as x' by a neural network(their prediction class is the same).
N... |
I have managed to write the following code for the following problem:
Projectile's horizontal and vertical displacement are given by:
$$ x = v_0 \, t \cos(\theta) $$
$$ y = v_0 \, t \sin(\theta) - \frac{1}{2}gt^2$$
Consider the time interval to be $t \in [0, 60] seconds$.
Write a Python code to plot horizontal and max... |
I am trying to solve the following coupled partial differential equations with a finite difference scheme:
$$\partial_tf+v\partial_zf+\partial_z\frac{1}{W}\partial_zf=0$$
$$\partial_tW+v\partial_zW-\partial_zf=0,$$
where both f and W depend on t and z.
In order to solve both equations simultaneously I am trying to use ... |
I'm trying to compare the simulation time for solving a system of differential equations with and without jacobian pattern for a toy model using ode15s in MATLAB.
global mat1 mat2
mat1=[
1 -2 1 0 0 0 0 0 0 0;
0 1 -2 1 0 0 0 0 0 0;
... |
This is a follow up to my previous question posted here
I'm trying to construct the sparsity pattern of the jacobian matrix to speed up the computation of a large system of odes. The following is the code in which I am trying to set up the jpattern in
odeset for a toy model in MATLAB.
global mat1 mat2
mat1=[
1 ... |
I'm currently trying to implement my own FVM code in cpp, but when I try to calculate the laplacian of a test function, given by
\begin{align}\phi_0=\sin(2\pi x)\sin(2\pi y),\end{align}
I get unphysical boundary values as seen in the figure. I used a Dirichlet boundary condition with 0 value on every boundary.
My code ... |
When modeling boundary layers, it is typically required to have a highly refined mesh along the boundary. My question is if there has been success with high order finite element methods to overcome the need for highly refined meshes. Can a high order basis function of a finite element successfully capture the steep gra... |
Assume I have a multidimensional grid $G$. I consider two functions $f(x)$ and $g(x)$. I have solved the values for the functions over all grid points $x \in G$. Let me now be interested in some third function $F(f(x),g(x))$. I am looking to evaluate $F$ at a point $y$ that is not a grid point using interpolation.
Ther... |
I've read an article (Long-term integrations and stability of planetary orbits in our Solar system) in which the authors solved the problem of the absence of an analytical solution for the solar system planetary dinamics by making a very accurate solution. They called it a "pseudo-exact solution". They then used this s... |
In this document they describe their code as an integrated modelling tool. I am trying to understand how this is different from a regular modelling tool? Most codes include different modules that do different tasks, but I have never heard anyone refer to this as an integrated code. What does a code have to do to become... |
This is a follow up to my previous question posted here.
I've set up an ode system in MATLAB and I'm trying to vectorize the code to increase the speed of computation.
The follow is the code for my toy model.
global mat1 mat2 k
k = 2;
mat1=[
1 -2 1 0 0 0 0 0 0 0;
0 ... |
I have a geometry where current density distribution is constant. I can calculate the $z$ component of magnetic flux density according to Biot-Savart law as following:
$$B_z(x,y,z) = \int\limits_x\int\limits_y\int\limits_z
\frac{(y-y')J_x(x',y',z')-(x-x')J_y(x',y',z')}{((x-x')^2+(y-y')^2+(z-z')^2)^{\frac{3}{2}}}dx'dy'd... |
I am looking for FOSS code that can generate self-avoiding random walk trajectories on a tetrahedral lattice. The purpose of the exercise is to create random conformations of model polymer chains that serve as input to a simulation protocol. It would be nice if the code satisfied the following criteria:
Implemented in... |
I want to solve a diffusion analysis using finite elements. According to fick's law, governing equation is
$$\frac{\partial h}{\partial t} = D \frac{\partial^{2} h}{\partial x^{2}}$$
. h is relative humidity and D is moisture diffusion coefficient and it is relative humidity dependence.
$$D = 2.26 \times 10^{-6} \Bigg ... |
Does non-dimensionalizing ODEs affect the stiffness of the equations? Can it improve the stability of numerical methods like ode45,ode113 in MATLAB?
I am trying to solve 2 eqns. which might involve very tiny step size to get stability like 1e-11. I want to improve the speed of the numerical method. Can non dimensionali... |
I'd like to know the length made by the intersection curve of two orthogonal cylinders of different radii a and b where a > b >0.
I came across this post that provides a solution with an elliptical integral:
https://math.stackexchange.com/questions/1340318/arclength-of-intersection-between-2-perpendicular-cylinders
My ... |
I am using CVXOPT, particularly to solve a nonlinear convex optimization problem. Either the objective function or the constraints involve some functions that are only defined in a strict subset of $\mathbf R^n$. For example, the function is the logarithm $\ln$. It seems that the package may well use symmetric primal d... |
I'm looking for introductory resources--web pages, book chapters, articles--that introduce the C language with an immediate focus on bit-twiddling functions (e.g. bitwise XOR, AND, shifts), and of course branching and looping, but with very little discussion of large scale program structure (e.g. header files), pointer... |
I'm trying to do an experiment concerning various data-storage formats. I'd like to run an open-source compression benchmark that demonstrates storage format A allows for FASTER compression than format B. However all the open-source benchmarks I find only focus on compression ratio which I'm not interested. Does anyone... |
I do need to numerically calculate the following forms for any $x\in\mathbb{R}^n$, possibly in python:
$x^T M^k x$, where $M\in\mathbb{R^{n\times n}}$ is a PSD sparse matrix, $n$ can be quite large in the orders of $10^3$ or higher, and where $k$ can get large values $-$possibly up to order of hundreds. I prefer $k$ ... |
I have a blackbox function that (for the purposes of this question) looks like $3+\cos(x) + 0.005/(x-a)$. The location of this $a$ is unknown (but within $0\to2\pi$). (The $3+\cos(x)$ is just a (bad) approximation.) I need to find the roots of this function. Unfortunately the functional form is too complicated to be an... |
I have solved the 2D Poisson equation using finite element method with simplex triangular element in MATLAB.
First, I generated the triangular mesh using pdetool in Matlab and it gives me three matrices: p (position of each node), t (element with three vertices) and e. Then, I derived the local stiffness matrix like th... |
I'm a master student with a good Numerical analysis background. I'm going to do a master thesis in the same subject, but I need to use C++ since my advisor loves it, and I also believe it's the best programming language to have full control on what's going on in numerics.
I think I have a good background in C++, I impl... |
I'm trying to evaluate the perturbations magnitude between 2 body orbiting a central one in three dimensions. In order to do this I need to have an estimate of the error, which I did using Richardson extrapolation as described here. I'm using Runge-Kutta 4 and also velocity Verlet. Things seems good in the unperturbed ... |
I asked this question a few days ago on stackoverflow, but I figure scicomp.stackexchange is probably a better place. Sorry for the double post.
I want to solve a system of nonlinear equations using scipy.root. For performance reason, I want to provide the jacobian of the system using a LinearOperator. However, I canno... |
I need to solve many very large systems of first order ODEs, which describe some chemical reactions. The number of variables (in each system) is on the order of $n \sim 10^5$. I am using ALGLIB vector ODE solver, which under the hood implements Cash-Karp adaptive ODE solver.
Chemical equations are often considered as s... |
I have just begun learning computer science to apply it to Physics and I am trying to write a code for solving Schrödinger's equation of the harmonic oscillator (setting $V=\frac{x^2}{2}$) in one dimension.
I know the basics of how to do this, but I would like to know whether some resources are available, or if someone... |
I was asked this open ended question in an interview once:
How would you find a solution to the normal equations with limited memory?
Unlike Solving sparse least squares system with limited memory, the matrix $A$ is not necessarily sparse. It could be dense.
The question was asked in a machine learning / stats contex... |
I am an intermediate user of Matlab and Mathematica, but I would really love to start learning Python language for scientific purposes (I am interested in Maths and Physics).
Could please someone recommend me a book for learning scientific Python (the best would be a book inclusing also some codes to be able to put di... |
Let's consider the usual Poisson problem for FEM $$-u''(x)=1 \quad x \in [0,1]$$ with homogeneous Dirichlet boundary conditions. The solution is $u(x)=-\frac{1}{2}x(x-1)$
I know that the FEM solution (I'm assuming linear elements) is exact at nodes, as noted also here
I implemented my code with constant step size $h$. ... |
I'm trying to draw the bifurcation diagram of the following ODE,
This ODE leads to a saddle-node bifurcation (see wiki)
However what I get is not exactly right. There's a lot of "noise" as you can see on the figure below.
Normally there should be the blue line (stable line) that goes from bottow left unto intersectio... |
I have output from a 3D linear elasticity finite element simulation which uses linear tetrahedral elements, such that the displacement is continuous over the nodes but the gradient is not ($C_0$ continuous). I wish to "upgrade" the displacement data so that it can be reported as a $C_1$ continuous quantity which I can ... |
I saw many stopping criteria for Newton's method all around Web and books.
Some are defined from the residuals:
of either current iteration only:
$$
\|f(\mathbf{x}^{(k)})\| \leq \epsilon
$$
(https://fr.wikipedia.org/wiki/M%C3%A9thode_de_Newton#Crit%C3%A8re_d'arr%C3%AAt)
or of current and previous iterations, mixing ... |
Lagrange elements of any polynomial describe piecewise continuous functions. Typically, those functions are differentiable.
Mixed finite element methods use vector fields of even less continuity, such as normal continuity. With some great oversimplication, one might argue that discontinuous Galerkin methods, hybridized... |
I am a novice getting my toes wet in continuum mechanics and nonlinear elasticity. I have seen papers that use both approaches in developing constitutive connections to compliment balance equations of various sorts. My question is the energy inequality more general than the virtual work approach? I am tackling a visco-... |
I am learning Finite Volume method using the textbook "An Introduction to CFD: Finite Volume Method" by Veersteg and Malalasekera.
I would like to solve a heat conduction problem over a square grid $0.5m$ in length with all the boundaries maintained at $0°C$. For that, I need to discretize the Poisson equation:
$$ \fr... |
I solved Schrödinger equation for a following tow-level time-dependent Hamiltonian numerically in two ways:
import numpy as np
def H(t):
return np.array([[t,0.5],[0.5,-t]],dtype="complex64")
First, the state is treated as wave vector:
from scipy.integrate import solve_ivp
def schrodinger(t, X):
dXdt = -1j * H... |
I have a list of vertices and faces. Now, I want to create a mesh using the given points and faces list and visualize it. Also, I want to play with the mesh by adding an extra point on the faces. Can anybody guide me on how to do this using matlab? Any function name or guide would be helpful. I found a way to create a ... |
Here is the output of Numpy
np.fft.ifft([0, 4, 0, 0])
array([ 1.+0.j, 0.+1.j, -1.+0.j, 0.-1.j]) # may vary
Here is the output of Matlab
res = fft([0, 4, 0, 0])
res =
4.0000 + 0.0000i 0.0000 - 4.0000i -4.0000 + 0.0000i 0.0000 + 4.0000i
ifft(res)
ans =
0 4 0 0
What is the reason behind d... |
I have a simple triangulation for a 2D domain, described by the connectivity matrix $T$ and by the point matrix $P$.
For didactic purposes, I assembled the stiffness matrix for $-\Delta u = f$ by using the reference triangle. With $\mathbb{P}1$ basis functions everything is easy because all the gradients are constant t... |
I am trying to use finite element method to discretize the following problem
\begin{align}
\min_{u \in H^1_0(\Omega)} \int \| \Delta u(x) - 0.5*[u(x) + \langle e, x \rangle + 1]^3 \|^2_2 \ d\Omega,
\end{align}
where e is the vectors of ones.
The solution $u$ is scalar-valued.
It is not clear to me, how should one handl... |
I'm solving the simple Poisson problem $$-u''(x)=1$$ in the interval $[0,1]$ with $u(0)=u(1)=0$.
I discretised my domain as done here, i.e. with
nodes = [0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0]
and
elements = [[0, 1, 2], [2, 3, 4], [4, 5, 6], [6, 7, 8]]
I'm trying to assemble the matrix and the r.h.s by lo... |
For solving PDE with self written code it is needed to preprocess the data from mesh generators. I recently started shifting from cartesian grid to unstructured.
I finished reading up to FVM part of the book by the author - S.Mazumder, suggests extracting the following information:
Geometry-related information:
• Whe... |
The absolute error criterion of the pathwise approximation of an Ito process $X$ by an Euler approximation $Y$ is:
$$
\epsilon=E\left(\left|X_{T}-Y(T)\right|\right)
$$
We shall say that a time-discrete approximation $Y^{\delta}$ (with $\delta$ the step size) converges strongly with order $\gamma>0$ at time $T$ if there... |
I have been trying to write a program that analyses EM wave scattering by a dielectric sphere for a project.
The reference is Sadiku's book Numerical Methods in electromagnetics Edition 3.
Now the book has code in Matlab but I have to use Python.
I rewrote the code in Python and ran it, but the values Ey/Einc and Ez/Ei... |
I need to find the temperature distribution of a square plate using the Laplace equation by using FDM:
$$ \frac{d^2T}{dx^2} + \frac{d^2T}{dy^2} = 0$$
But there is a heat flux entering from the top boundary $q = 10^5 W/m^2$. How do I incorporate this heat flux into the problem? Should I:
Add it as a boundary condition ... |
Can anyone please suggest some libraries which allow use CUDA in Python for numerical integration and/or solving of differential equations?
My goal is to solve large (~1000 equations) of coupled non-linear ordinary differential equations and I would like to use CUDA for it.
|
I have a function $c ( I (\vec{r}) )$. Not a constant, $c$ doesn't denote a constant. So $c$ is a function of $I$ which is a function of $\vec{r}$. $I$ is an intensity (W/cm2).
This $c$ is hard to sample and I have sampled it for 10,000 values of $I$.
I need to integrate $c$ across all the space, i.e. a 3Dimensional in... |
I am currently trying to implement Source Panel method as described in Katz and Plotkin in Low Speed Aerodynamics. I have successfully implemented two previous methods. However, I am fully blocked on the source panel method in implementing the SOR2DC function as is called in the book in section 11.2.1.
Theta 1 and The... |
given the following system:
$$\frac{dP}{dt} = \alpha P(1-\frac{P}{K}) - \beta P I$$
$$\frac{dI}{dt} = \beta P I - \rho I$$
how do I solve the system numerically. as when I attempt to solve this is the error I get.
/home/gideon/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:19: RuntimeWarning: >divide by z... |
I have found the following PDE problem in a paper:
Essentially, we have a rectangular domain where there is a unknown interface $z=\xi(x)$ (liquid-air interface) separating the domain into two medium (air on top for $i=a$ and liquid at the bottom for $i=b$). We need to solve Laplace equation (3) subject to Dirichlet B... |
I am solving the poisson equation and I constructed the global stiffness matrix in compressed row storage format. Then I wrote the preconditioned conjugate gradient solver for solving the system of equations. Now my problem is how I can apply the boundary condition when I have the global stiffness matrix in csr format.... |
I'm currenly working on my own PDE solver for non-linear simulations in python. I've done succesfully simulations for KdV and Fisher's equation, but now I'm playing with second order derivatives in time.
The equation I'm using is 1D wave equation, with $\Delta x = 0.5$ and $\Delta t = 0.01$. For simplicity I'm using $c... |
I have tried in different ways to see what happens to voltage V and gating conductances m, n and h when, at time step x, current I switched from 0 to 0.1, and then at time step x + n it gets back to 0.
This code that I'm posting works: I integrate in chunks, as many as I define at the beginning, and depending on the nu... |
A few Computational Fluid Dynamics (CFD) codes implement the so called PISO (Pressure-Implicit with Splitting of Operators) algorithm for pressure-velocity coupling.
My concern is what is actual temporal order of accuracy of the algorithm?
It probably isn't enough to discretize time-dependent term in transport equation... |
Assume we have an (at least) 2nd-order differentiable energy $f(x), x\in R^n.$ And $n$ is very big. Mathematically, I think it is impossible to find a point $\bar{x}$ where the energy cannot be decreased along its negative gradient when the gradient is not equal to zero. However, such kind of case can be occasionally f... |
I am trying to determine need for solving large scale nonsymmetric eigenvalue problems in both industry and academia.
I am interested in any kind of problem where we cannot assume that matrices are symmetric. This includes the standard eigenvalue problem, the generalized eigenvalue problem as well as the quadratic eige... |
I have been given a 4D ($x, y, v_x, v_y$) distribution function, $f(x,y,v_x, v_y)$, generated by an external code. I want to generate a set of particles from this distribution function, say 10k particles each with their own $x, y, v_x, v_y$. I want to launch these 10k particles in my own code and follow them for some t... |
Given that some of the mass lumping techniques, for example, row-sum lumping does not produce practically viable lumped mass matrices for all the element shapes, what are the techniques used for mass lumping for higher-order elements? I am particularly interested in applications in CFD.
I know that deal.ii has a tutori... |
I'm trying to integrate the following SDE system from Dekker et al. [1]
$$\begin{cases}
\frac{dx}{dt}=a_1x^3+a_2x+\phi+\zeta_x\\
\frac{dy}{dt}=b_1z+b_2(\kappa(x)-(y^2+z^2))y+\zeta_y\\
\frac{dz}{dt}=c_1y+b_2(\kappa(x)-(y^2+z^2))z+\zeta_z
\end{cases}
$$
To do that I'm using the Euler-Maruyama method which is basically a ... |
I'm having a problem with sensitivity to initial conditions in an MINLP problem with Gekko. My test case is finding $a$ and $b$ such that $\pi^a/b = \pi^2/6$. So the solution is $a=2$ and $b=6$. I set the initial values of $a$ and $b$ to $a0$ and $b0$ in the code. But i get different solutions depending on what these i... |
I am figuring out how to attack a problem (the Usadel equations of superconductivity) in which I need to solve a set of nonlinear PDEs for the fields $\{G_i (r)\}$
$$ U(G_i(r), \nabla G_i(r), \Delta(r) ) = 0\,, $$
together with a (nonlinear, algebraic) self-consistency condition
$$V({G_i (r)}, \Delta(r) ) = 0\,.$$
The ... |
Some equations (such as the non-linear schrödinger equation for pulse propagation) are more easily solved in the spectral form, but still need a representation in the temporal domain to calculate physical parameters such as the energy of the electric field. This results usually in the following steps (with $E$ the elec... |
I used to be more of a numerical linear algebra and computational science person, but recently, I've crossed into stats and machine learning.
For this discussion, let's focus on matrices that are not theoretically singular, but "numerically singular," which is what I typically use to describe high condition number syst... |
whenever I read papers on OR that use an LP/MIP approach, they include the time solver used, as well as the version and the year. I would like to know how much faster the same experiment would be nowadays with the current advances in both hardware and software (solvers).
So for example, if an experiment was done on CPL... |
Given
with a generalization using adaptive times-stepping as
then is it still reasonable to assume that to ensure stability of the Euler’s forward method we need the growth factor for all n to be obey
|
So, I have written both a C and python code to solve the 2D Cahn-Hilliard equation:
\begin{equation}
\frac{\partial c}{\partial t} = \nabla^2\left(c^3 - c - \kappa\nabla^2c\right)
\end{equation}
Taking its Fourier transform yields the following ODE:
\begin{equation}
\frac{\partial \hat c}{\partial t} = \underbrace{-k^2... |
Im trying to solve the 1d Wave Equation on $x \in \mathbb{R}, t > 0$: $$u_{tt} = c^2u_{xx}, \hspace{5mm} u(x,0) = \cos(4 \pi x), \hspace{5mm} u_t(x,0) = 0$$ with $c = 1$ and a periodic boundary condition $$u(x,t) = u(x+1,t)$$ Im using central difference in time and space:
$$\frac{u_j^{n+1} - 2u_j^n + u_j^{n-1}}{k^2} = ... |
$$ ||I- H_{k}^{BFGS}\nabla^{2}f(x_{k})||_{2}$$
, where $H_{k}$ is the inverse of hessian approximation at each iteration.
I am given this expression to assess the error in Hessian approximation in BFGS method. I know that if the approximation of Hessian converged to the actual Hessian, then the second term would be equ... |
Suppose that we are given a time-independent quantum mechanical system whose wavefunction depends on three space coordinates. Let $F$ be the Fock operator of the system. Suppose also that we have a set of functions $f_k : \mathbb{R}^3 \to \mathbb{C}$, $k \in \mathbb{N}$, so that $$\mathrm{clos} \;\mathrm{span} \{f_k : ... |
I want to solve the system of Schrodinger-Poisson equations numerically:
\begin{align}
\chi_1''(r) + \frac{2}{r}\chi_1'(r)&=2U(r)\chi_1(r) \\
\chi_2''(r) + \frac{2}{r}\chi_2'(r)&=2\left(\frac{m_2}{m_1}\right)^2U(r)\chi_2(r) \\
U''(r)+ \frac{2}{r}U'(r) &= \chi_1^2(r) + \left(\frac{m_2}{m_1}\right)^2 \ch... |
My question relates to looping in Python.
I have an original $6$-sized vector, $F(n,t=0)=[1,0,0,0,0,0]$
Hence, the $n$-values range from $0 \rightarrow 5$.
This output for the original vector is just a series of values such as $F(0,0)=1, F(1,0) = 0$ , $F(2,0) = 0 $ etc...
This relates to a formula:
$$F(n,t+1) = -(l+(kn... |
I'm calculating basically a multidimensional random walk problem. To get more accuracy, I need larger systems (more dimensions), which requires longer time. To speed up the calculation, I'm delving into parallel computing for the first time.
I call the fortran random number generator frequently. It occurred to me... |
Background
I am working with chapter 2 in LeVeque's book: https://faculty.washington.edu/rjl/fdmbook/
I have build my own solver in Python to solve the 2 point BVP:
$$
\epsilon u''+u(u'-1) =0 , \\
u(0)=\alpha, u(1)= \beta
$$
I have followed the axact steps as described by the answer by VoB in this post:
Non-linear Boun... |
Is there a way to have an estimate of the error propagated on an ode numerical solution by the error of the initial conditions? I suppose this depend on the numerical method used and on the problem features, but is there some theorem or general treatment that could be adapted to the problem and the method used?
|
Are there some programs with packages that help to list all zero-divisors of the ring we desired? especially for the ring of Gaussian integers modulo $n$, $\mathbb{z}_n[i]$.
Also want to find which of the product of ring elements will result in 0.
I wish to get the details if any. I am new to programming languages, thi... |
Im trying to solve the following 2D wave equation: $$u_{tt} = u_{xx} + u_{yy}, \hspace{3mm} u(x,y,0) = \cos(4 \pi x) \sin(4 \pi y), \hspace{3mm} u_t(x,y,0) = 0$$ with the periodic boundary condition in both spatial directions $$u(x+1,y,t) = u(x,y,t), \hspace{3mm} u(x,y+1,t) = u(x,y,t)$$ which has analytical solution $$... |
Background
We know a function $f$ on the vertices of a regular hexagon, as follows
$$\left( 1, \ 0, \ f_{0}\right), \ \left( \frac{1}{2}, \ \frac{\sqrt{3}}{2}, \ f_{1}\right), \ \left( - \frac{1}{2}, \ \frac{\sqrt{3}}{2}, \ f_{2}\right), \ \left( -1, \ 0, \ f_{3}\right), \ \left( - \frac{1}{2}, \ - \frac{\... |
given the following ODE:
$$\frac{d^{4}w}{dx^{4}} + B\frac{d^{2}w}{dx^{2}} = 1$$
with boundary conditions $w(0) =0 , w(1) = 0,w'(0) = 0,w'(1) = 0$
its possible to solve analytically but I am attempting to solve it numerically so I can plot and see how the graph changes as I vary the parameter $B$.
in order to solve it n... |
I'm trying to estimate the percentage error in computing the integral of a Gaussian via composite trapezoidal rule versus via an exact formula. To do this I've generated a gaussian with mean 0, standard deviation $\sigma = 1$ and amplitude $A = 1$ in Python (plotted below), on a grid of $N$ points in the range $[-2\sig... |
I am studying the proof of the Arc Length method in section 2.2 of this thesis. In equation (2.2) the author introduces the supplementary conditions
$$
(\Delta {\bf u} + \delta {\bf u})^T \cdot (\Delta {\bf u} + \delta {\bf u}) + \psi^2(\Delta \lambda + \delta \lambda)^2 \cdot ({\bf q}^T \cdot {\bf q}) = \Delta L^2
$$
... |
Let's suppose I need to numerically solve a 3D steady-state transport equation of the form
$$
\nabla \cdot (\mathbf{u} c) = \nabla \cdot (D \nabla c) - \lambda c + S
$$
where $c$ is the transported quantity, $\mathbf{u}$ is a velocity field, $D$ is the diffusivity (optionally varying with position), $\lambda$ is a unif... |
I am solving a parabolic equation in the form:
$$
\left( {M \over\tau_j} + A \right) u^{j+1} = M f^j + {u^j \over \tau_j},
$$
where $A$ and $f$ are a dense stiffness matrix and the right hand side of the fractional diffusion problem from this paper:
[Acosta, Gabriel & Bersetche, Francisco & Borthagaray, Juan. (2017). A... |
I am looking for help to find a somewhat stable FD numerical scheme for the advection diffusion equation posed on a curve $(x(r),y(r))$. The equation becomes
$$u_t=\alpha(r) u_r +\beta(r) u_{rr}+f(r,t),$$
where $\alpha(r)= \phi(r)\phi'(r)+\phi(r) $, $\beta(r)=\phi(r)\phi(r)$, and $\phi(r)=\frac{1}{\sqrt{x'(r)^2+y'(r)^2... |
What available solvers are there for linear equation solver over GF(2) (Boolean), capable of dealing with large sparse systems (in the 10k - 100k variables range)?
|
I've been trying to estimate the two-parameter (a,b) Weibull distribution (loc. param. = 0).
$$f(t;a,b)=\frac{b}{a}\left(\frac{t}{a}\right)^{b-1}\exp(- \left(\frac{t}{a}\right)^b) $$
To find the estimates I am using maximum likelihood and NR method.
t = np.array(list(range(1, 1000))) #data input
def gradient(a,b):
... |
Assume solving the linear system $A \textbf x = \textbf b$, with an $A$ so large that nothing but iterative methods may be employed. Assuming $A$ induces a norm, I realized that it is often desired to minimize the residual in the norm induced by $A$ (and not, for instance, 2-norm).
Why is that the case? What is the adv... |
I'm trying to understand the Convergence of the mean part of the Step-3 tutorial in deal.II. The authors say that $\frac{1}{|\Omega|}\int_{\Omega} u_h(x)dx$ converges with $\mathcal{O}(h^2)$, but I really can't understand the following sentence:
"Again, the difference between two adjacent values goes down by about a fa... |
I am having a problem that was also mentioned at the accepted answer to this question by Wolfgang Bangerth. I need to calculate, as it was specified at the question at the link, F1 integral and for that I need to calculate u1 at gauss points of the new mesh but with a certain accuracy so I do not loose overall converge... |
I'm looking at solving systems with the FEM discretization
$$
-\int_\Omega (\Delta u) v = \int_\Omega \nabla u \cdot \nabla v - \int_\Gamma (n\cdot\nabla u) v.
$$
without applying Dirichlet- or Neumann-type boundary conditions. The resulting matrix is generally not self-adjoint (except in for 1D meshes).
The kernel con... |
Using FEM, I want to approximate the Laplacian
$$u = \nabla \cdot \nabla h \, ,$$
where $h(x,y)$ is an FEM approximated scalar field on the same mesh, i.e. piecewise differentiable.
I am using MOOSE to solve the following (hopefully correct!) weak formulation of the above equation:
$$\int_\Omega uw_i \, \text{d}\Omega ... |
I'm trying to write an integrator for the 2 and 3-body problem. I choose to start from a generalisation to N-body problem so I can just pass my bodies to the same integrator in the two cases.
I'm using Hamiltonian mechanincs, the Hamiltonian I get for the N-body problem is the following,
$$
\mathcal{H} = \sum_{i=1}^N \... |
I am recently working on the code based on the stick-slip phenomenon in Python. It's the stick-slip oscillator (chapter 3.4) in https://www.sciencedirect.com/science/article/pii/S0888327020301205.
And my aim is to achieve the plot as in the Fig. 9.
The problem is that after some calculations I keep getting the followin... |
I am interested in solving many linear systems $Ax = b$, where $A$ is symmetric positive definite and small (i.e. less than 25,000 rows) --- $b$ will be changing.
We can assume that $A$ arises from the FEM discretization of the elasticity equation in 3D on an unstructured mesh for an arbitrarily-shaped domain.
I am loo... |
I am currently trying to understand what WENO schemes are and most of the literature on web talks about cell-face reconstruction. What I am unable to understand is the origin of these discontinuities at the cell-faces. Can anyone explain where exactly does a WENO scheme come into picture and why is it used?
|
I am trying to solve the ODE :
$\frac{d^2T}{dx^2} = \omega_1 T+\omega_2 T^2$
+
using different numerical methods. I have tried the following discretizations so far and none of them seem to be grid independent:
Finite Difference Method
$\frac{T_{i+1}^k + T_{i-1}^k - 2T_i^{k+1}}{\Delta x^2} = \omega_1(T_i^2)^k+\omega_2T_... |
I am writing a project about the Finite element method for use in high-frequency solutions of Maxwell's equations. This could be for use in antenna design and similar.
I have some trouble understanding how to choose the form of the maxwells equation to solve. It seems that for high-frequency problems people use the sec... |
Briefly stated, I would like to find "all" local minima / critical points of a function.
This function comes from the discretization of a continuous problem with infinitely many degrees of freedom (dofs), but after discretization, there remains actually rather "few" dofs. Let's say, n_dof ~ 1000 - 10k.
This function (l... |
I am interested in knowing some efficient techniques for solving the following extended Saddle point problem.
\begin{align}
\begin{bmatrix}
A & B^T & C^T \\
B & 0 & 0 \\
C & 0 & 0 \\
\end{bmatrix}
\begin{Bmatrix}
x \\
y \\
z \\
\end{Bmatrix}
=
\begin{Bmatrix}
F_x \\
F_y \\
F_z \\
\end{Bmatrix}
\end{align}
x is... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.