instruction stringlengths 43 28.1k |
|---|
I have the following expression
$$
\frac{a^{(k)}}{k!}
$$
where $a^{(k)}$ is the rising factorial. Is it better to evaluate it using floating-point arithmetic separately, that is, call a function that returns the numerator and another function that returns the denominator, and then divide? Or should I evaluate it by exp... |
I am trying to simulate a hyperbolic PDE with some control given by the following:
$$u_t(x, t) = u_x(x, t) + \theta(x) u(0, t)$$
with boundary conditions:
$$u(1, t) = U(t) = \int_0^1 k(1-y) u(y, t)dy$$
We use the finite difference scheme with initial condition $u(x, 0) = c$ with $c > 0$. $i$ is discretization in time a... |
Given two floating point numbers $a,b$ with $a > b$ and an integer $n$, what is the most accurate way to compute
$$
a^n - b^n
$$
? We can assume both $a,b$ are between 1 and 2. Lets assume both $a^n$ and $b^n$ can be represented in floating point arithmetic. If I compute the expression as written would I lose accuracy ... |
I am trying to solve the Heat equation with Robin Boundary condition:
$$ u_t(x,t) = u_{xx}(x,t), \\ u(x,0) = g(x), \\ u(0,t) + u_x(0,t) = h_0(t), \\ u(1,t) + u_x(1,t) = h_1(t)$$
for $ 0\leq x\leq1$ and $t>0$, by using twice the composition of a fourth-order compact finite difference (CFD) approximation of the first der... |
Problem Background
I'm trying to find a solution to the following passenger matching problem:
The network is represented by graph $G=(V,E)$. $V$ is the set of nodes/stations. $p_{ij}$ is the profit of traveling through an edge $(i,j)$. Let $N$ be the number of vehicles, all the vehicles have the same capacity $c$.
At e... |
I am using python API of Gmsh to generate a mesh for a rectangular domain. I am really new at this. My code looks like this,
import sys
import gmsh
gmsh.initialize()
gmsh.model.add("t1")
lc = 1e-1
gmsh.model.geo.addPoint(-1, 0, 0, lc, 1)
gmsh.model.geo.addPoint(1, 0, 0, lc, 2)
gmsh.model.geo.addPoint(1, 1, 0, lc, 3... |
I am attempting to solve differential algebraic equations using SUNDIALS with a Python interface. I am having trouble learning to actually use sundials, and cannot seem to find any tutorials online that show some python examples. Would anyone have any links?
|
I recently needed to solve a second order boundary value problem and noticed that both scipy.integrate.solve_bvp and Matlab's bvp4c and bvp5c do not seem to support the passing of known parameters to the function odefun defining $\frac{dy}{dx}$ or the residual function which determines the boundary condtions bcfun.
The... |
As is known to all, the discontinuous Galerkin method (DG) was first used to solve the equation $u_t+u_x=0$. Now I have the following system of PDEs:
$$
\begin{cases}
u_t=f(u,v,\nabla{v}),\\
\Delta{v}=0.
\end{cases}$$
I want to approach the equation $u_t=f(u,v,\nabla{v})$, where $f$ doesn't depend on $\nabla{u}$, by D... |
I was trying to solve the following equation numerically,
$$\frac{\partial P}{\partial t}+\frac{\partial}{\partial x}\left(P^{5/3}\right)=0$$
I adopted the Godunov approach for discretising the equation numerically,
$$\frac{P_{i}^{n+1}-P_{i}^{n}}{\Delta t}=-\frac{\mathcal{F}_{i+\frac{1}{2}}^{n}-\mathcal{F}_{i-\frac{1}{... |
Eliminating the half-step velocity, this algorithm may be shortend to
Why can we eliminate the half-step velocity and all the math behind the velocity Verlet to what Wikipedia shows?
|
Using GRFs, one generates samples $x \sim N(m,K)$ with arbitrary mean $m$ and covariance matrix $K$ using a scalar Gaussian generator as
$x = m + Lu$,
where $L$ is a lower triangular matrix, such that $K =L^TL$ and $u \sim N(0,I)$.
I would like to generate samples, such that the first and last elements of x has a certa... |
Can someone point me to where the Navier-Stokes equations in 2D, both compressible and incompressible are written in semi-discrete form? I'm doing reduced order modelling and I need to write them down in the form
$$
\frac{d\mathbf{x}}{dt} = f(\mathbf{x},t,\mu)
$$
Where $\mu$ is some parameter and $\mathbf{x}$ is a high... |
$$
\begin{cases}
u_t=f(u,v,\nabla{v}),\\
\Delta{[g(u)v]}=0.
\end{cases}$$
I want to solve the above PDE system by a mixed FEM, that is, $u_t=f(u,v,\nabla{v})$ by discontinuous Galerkin (DG), where $f$ doesn't depend on $\nabla{u}$, and $\Delta{[g(u)v]}=0$ by continuous Galerkin (CG). The key is that in the true soluti... |
I wish to solve an equation like the following,
$$\frac{\partial f}{\partial t}+\frac{\partial}{\partial x}\left(A(x)f\right)=S(x,t)f$$
where $A(x,f)f$ and $S(x,t)f$ are the advection and the source terms.
When I naively try to incorporate the source term while discretizing the advection part via an upwind scheme, for ... |
When we solve some boundary value problem by Finite Element Method, the appropriate system of linear equations is built, $$Ax=b.$$
Usually we use the solution x just for plugging it into some inequalities describing conditions which need to be satisfied, $$F(x)>0.$$
The solution itself does not interest us. And what if... |
I have just learned basic FEM for 2D N-S euqation, now my teacher let me to do the following problem, the document of this problem is in large fluid problem, the system of equations is listed in that page, I don't even know what is the boundary condition, could you please recommend some textbooks or papers for solving ... |
I am studying Numerical Methods for incompressible flows. part of the tasks is to model the lid driven cavity problem in 2D using the SIMPLE method.
I have been provided with Fortran code that is working solved, however is for a channel flow problem. I was informed that by modifying the boundary conditions I can conver... |
I created a simple model of cylindrical container to perform heat transfer simulation using FreeCAD for CAD modelling. I exported the model in stl format along with domain boundaries and faces. I have attached all the files here.
I have been trying to mesh the container domain. I am using cyclic blockMesh first to crea... |
I have been dealing with some conceptual flaws in my understanding of modelling, which I will elaborate herein. I am modelling conjugate heat transfer of a reciprocating fluid, which flows with velocity $u_{0} \sin(2 \pi f t)$, over a thick heated (heat input $Q$) solid of length $L$ and width $W$. I am initially model... |
For example, if I have a matrix differential equation; $\frac{\partial y}{\partial t}=A(t).y$. Here my jacobian is the A(t) matrix. But what is derivative across the column or derivative across the row as it is mentioned in 'col_deriv'?
I have tried both col_deriv=0 and col_deriv=1, but the result does not change.
|
I recently tried the isosurface extraction algorithm provided by the C++ library CGAL. This is new to me. It is based on Delaunay triangulations.
I have some experience with the marching cubes, I tried to compare these two methods but it is not easy to conclude. Regarding the speed, I have the impression that there's ... |
Let's consider two finite difference schemes for PDEs/ODEs. One is conditionally stable, the other is unconditionally stable. People always prefer unconditionally stable ones to conditionally stable ones because for the former one can take large steps. However, one needs to take small steps to get higher accuracy anyw... |
Consider the advection/transport equation in 1D with constant velocity $a(x) \equiv 1$
$$u_t(t,x) + u_x(t,x) = 0$$
on a, say, periodic domain.
On uniform grids $$ \{x_i\}_{i = 1, \dots, N}, \quad x_{i +1} - x_i = \Delta x, \forall \:i = 1, \dots N-1 $$
first order Finite Difference with Upwind approximation/Backward Fi... |
So I have implemented central finite difference method for solving the 2D heat equation. When I leave all initial and boundary conditions as 0s, but apply an input uniform across the entire space or grid, I am only noticing temperature response at the boundary. I am not sure exactly what is causing this.
The code is he... |
I have a function $f : \mathbb{R}^2 \mapsto \mathbb{R}^+$ and I wish to numerically evaluate the integral below over a finite domain $\Omega \subset \mathbb{R}^2$
$$
I = \int_\Omega e^{i k \cdot f(\mathbf{x})} \mathrm{d} \mathbf{x}
$$
where $k \in \mathbb{R}$ is a large positive real constant, for example typically $k ... |
I'm working with simulating both the heat and wave equation in 2D in a Python code. When simulating the heat equation, I learned about the CFL which I used to get a numerical stable solution.
I found CFL for the 2D wave equation as well, but my solution keeps being numerically unstable no matter how I change the time i... |
Notation:
Denote $T_{h} = \left\{K\right\}$ to be a face-conforming triangulation of a domain $\Omega$ such that $K_{i} \cap K_{j} = \emptyset$ for $i \neq j.$ Additionally, denote $\mathcal{V}_{h} = \left\{v \in L^{2}(\Omega) : v\big\lvert_{K} \in \mathcal{P}^{k}, K \in T_{h} \right\}$ to be a space of discontinuous ... |
I am searching for the most efficient algorithm to compute the Fourier series coefficients of a number of given functions $f(\theta)$
$$a_k = \int_0^{2\pi} f(\theta)\cos(k\theta) \\
b_k = \int_0^{2\pi} f(\theta)\sin(k\theta)$$
for $k \in {1,...,N}$. The functions $f(\theta)$ are continuous piecewise trigonometric funct... |
Consider a system
$$
F_i(x, y, z) = 0, \quad i = 1, 2, 3
$$
with $F_i$ monotonic w.r.t. $x, y$ and $z$.
The system 2x2 can be easily solved with alternating direction method that will find all its roots.
The problem is to find all roots of the 3x3 system with monotonic coordinate functions. Is it possible in a general ... |
I am currently using the protocol described in
https://stackoverflow.com/questions/55599950/computation-of-pseidoinverse-with-svd-in-c-using-blas-and-lapacke to compute the pseudo inverse of a matrix.
Clearly when dealing with large matrices (e.g. 10000 x 10000) the process is extremely expensive and the run becomes qu... |
I need to compute an eigendecomposition of an $n\times n$ matrix
$$
D + c vv^\top = Q\Lambda Q^\top \tag{1}
$$
in MATLAB, where $D$ is a real diagonal matrix, $c$ is a scalar, and $v$ is a real vector. As is detailed in section 5.3.3 of Demmel's Applied Numerical Linear Algebra, this can be achieved in $\mathcal{O}(n^2... |
As the title suggests, I am trying to convert the Poisson equation:
Into sfepy code that can solve the differential euqation problem numerically.
I am trying to modify the tutorial on lienar elasticity which is similar but I am just causing it to crash.
|
Is it possible to use the Numerov method to solve the Time Dependent Schrodinger Equation ($\frac{i\partial\Psi(x, y, z, t)}{\partial t} = \nabla^2\Psi(x, y, z, t) + \Psi(x, y, z, t)V(x, y, z, t)$) with a time varying potential $V(x, y, z, t)$? If so, how?
Thanks!
|
I have been following an excellent article about how to use the Crank-Nicolson method to solve the Schrodinger equation. In the article, it starts with a $V(x, y, t)$ but the potential seems to become constant later on. Am I able to recompute the potential at a new time value, take, the previous wave function, and plug... |
I am new to this thread. I am trying to do a simple exercise on solving the LLG equation. The equation reads:
$\frac{d\vec{m}}{dt} = -\gamma(\vec{m} \times\vec{H})$.
Given a normalized input state ($m_x$, $m_y$, $m_z$) = (1,1,1) and $\vec{H} = 2\vec{z}$, the expected output should preserve $m_z$ while $m_x$ and $m_y$ s... |
I have to discretize a generalized Poisson equation in 2D which is
$$\nabla\cdot(\varepsilon \nabla \phi )=-\rho$$
My problem is that here $\varepsilon$ is $2\times2$ permittivity tensor
where
$$\varepsilon = \begin{bmatrix} \varepsilon_{xx} & \varepsilon_{xy} \\ \varepsilon_{yx} & \varepsilon_{yy} \end{bmatrix}$$
Can ... |
I have the data for 3D vector field $\vec{A}$ (with components $\vec{A_1}$, $\vec{A_2}$ and $\vec{A_3}$) sampled on a 3D grid with integer indices i, j and k.
Assuming that only the third component $\vec{A_3}$ is non-zero, I have the expression for the components of curl: $\vec{B} = \nabla \times \vec{A}$ as:
B1 = -(A3... |
Problem:
I am currently trying to integrate a singular kernel function of the type
$$G(x,y)=\frac{\exp(ik||x-y||_2)}{4\pi ||x-y||_2}$$
which lies at the centre of a triangle, over this triangle. $i$ is the imaginary unit, $k$ denotes the wavenumber. There is some literature on this in the context of potential problems ... |
This question arises from my attempt to mix two different RNGs. I'd like to mix them choosing the best of the two according to the operations I need to carry out to achieve better performance. I'm restricted to use a Mersenne Twister (MT19937) RNG with any other RNG listed here:
PCG-64
PCG-64 DXSM
MT19937
Philox
SFC64... |
Does the Lanczos algorithm remain memory efficient even if the original Hermitian matrix is dense?
|
I am trying to solve $\frac{u''}{1+u'^2} - \frac{1}{2(1-u)} = 0$ subject to $u(0)=1, u(1)=0$.
If I understand how to do this properly, I first do the variable substitutions:
$u = y$, $y_1 = y; y_2 = y'$
yielding:
$$\frac{y_2'}{1+y_2^2} - \frac{1}{2(1-y_1)} = 0 \iff y'_2 = \frac{1 + y_2^2}{2(1-y_1)}$$
And the boundary c... |
Even though this method is more widely used than the simple Verlet method mentioned above, it unfortunately has an error term of O(Δt^2)
, which is two orders of magnitude worse. That said, if you want to have a simulation with many objects that depend on one another --- like a gravity simulation --- the Velocity Ver... |
I have coded a simple program for a root finding problem using Halley's method. Here is the code:
function [x,n] = root_finder_Halley(f0,f1,f2,x)
i = true;
n = 0;
while i
n = n + 1;
x(n+1) = x(n) - ( 2*f0(x(n))*f1(x(n)) )/...
( 2*f1(x(n))^2 - f0(x(n))*f2(x(n)) );
dx(n) = abs(x(n+1) - x(n));
i = dx(n) > eps(x(n+1... |
Are there MIP solvers that allow certain constraints to be toggled based on the value of a binary variable? My current situation is that I'm approximating the desired behavior by using constraints of the form $$A_{i}x\leq b_i + C\delta_{i}$$ where $x$ and $\delta$ are decision variables, $\delta_{i}\in{0,1}$, and $C$ i... |
Consider system of ordinary differential equations
$$
\begin{align}
\frac{dx}{dt}&=\sigma(y-x)\\
\frac{dy}{dt}&=\rho x-y-xz\\
\frac{dz}{dt}&=xy-\beta z
\end{align}
$$
with $\sigma=10$, $\rho=28$ and $\beta=\frac{8}{3}$ and with initial condition $(x_0,y_0,z_0)=(1.508870, -1.531271, 25.246091)$
I am trying to embed the ... |
Let's define scaling, as how linear the speedup of using more than one GPU or CPU is. For example, having 2 GPUs gives you 2x faster execution time.
I have noticed that in many software (e.g. Molecular Dynamics, Gromacs, AMBER, OPENMM), it scales very badly for more than 2 GPUs, but it is not a problem for CPUs (you ca... |
I want to numerically solve integrals of the form,
$$
I = \int_a^b x^k f(x) dx
$$
where $k$ is a given integer, and $f(x)$ is a cubic polynomial, expressed as,
$$
f(x) = c_0 + c_1 (x - a) + \frac{c_2}{2} (x-a)^2 + \frac{c_3}{6} (x-a)^3
$$
When $k \geq 0$, the integrand is a polynomial of degree $k+3$ and a standard Gau... |
I am currently coding a solution to the following PDE:
$\frac{\partial T }{\partial t} =\frac{\partial}{\partial \theta}(A(\theta ,\phi )\frac{\partial T }{\partial \theta}) +\frac{\partial }{\partial \phi}(B(\theta ,\phi )\frac{\partial T}{\partial \phi}) + F(\theta ,\phi)T$ with periodic boundary conditions in polar ... |
I want to run a block Lanczos block-tridiagonalization on a hermitian, sparse matrix (of relatively small size $\sim 10^2 \times 10^2$). However the matrix typically has many eigenvalues that are highly degenerate, and the eigenvalues are closely spaced. I only care about the invariant subspace of the initial vectors, ... |
Let a function $u \in H^1_0(\Omega)$ defined by its values at the mesh nodes. Can we compute its Laplacian using the matrix resulting from the finite elements discretization of Laplace's equation? I know this may be done using $\Delta u = \sum_i u_i \Delta \phi_i$ where $\phi_i$ are the shape functions (well defined)... |
How do I solve the following evolution equation numerically:
$$
\dot{\boldsymbol{\mathcal A}} = -\lambda A_1|\boldsymbol{s}-\boldsymbol{\alpha}|^2\left[(\boldsymbol{n}_r:\boldsymbol{\alpha})\boldsymbol{n}_r\otimes\boldsymbol{n}_r+\frac{3}{2}A_2\boldsymbol{\mathcal A}\right]
$$
Here $\boldsymbol{\mathcal A}$ is a fourth... |
Consider the following 1D problem
\begin{align*}
\begin{cases}
\displaystyle
-\frac{d^2u}{dx^2} = f(x), \hspace{0.5cm} x\in (a,b) \\[4mm]
u(a) = u_{a}, \ \ u(b) = u_{b}
\end{cases}
\end{align*}
I know how to compute a finite element approximation $u_{h}$ of this problem. I'm working in an h-adaptive method, it works f... |
I was looking at the matlab function pinv.m for the compuation of the pseudoinverse. The code uses the singular values decomposition.
$$
A = U D V
$$
When looking for non-zero diagonal elements it sets a threshold using the formula:
$$max(n,m) * eps(d_{max}) $$
where $n$ is number of rows $m$ number of columns of $A$, ... |
What are some reasons for approximating a (e.g. parabolic) PDE using the space-time method, with continuous finite elements in time, vs discontinuous finite elements in time?
Are there e.g. significant differences in accuracy, or stability/spurious oscillations...?
I'm particularly interested in a comparison taking int... |
Finite element exterior calculus helps to furnish nice stable elements for many common elliptic PDE by looking at the de Rham complex
$$\Lambda^0(\Omega) \stackrel{d_1}{\to} \Lambda^1(\Omega) \stackrel{d_2}{\to} \ldots \stackrel{d_n}{\to} \Lambda^n(\Omega)$$
where $\Lambda^k(\Omega)$ are the $k$-forms on the domain $\O... |
I am computing the following quantity:
$$
\text{lhs} := ||a+b||^2 = ||a||^2 + 2a^\top b + ||b||^2 =: \text{rhs}
$$
for $a=c-d$, where $a,b,c,d$ are $n$-vectors.
Is there a rule of thumb for when I should have my program compute $\text{lhs}$ vs $\text{rhs}$ in floating point arithmetic? It seems that if $a,b,c,d$ are al... |
This is a general question: In this blog post, the author points out that under a unitarily invariant norm, the closest symmetric matrix to the square matrix $M$ is $\frac 1 2 (M + M^T)$. The general question I have is: When might a matrix which ought to be symmetric lose symmetry? I understand generally that this may ... |
I am trying to create a sweeping surface, for which I need the frenet frame of a curve. I am trying to compute this for arbitrary curves but for testing I am just using the parametric unit half circle. i.e. $C(t) = (\cos(t), \sin(t), 0)$
I am computing my derivatives using central differences, i.e.:
pub fn frenet_trihe... |
I need to write a for loop that tests multiple values in a function until the output is a multiple of 180.
i.e. it starts the number i'm testing at zero, checks if the result is a multiple of 180 or very close to one, and if it isn't, it increases the number i'm testing by some small increment and tests again, printing... |
I am trying to learn about 2D FEM methods. I am trying to understand the generalization of Lagrange polynomial basis from 1D into 2 variable polynomials over triangle domains.
The most basic element if I understand correctly is piece Wise linearity, obtained through barycentric coordinates.
What would the quadratic ele... |
For my thesis, I have to implement the CCZ4 formalism into an existing code (I tried to type the evolution equations here but does not seem to work).
However, I can't seem to come up with a scheme to solve these equations. For instance, here, the authors give an explicit scheme on how to solve the ADM equations (see pa... |
I have an operator $H$. I express $H$ as a matrix in the orthonormalized $\{ |e > \}$ basis. Then I diagonalize it to obtain eigenvalues, let's say for example $H$ is $6 \times 6$ and the eigenvalues are $1, 5, 7, 9, 3, 8$. Now I express $H$ as a matrix in a different orthonormalized $\{ |f > \}$ basis obtained through... |
I'm learning scipy.optimize.minimize. I thought of a simple function to see how it works:
$$f(x) = x$$
With the goal to minimise $f(x)$, subject to the constraint that:
$$x \ge 0.1$$
Without the constraint, there is no solution (except in the limit $\lim_{x\to -\infty} f(x) = \infty$). But with the constraint $x \ge ... |
I want to understand the data structure of elements, elements around elements, and so on, and various other data structures in FEM, could you please recommend some books?
|
I am a beginner in computational physics but have a background in physics, math, and programming (from online courses, videos, and textbooks) and I would like to know how should I:
Approach and think of any general computational physics problem and how I might find a solution and apply it to a real-world physical expe... |
In this resource the linear (barycentric) elements are explicitly given:
The geometry placement of higher order elements is also given but not expression for the polynomial of $P_2$ is given. I am hoping someone can tell me what the 6 polynomials look like.
|
First we need to present the details of what makes that cut possible. The issue is linked to the sum of squares $1^2+2^2+3^2+4^2+...+n^2$.
We consider the two cases:
1-the case of a sum of even squares
2-the case of a sum of odd squares.
However both sums lead to practically the same result which is a cut of the number... |
I'm, in the context of FEM. Let's say I have a discrete function $g$ living on the boundary of my domain $D$. I need to compute numerically $||g||_{1/2,\partial D}$.
The definition I know is the following:
$$\iint_{\partial D \times \partial D} \frac{\vert g(x)-g(y) \vert^2}{\vert x -y \vert^2} d s_xd s_y$$
However, I'... |
I am considering to solve complexed PDE systems, like in this post, using Comsol MultiPhysics. The PDEs are different from the General Form provided by Comsol. The Weak Form module may be worth a shot.
But I am no export in FEM theory. Even if I become one after learning, there might be a distance from FEM theory to C... |
This question is a duplicate of this question that I asked on dsp stack exchange. However, nobody had the answer there but the question seems more appropriate on this forum (If not feel free to tell me, it's my first post here).
The question is the following :
I've got my state space representation
$$ \dot{X} = AX+BU $... |
I'm using a numeric root-finder to find $k$ satisfying $\|A^k x\|=c$ where $A$ is a symmetric $d\times d$ diagonal + rank-1 matrix. How to compute $A^k x$ efficiently?
For integer $k$, I can get the answer in $O(k d)$ time using iterated products.
For general $k$, can use dense eigendecomposition of $A$ in $O(d^3)$ ti... |
I've been trying to solve the following equation
$$
y(t)=-A\cdot\frac{\mathrm{d} y}{\mathrm{d} t}+B\cdot\left(\frac{\mathrm{d} y}{\mathrm{d} t}\right)^{2}+C
\\
y(t=0)=y_{0}\\
$$
where $A$, $B$, and $C$ are positive numbers. The derivative at $t=0$ is also known but not really needed. I tried to solve it using scipy.int... |
I have to solve numerically an equation of the following form:
$$
\sum_{n=0}^m c_n x^n = f(x) x^k
$$
Where the $c_n$ are real values, $k$ is an integer and $f$ can only be evaluated numerically.
The current implementation in our code is using a numerical approach (specifically using scipy.optimize.brentq) but I wondere... |
I have all the constants set to the same values for each set of code, G, the timestep, the masses of the planets etc. But using Velocity Verlet doesn't work unless I lower the gravitational constant because otherwise the gravitational pull is too high.
The code is the same for both simulations up until the actual Veloc... |
I am using Levenberg-Marquardt to solve a nonlinear least squares problem with 16 million residuals and about a million variables. I have a fast matrix vector product for both the Jacobian and its transpose, and I can also compute the norms of the columns of the Jacobian. To compute the step, I am using LSQR. This sche... |
I need to solve the differential equation:
$$u_t = \Delta u + \sin t$$
On a 2D domain with homogeneous Dirichlet boundary conditions. Tod o this I am trying to use the python package getfem.
I am struggling quite a bit trying to set things up especially the parts of $u_t$ and $\sin t$ as I am not sure how to define the... |
In my application, I have a sum of diagonal $A$ and rank-1 $B$
$$T=\underbrace{\text{diag}(1-2\alpha h+2\alpha^2 h^2)}_A + \underbrace{\alpha^2 hh^T}_B$$
Where $h$ is a vector $\in \mathbb{R}^d$ with positive entries decaying faster than $1/i$, $\alpha>0$ and $\|T\|<1$.
Can eigenvalues of $T$ be approximated faster tha... |
Following some comments from another question I wanted to ask: does an explicit method always require some sort of analytical function/solution?
Let's take Euler for example. You have a function $f$ which takes $y$ and $t$ and is equal to $y'$. But there is no "generic" or one $f$ as far as I know, you need an analytic... |
I am interested in solving this set of nonlinear couples advection-diffusion equations using a finite volume scheme:
$$
\frac{\partial f(x,y)}{\partial t}=-(\boldsymbol{u}+\nabla\eta)\cdot\nabla f +\nabla\cdot(\eta\nabla f)+s_f(g),
$$
$$
\frac{\partial g(x,y)}{\partial t}=-\nabla\cdot(\boldsymbol{u}g)+\nabla\cdot(\eta\... |
The quantity I am interested in is not the rotation rate $\Omega$, but I will use this quantity nonetheless to make the problem clearer. I am interested in a spherically-symmetric system and in the boundary condition of the rotation rate $\Omega=u/r\sin\theta$. Now, at $\theta=0$, we have an undetermined form $0/0$ and... |
I want to implement a 1D Helmholtz equation with jump condition. The domain is $x=[0,1]$ and both ends have Dirichlet boundaries($p$=0). The 1D strong formulation is;
$$c^2\nabla^2p + w^2p=0 \qquad \mathrm{in} \quad \Omega,$$
and
$$\nabla p(0)=\nabla p(1)=0 \qquad \mathrm{at} \quad \partial \Omega,$$
$$\nabla p^-(0.8)=... |
I have been reading a bit about Quantum Field Theory and Photons, I read that the equation(s) for spin 1 massless particles (photons) in Quantum Field Theory are just Maxwell's Equations described in terms of 4-vectors under a Lorenz Gauge Condition. I know about Non - Relativistic Quantum Mechanics, but I don't know m... |
I'm writing finite element code in 3D, and I wish to connect vertical (Euler-Bernoulli) beams to a horizontal plate. The deformations of a beam are well described, but for the plate it is more difficult: for in-plane deformations of the plate I use quadrilateral elements, and for out-of-plane deformations I use Kirchho... |
Let's assume the equation
$$
\nabla^2u_n(\vec{r})+a_n(\vec{r})u_n(\vec{r})=\sum_{m=1}^{N}b_{nm}u_m(\vec{r}),\quad n=1,2,\dots,N,\quad \vec{r}\in\varOmega\tag{1}\label{eq1},
$$
is to be solved for $u_n$ in a domain $\varOmega$ with
$$
\hat{e}\cdot\nabla u_n(\vec{r})=0,\quad n=1,2,\dots,N,\quad \vec{r}\in\partial\varOmeg... |
I am trying to solve the following problem nuemrically:
$$u_t = \Delta u + \sin t$$
To that effect I scanned the documentation of FreeFEM, the closest example I can find to my problem is the Thermal diffusion problem.
I am trying to modify the existing tutorial code to solve my problem instead of the one in the example... |
Let us considered the following ODEs
\begin{align*}
\dfrac{dX}{dt} = F(X), \tag{1.1}
\end{align*}
where the unknown $X\in \mathcal{D} \subset \mathbb{R}^l$ and it can be stiff. These ODEs can be solved numerically by classical Newton's method if $F$ is differentiable almost everywhere on the considered domain
\begi... |
Are there any good IDEs for working with Octave code?
I'm used to type hints and documentation preview from software like IntelliJ or VS Code. While there are syntax highlighting plugins for VSC, all that isn't quite there yet, so is there a better solution?
|
I am asking for some help on how to calculate the reynolds number for an AWES. I know the formula of Re=rhovl/viscosity. I have selected the air foil as Clark y with chord length 3.72m (which will be the characteristic length). I specifically need the values of rho, v, viscosity with changing altitude. And also if it i... |
Suppose $a_i,q_i,b_0$ are positive real numbers. I need to solve the following equation for $k$
$$\sum_i^d a_i \exp(-q_i k)=b_0$$
Is this a well-known problem? One my special cases has $a_i=q_i$
In my application $d> 20000$, $q_i\approx 0$. Wondering if equation structure makes it possible to solve faster than Newton's... |
I'm interested in extending the concept of a staggered grid (commonly used to solve the incompressible Navier-Stokes equations) to a linear stability analysis context. For example, we can consider flow within a two-dimensional rectangular duct, as in Theofilis, Duck, and Owen in the Journal of Fluid Mechanics, 2004. Th... |
I am looking for an element for FEM that is piecewise $C^1$ continuous across triangles (i.e. $C^1$ continuous on the edge separating 2 triangles of the mesh).
I have heard about the Bell element:
https://arxiv.org/pdf/1706.09017.pdf
https://defelement.com/elements/bell.html
But I am struggling finding a simple definit... |
I am trying to solve the following differential equation in the domain of $\theta \in [0, 2 \pi]$ using finite differences scheme:
For $0< \theta \leq \pi$
\begin{align}
\rho_i^{n+1}=\rho_i^{n}+D\frac{\Delta t}{\Delta\theta^2}[\rho^n_{i+1}-2\rho^n_i+\rho^n_{i-1}]-\beta \frac{\Delta t}{\Delta\theta}[\rho^n_i-\rho^n_{i-1... |
I have a file that contains the coordinates of two points that make up a line. When I plot these lines, I notice that there are areas where the lines intersect more often. These points are identified as the areas where the yellow patterns are the thinnest on the plot. To make it easier to locate these points accurately... |
I have a matrix of the form:
$M:=\begin{pmatrix}
S_1 & & & \\\ Q_1 & S_2 & & \\\ & ... & ... & \\\ & & Q_n & S_n\end{pmatrix}$
where the blocks are square. The $S_i$ are asymmetric, the $Q_i$ are symmetric and positive definite. Would you have a reference/hints for efficient solution algorithms for systems of the... |
Suppose I'm solving $Ax=b$ for dense $m\times d$ matrix $A$. For which $A$ is this hard to do?
More concretely, is there any work on estimating the error after $k$ steps of iterative solver, $k\le d$, for some specific solvers, based on properties of $A$? For random isotropic vector $x$ and large $d$, a useful property... |
I am trying to use Matlab's pdepe.m to solve the first order parabolic PDE
$$\frac{\partial u}{\partial x}+\frac{\partial u}{\partial x}=x$$
I have not had trouble coding the argument of pdepe @pdefun:
function [c,f,s] = pdefun(x,t,u,DuDx)
c = 1;
f = -u;
s = x;
end
Since this is first order in space and time, we have ... |
I'm running a test problem to set up larger problems. Solving the simple unsteady heat equation via finite differences:
$$ \frac{\partial T}{\partial t} = \alpha \frac{\partial^2T}{\partial x^2}$$
$\alpha = 0.001$
$T(x=0,t) = 60°C$
$T(x=L,t) = 25°C$
$T(x,t=0) = 25°C$
import matplotlib.pyplot as plt
import numpy as np
i... |
I have an equation that I need to calculate numerically, but I am having doubts about my approach. I am cross-posting this question from Stack Exchange, because I am not getting any responses.
This is the equation I need to program:
where $\chi$ is a volume mixing ratio in the stratosphere, $\chi_0$ is a volume mixing... |
I am trying to find a P1 Lagrange finite element solution to the following ODE:
$\begin{cases}-u''+u'+u=f~~~~~~~~\text{in}~~(0,1)\\ u(0)=1, u'(1)=0\end{cases}$
Where $f(x)=-2e^{x}+2\left(1-x\right)e^{x}+\left(1-x\right)^{2}e^{x}$.
My procedure:
First I obtained the variational formula $\sum_{i=1}^{n+1}U_ia(\phi_i,\phi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.