instruction stringlengths 43 28.1k |
|---|
I'm looking for an explanation of why the jump $[\nabla u]=[u] =0$ assuming $u \in H^2(\Omega)$.
We know that according to an embedding theorem, $H^1(\Omega)$ is a subspace of $C^0(\bar{\Omega})$ (space of continuous functions in $\bar{\Omega}$) so that $[u] = 0$ makes sense, but does $H^2(\Omega) \subset C^1(\bar{\Om... |
How are topology optimizations validated?
I've been confused. Doesn't this mean that each of such design (e.g. N=100) would still need to be validated empirically or is there something that allows one to understand the validity of several of such models?
|
Are there any advantages of using BEM (Boundary Element Method) for contact problem over FEM (Finite Element Method) apart from lesser computational cost?
|
I have some experience solving single- and multicomponent Euler equations for modeling of gas flows, including combustible ones. The code (variations of finite-difference WENO methods) is written with C language.
Till now, I've implemented only simple combustion models such as 1-stage propane combustion (Westbrook-Drye... |
Finite element methods involve integrals of functions that are not polynomials, and these integrals must be computed numerically.
For example, suppose that $f$ is the right-hand side of a Poisson problem and we use Lagrange elements of degree $k$. The right-hand side of the discrete linear system is computed from integ... |
I have been trying to solve a least squares problem of the following form:
$$
\begin{equation}
\min_{\vec{x}} \frac{1}{2} \lVert f(\vec{x}) - f_{\text{target}} \rVert_{2}^2 + \alpha\Big( \frac{1-\rho}{2} \lVert \vec{x} - \vec{x}_{\text{orig}} \rVert_{2}^{2} + \rho \lVert \vec{x} - \vec{x}_{\text{orig}} \rVert_{1} \Big)... |
I am trying to use solve_ivp to solve the following 1st order ODE:
$$ \frac{d \rho}{d z} = \frac{m \theta}{(1+\theta z)} \, \rho, $$
subject to $\rho(z=0)=1$, where $m$ and $\theta$ are constants.
This ODE actually has a simple analytical solution:
$$ \rho = (1+\theta z)^m. $$
When I try to solve this ODE numerically u... |
I am working on a supersonic boundary element method (https://github.com/usuaero/MachLine). In order to test its sensitivity to the boundary discretization, I'd like to be able to create "random" meshes of simple shapes (e.g. a cone) like what's shown here for a sphere, except using triangles.
Generating a set of rand... |
I'm new to computational physics and attempting an n-Body simulator in java but for some reason the planet in orbit leaves the orbit when it reaches the fastest accelaration aka the closest point to the other planet. I'm testing the velocity verlet algorithm for two bodies at the moment.
I'm not quite sure what I'm doi... |
So I need a fast converging solver for SysLinEq as a subroutine in fortran, decided to test BiCGStab in Matlab.
Thank God I decided to test it out on first before implementing in Fortran as a subroutine.
might be inappropriate place to ask but when I run the following
https://en.wikipedia.org/wiki/Biconjugate_gradient_... |
I have to compute the QR decomposition of a matrix A repeatedly, each time with ONLY diagonal elements changing. Is there an efficient way to accomplish this without repeatedly computing the full decomposition?
The issue here is that this whole process needs to be calculated repeatedly for a couple of thousand of times... |
I would kindly ask you which (preferably free) programs / codes do you suggest for the numerical simulation of the problem described below. I am not asking for the full solution, but just want to avoid “reinventing the wheel” as much as possible. I have access to Matlab and Python (Anaconda), which means that I can ins... |
I am a bit confused right now. I am taking a class on numerical linear algebra and as I have understood sometimes one doesn't compute the Matrix-Vector product $Av$ normally but uses other techniques to get the result.
What are these techniques and are they so much faster than the "standard way"?
Additional Info:
I thi... |
Both the creep function and the relaxation function are connected by the convolution integral. The usual method for calculating the relaxation function from a creep function or vice versa is to transfer the creep function into the Laplace domain. In the Laplace domain, the creep function is equal to 1/relaxation.
In my... |
I am solving the steady state compressible Euler equations in conservation form in 2D in a rectangular domain with a discontinuous Galerkin (DG) code I have developed. As a test, the boundary conditions are Dirichlet conditions set to the same far-field values. The Ma number is much less than 0.3.
I expect the solution... |
I'm using classical $P^1$ finite elements to solve $- \Delta u = f$ with Dirichlet BC in a 2D domain $\Omega$.
I know from theory that the solution is not in $H^1$ for my particular choice of $f$, so all classical convergence estimates are useless. If I compute the $L^2$ error against the analytical solution indeed I d... |
I am currently trying to solve a problem with constraint programming. My problem is that for example you need a set of numbers and you can only have a maximum number of 9 with a required length of 6 so you can get something like [1, 3, 4, 5, 6, 8] now when you sum up all these numbers you will get 27 but from the given... |
Step size controllers for ODE solvers with adaptive step size usually track an error estimate $y_{\mathrm{err}}$ and compare it to the current state $y_\mathrm{current}$ to decide if a step can be accepted or the step size needs to be decreased. We consider the case of multi-dimensional ODEs, so all $y$ are vectors in ... |
I have written a matrix class Matrix<T> for which I have implemented a wrapper function for cblas_dgemm.
cblas_dgemm requires to pass my input matrices as double*. However, I want my wrapper to work with const Matrices as well (for which I can only provide a const double*). Within my call to cblas_dgemm I cast the cons... |
Governing equations in polar or cylindrical coordinates often have terms with $\frac{1}{r}$ involved. At $r = 0$, such terms blow up to become a "singularity." The Cartesian version of such governing equations will not have these "singularities" at $(x,y)=(0,0)$. Therefore, the singularity at $r = 0$ must be numerical.... |
I have a PDE like this
$$
\frac{\partial h}{\partial t} = \bigg(\frac{\dot{L}}{L}\bigg)x\frac{\partial h}{\partial x} - \alpha\bigg[h^3\frac{\partial^3 h}{\partial x^3}\bigg]
$$
With boundary and initial conditions given as
$$ h(0,t) = h(1,t) = 1; h_{xxx}(0,t) = 0; h_{xxx}(1,t) = \frac{1}{\alpha}\frac{\dot{L}}{L}; h(x,... |
Consider some randomly generated matrix $B\in\mathbb{R}^{100\times100}$ and let $A:=BB^{\top}$
On MATLAB I computed the condition number of $A$, I obtained a value of $2.8377\mathrm{e}+04$
However if I apply the following modification to $A$
$$
A:=A+(\lambda_{min}(A)+10)I_{100}\tag{1}
$$
Thus overall we have a symmetri... |
For deterministic solver of $Xw=y$, one recommendation is to pick $P$ such that $P^{-1}X$ has a low condition number. However, this condition only really matters when you want to reduce initial error a lot, ie, by a factor of $10^{-15}$. There are scenarios where you are only need to reduce the error by a factor of $1... |
Some context, I've posted this question on physics SE and stack overflow. The former had nothing to offer, the latter had a great commenter that agreed with the phase looking off being one of the potential issues and some difference in the solution's dynamics (and also alerted me to the existence of this part of SE, wh... |
I'm interested in solving a boundary control problem for an axisymmetric diffusion problem where diffusive fluxes only appear radially. The corresponding problem for a uni-dimensional slab can be summarized as follows:
Let $y_d$ be a desired temperature distribution at the end time $T$ and $y_0$ be the initial temperat... |
So I saw this very interesting problem. Let's say you have a length of 2, and a base length of 5
l = 2, b = 5
this would be translated to :
11000
Now if you give an input let's say a 2 the ones on the problem above should move by this number. :
11000 → input 2 : 10100
So the pattern is like this :
input: 1 → 11000
in... |
Consider a regular rectangular 2D $r$-$z$ mesh with constant spacing $\Delta r$ along the $r$-axis with $n$ points and spacing $\Delta z$ along the $z$-axis with $m$ points. I thought it would be a straightforward formula for node connectivity/node numbering. But searching the internet is finding complicated ideas for ... |
I am trying to integrate a function $\hat u$ on the common surface of discontinuous finite elements. The function $\hat u$ lives in a $d-1$-dimensional space of functions defined on the element interfaces. However, the unique mapping of the interface and functions with support on the interface to a reference element is... |
The standard algorithm for discrete convolution of two vectors $x\in \mathbb{R}^{n}$ and $y \in \mathbb{R}^{m}$ is (in essence) a FFT of the two input vectors, multiplication of the two elementwise, and then an inverse FFT of the result. In practice there are complications, for example if $m \ne n$ then we need might n... |
I want to solve a problem of object tracking along time.
The problem is - I have a sequence of images, and I need to find and track the creation of the objects, than their movement, and than their disappearance. There can be up to 3 objects overall, and sometimes there are less, or none. Another limitation is that for ... |
To the best of my knowledge, stiffness of ordinary differential equations is difficult to capture but can be roughly described as problems where explicit methods don't work while implicit ones do. Alternatively, the stiffness ratio of the Jacobian of the dynamics (i.e. the ratio of its largest to smallest eigenvalues) ... |
The following two equations represent a simple model of a plasma where ions are immobile.
$$n\frac{\partial u}{\partial t}+nu\frac{\partial u}{\partial x}=n\frac{d\phi}{dx}-\theta\frac{\partial n}{\partial x}$$
$$\frac{\partial n}{\partial t}+\frac{\partial}{\partial x}(nu)=0$$
Here, $\theta$ is a constant denoting the... |
I've come across compression algorithms, I tried creating a simple run-length encoding algorithm but I notice that when I searched other algorithms I was shocked to know that some algorithms can process thousands of megabits per second how is this possible? I tried compressing a 1GB length text it was taking some time ... |
How can Android be utilized in computational science pipelines?
For example, if one wanted to produce a visualization for an Android mobile device. Similarly to how people are using browsers and JS to do visualizations and interactive apps even.
I'm thinking that support for numerical codes in Java is poor compared to ... |
I am currently trying to understand the mesh partitioning using coordinate bisection method. The general idea is clear: Looking at the coordinates (either X or Y or Z direction) and splitting the entities so that in best case both domains contain the same amount of entities.
Now some questions arise for me.
Q1: Is t... |
I'm looking for a book/paper/code which describes the implementation of a Bingham plastic fluid model. I've tried deriving the equations for implementation using the style of the 1d visco-plastic model for solids described in the first chapter of Simo-Hughes but it seems to me that the analogy between solids and fluids... |
Context
I'm working with absorbance spectral data. I have two spectra generated for a single analyte. Each spectrum was collected over two overlapping wavelength regions e.g. 8-10 micron and 9-11 micron. The spectrums both contain a few thousand data points where each point is a real number.
Question
Is there a method ... |
In a smooth domain in $\mathbb{R}^{2}$ or $\mathbb{R}^{3}$ let's consider $-\Delta u = f$ with $u=g$ on a part of the boundary and $\partial_\nu u = w$ on another part of the boundary, which is far away from the previous one, to avoid compatibility conditions.
Now I want to solve this problem employing linear FEM and t... |
I've been trying to implement data compression algorithms in python, but I just can't get mine as fast as the other algorithms other have made. So I've decided on using C since I've asked people about this and what I got was I should choose a language that is very close to hardware, however I find C very hard because o... |
Suppose $A,H$ are positive definite matrices and $\alpha,t$ are scalars. Is there a way to massage the following problem into a form suitable for a specialized solver?
$$\begin{array}{ll} \underset{\alpha,t}{\text{minimize}} & t\\ \text{subject to} & A-\alpha AH - \alpha HA + \alpha^2 HAH \prec t I\end{array}$$
It "alm... |
I tried to solve a one dimensional biharmonic equation with finite elements. I wanted to use a conforming approach (as I simply do not know a lot about other approaches) and therefore was looking for 1D $C^1$ finite elements. I found a bit of literature on 2D $C^1$ finite elements, however, I could not find anything us... |
Let $U \in \mathbb{C}^{m \times n_U}$ be an orthonormal matrix, let $A \in \mathbb{C}^{m \times n_A}$, and $m \geq n_U + n_A$. I want to compute a QR factorization $X = \left[U A\right] = QR$, with $Q \in \mathbb{C}^{m \times (n_U + n_A)}$ and $R \in \mathbb{C}^{(n_U+n_A) \times (n_U+n_A)}$, taking advantage of the ort... |
I have a measured signal (current of a motor, turning on and off again) to which I want to fit a rectangular function in python. I came up with a reasonable rect(...) function and the scipy.optimize.curve_fit is running, but the results are far from perfect (see code below).
import numpy as np
from scipy.optimize impor... |
I have a 2D rectangular domain. The governing equation on this domain is Laplace equation:
∇2f=0
In the left and right edge there is Neumann boundary conditon : ∂f∂n=a
n is the normal vector to the domain's boundary(here on the left edge it's equal to the negative direction of x axis) and 'a' is a given date and it's ... |
I have $F_i \in \mathbb{R}^{m}$, $y_i \in \mathbb{R}$, $\beta_i \in (1,\infty)$ for $i = 1,\ldots, n$.
I would like to solve the following convex optimization problem
$$\min_{x} \sum_{i = 0}^n |F_i\cdot x - y_i|^{\beta_i}$$.
Since it is convex, I have tried Newton's method with Wolfe condition line search. This would b... |
I need to evaluate a product of two real functions, namely $F(x)\cdot G(x)$. The function $F(x)$ is a diverging and obscure member of scipy.special, while $G(x)$ is a gaussian. While the product is a well behaved function and of order ~1, its factors by themselves, for x range that I am interested in, are of order $10^... |
I need to do a parametric study of the performance of a room heater on different rooms by simulating the temperature distribution in there. The problem here is that the rooms are not simple rectangles like shown in a) (in blue are the walls of the room and in red the heater), where I could just simply sweep over length... |
I have a solution of a 1D wave on a grid (tangent hyperbolic variation) and now I want to interpolate the obtained solution to a new grid with the same number of points as the previous grid but the domain length may or may not change. What are good techniques to do so? I read about Lagrange interpolation, Hermite inter... |
When solving constraint optimization problems with (primal dual) interior points methods, I often read (e.g. on slide 17) that one should not use the inequality constraints $g(x)\leq 0$ directly, but use the slack variables $s\leq 0$ to form $g(x)-s=0$.
But why? Is it easier to find an initial feasible point? Or does t... |
#Here's my code:
class Person:
def _init_(self, name, age):
self.name = name
self.age = age
def myfunc(self):
print("Hello my name is " + self.name)
p1 = Person("Kate", 18)
print(p1.myfunc())
#Here's my outcome:
Hello my name is Kate
None
Why is there 'None' after my sentence?
|
I am working on a fluid mechanics problem with a 4-D dataset (time,x,y,z). I am trying to find the RMS values such as $\overline{u^\prime u^\prime}$,$\overline{v^\prime v^\prime}$,$\overline{w^\prime w^\prime}$ etc., the standard procedure then is to decompose a quantity into its mean and fluctuating components $U = \o... |
In Zhang's Algorithm to determine the intrinsic parameter matrix $K$ (see here for slides talking about this), we instead compute the matrix $B = K^{-T}K^{-1}$ since we obtain a linear system in the variables of that matrix. The general idea is that once we obtain $B$, we use the Cholesky decomposition to decompose $B$... |
We have developed a (new) numerical scheme to solve the classical wave equation in 3 dimensions and we aim to publish the results.
We can read in the aim and scope of the journal of computational and applied mathematics :
" ...The computational efficiency (e.g. the convergence, stability, accuracy, ...) should be prove... |
Can anyone suggest a rectangular problem I can use for evaluating a large dense linear solver? ($m,n>1000$) IE, ideally something that's easy to download and has been evaluated for some solvers already.
|
I am implementing an algorithm to identify the anisotropic lines in an unstructured mesh. This is done in the framework of an Agglomeration algorithm for Non-Structured multigrid applied to FV discretization of N-S equations.
An Anisotropic line can be defined as a line of cells with the same characteristic: to have an... |
I am taking a class on numerical analysis. While the professor was deriving the theory behind quadratic splines, the professor mentioned that a quadratic spline function has the form:
$$
p_{i}(x)=a_{i}x^{2}+b_{i}x+c_{i}\quad\forall i=0,1,n
$$
For a dataset with $n+1$ points, this means that we have a total of $3n$ unkn... |
What evidence exists to suggest that computational science produces more information than studying real phenomena as they are?
I think about this topic often, because I think synthetic knowledge is a fascinating topic, but once I begin to observe how empirical things really behave, then I recall that "all models are wr... |
I have a square matrix $Y$ and I would like to find the solution $X$ for the following equation:
$$X(X^TX)^{-1}=X(Y^TY)^{-1}$$
In this equation, we can suppose that $Y^TY$ is invertible. We could also rewrite the equation as:
$$X\left(I-(Y^TY)^{-1}X^TX\right)=0$$
if this could be useful, at least there is no requiremen... |
I want to fit a monotonically increasing smooth spline function for a dataset
Code:
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
x = [0., 0.75, 1.8, 2.25, 3.75, 4.5, 6.45, 6.75, 7.5, 8.325, 10.875, 11.25, 12.525, 12.75, 15., 20.85, 21.]
y = [2.83811035, 2.81541896, 3.14311655, 3.22373554,... |
Today I'm trying to evaluate this differential equation for internal energy in a gas in Fortran:
$$
\frac{du}{dt} = - \frac{n_H^2}{\rho}\frac{\Lambda}{n_H^2}
$$
Where nH is the density of hydrogen in the gas (costant), u is the internal energy:
$$
u(T) = \frac{1}{\gamma - 1}\frac{kT}{\mu m_p}
$$
And lambda is the cooli... |
I need to create spare matrices with variable elements. Unfortunately, sparse matrix index operations are very slow.
Is there any way to speed up the process? Maybe there are some tricks that I don't know of?
n=100;
n1=prod([6,n,n]);
n2=prod([3,n,3,n]);
X=sparse(n1,n2);
for i=1:n1
X(i,i)=1;
end
for i=n1-prod([n... |
I have the following equation
$$
\dfrac{\partial s}{\partial t} + \nabla \cdot \left( \vec{v} s\right) = f(s)
$$
Where $f(s)$ is an explicit source term that depends on $s$, e.g., ($\sin(s)\;cos(s)$).
When solving with finite volume method (fvm), should I solve the above equation once until a final tolerance? Or should... |
I’m looking for code that is well-suited to solving a fairly simple minimization problem:
I have a reference point $\mathbf p$ in 3D space, and I want to minimize $\|\mathbf x - \mathbf p\|^2$ subject to a constraint $F(\mathbf x)=0$.
The functions $F$ are very smooth, but typically have no useful convexity properties,... |
I am currently reading this article by Sigmund.
Sigmund, O., Maute, K. Topology optimization approaches. Struct Multidisc Optim 48, 1031–1055 (2013). https://doi.org/10.1007/s00158-013-0978-6
I understand that there are various forms of representation of the general optimization problem and categories such as convex ... |
I tried to compute eigen values with the QR-algorithm found here (there is also a wikipedia page also)
import numpy as np
def qr_algorithm(A, tol=0.000001):
Q, R = np.linalg.qr(A)
previous = np.empty(shape=Q.shape)
for i in range(500):
previous[:] = Q
X = R @ Q
Q, R = np.linalg.qr(X... |
If one has the Poisson problem (assume $\int_{\Omega} f = 0$ and $\int_{\Omega} u = 0$):
\begin{alignat}{3}
\Delta u(x) &= f(x), &\quad&x\in\Omega \\
\partial_nu(x) &= 0, &\quad&x\in\partial\Omega,
\end{alignat}
then a standard approach is to discretise it using finite differences. For example in 1D we have:
\begin{equ... |
I’ve been messing around with Ansys and I’m struggling to find the aerofoil coordinates for a NACA 66-012?
I looked on Airfoil tools, but it doesn’t allow you to generate a 6 series aerofoil, only 4 and 5.
Does anyone know any resource that can generate a 66-012 or any 6 series aerofoil coordinates please?
|
I've performed a parameter estimation repeat (i.e. 1000 parallel runs with the same
initial values of parameters). I am trying to estimate ~20 parameters using measurements from experiments.
After running the estimation task (using Evolution strategy algorithm) for 10 hours (using --maxTime argument), the results were ... |
I'm not sure if the question suits this section of StackExchange, but I think the chance to get the answer is highest here (compared with other forums). So I hope more tolerance could be shown towrad this question. Thanks!
|
I want to solve the following system of equations which consists two PDEs and one ODE:
\begin{align}
\rho_t+v\rho_x &= 0; \newline
Y_t+vY_x &= 0 ;\newline
v_t &= -\frac{1}{(\int_0^1\rho dx)}\Big[-\frac{1}{3}\frac{1}{Fr^2}\int_0^1(\rho-1) dx +\xi v|v|\Big]
\end{align}
where $\rho, Y, T$ are function of $(x,... |
I want to numerically simulate the motion of a point particle (unit mass) in $N$-dimensional space according to the force $f(\vec{x}, t)$ and bounded by a set of linear constraints (equalities as well as inequalities):
$$A_i \vec{x} = \vec{c_i}$$
$$B_j \vec{x} \leq \vec{d_j}$$
The behavior of the particle when it comes... |
I'm doing Metropolis-Hastings Monte Carlo simulations of a classical spin Hamiltonian at different temperatures using the parallel tempering algorithm.
I have managed to obtain constant exchange rates across replicas by using an optimization of the temperature distribution and making a replica swap attempt after each l... |
I would like to solve a set of coupled second order differential equations using inbuilt Matlab/Octave subroutines. These equations arise when trying to model sliding of mass ($m_2$) over a wedge of mass ($m_1$) under gravity and neglecting friction on all sliding surfaces. The equations are of the form:
$$
\begin{bm... |
Does it make any sense to acquire some sort of knowledge about manufacturing or engineering for computational design optimization?
I've viewed computational science to be an abstract science suggesting that things could be studied in isolation (or this could be a goal), but I wonder if there's value in understanding ho... |
I am an engineer who is trying to get a deeper understanding of FEM. I have been using the Zienkiewicz texts as my bible. It touches on the issue of incompressibility but I need a more intuitive way to think about what is happening here.
My current understanding
A 1 field displacement-based formulation has convergence ... |
I have parameters $T$ for tension, $b$ for bounciness and $P_t$ for target value that should be approached as t goes to infinity.
Currently I have written an equation like so:
$\ddot{f}(t)=\frac{T(P_t-f(t))-\ddot{f}(t)}{b}$
Which is taken from code that I have written. However, while the code works, this equation does ... |
Is there a unitary $U_{AB}$ such that, for any density operator $\rho$, we have
$${\rm {Tr}}_A \left[U_{AB} \left(\frac{I_A}{2} \otimes \rho_B\right)U_{AB}^{\dagger}\right]= \frac{\rho_B}{2}+\frac{I_B}{4}
\\
{\rm {Tr}}_B \left[U_{AB} \left(\frac{I_A}{2} \otimes \rho_B\right)U_{AB}^{\dagger}\right]= \frac{\rho_A}{2}+\fr... |
The scipy.linalg.qz function implements generalized Schur decomposition for a pair of matrices A, B such that
(A, B) = (Q @ AA @ Z*, Q @ BB @ Z*), where AA is quasi upper triangular and BB is upper triangular. The documentation says for the matrix AA "1x1 blocks correspond to real generalized eigenvalues and 2x2 blocks... |
I have some data which I cannot manage to model and fit with a known function, so let’s say that they are a sample from the unknow function $f(x)$, which look a sort of skewed bell-shaped distribution.
Given $a,b \in \mathbb{R}$ and $\vec{w}$ some parameters of the unknown function:
$$\int_{a}^{b} f(x,\vec{w}=\vec{w_1... |
The symmetric successive overrelaxation method features the iteration matrix
$$P=\left(\frac{D}{\omega}+L\right)\frac{\omega}{2-\omega}D^{-1}\left(\frac{D}{\omega}+U\right)$$
Either as a stationary method or as a preconditioner, a system in that matrix is solved at every iteration.
The method depends on a parameter $\o... |
In Python I use the package torchdiffeq (as provided here) to solve initial value problems. Given an arbitrary function f(y, t, omega), I am wondering how to pass this additional argument omega to the odeint solver? From the documentation, I see that I can specify options such as the step_size, but I can't figure out h... |
Nodal discontinuous Galerkin methods on simplices, like those described in Hesthaven and Warburton, have the nice property that the number of nodes is equal to the minimum number needed to represent a unisolvent order $N$ polynomial in $d$ dimensions,
$$N_p = \frac{\prod_{i=1}^{d}(N+i)}{d!}$$
And we can construct $N_p$... |
I've been struggling with this problem for a while so I hope someone can help me here.
I'm trying to solve the McNabb-Foster equations for hydrogen diffusion in metals using a simple 1D finite element simulation in Python. This works fine under isothermal conditions, but I can't make it work for anisothermic conditions... |
I recently started coding a small library of 2D PDE solvers (time dependent and time independent), and my first attempt was a 2D Poisson equation of the form:
$$\nabla(\epsilon\nabla\varphi)=\nabla\epsilon\nabla\varphi+\epsilon\nabla^2\varphi=\rho.$$ The general idea was to write a 2D Poisson solver capable of solving ... |
It's well known that if we use 2nd order, centered, finite differences for the Laplace operator, we have that the matrix can be written as $$K=I \otimes A + A \otimes I $$ where $I$ is the identity matrix and $A$ is the classical 1D matrix with stencil $\frac{1}{h^2}[1 ,-2, 1]$
My question is: in case I want to employ ... |
for my work I am currently trying compare the mean curvature of different meshes. I have the following scheme. I have a ground truth mesh and a comparison mesh, which I want to compare it too. I am using meshlab to do it.
1.) Compute the curvature of the comparison mesh (as a vertex attribute)
2.) Transfer the vertex a... |
The MacCormack finite-difference "predictor-corrector" method is well known to generate spurious oscillations near solution discontinuities such as shock waves in gas dynamics equations. Or even in simpler case of scalar advection equation, when advected function contains jumps.
For teaching purposes, I'd like to find ... |
I am trying to fit a piecewise polynomial function
Code:
import numpy as np
import scipy
from scipy.interpolate import UnivariateSpline, splrep
from scipy.optimize import curve_fit
from matplotlib import pyplot as plt
def piecewise_func(x, X, Y):
"""
cond_l: condition list
func_l: function list
"""
... |
I have implemented Upwind, Lax, Lax-Wendroff, Leapfrog and macCormak method for the linear advection equation with Dirichlet boundary conditions. I am trying to create the order of accuracy plots for these methods but I receive a constant lines for them. Not sure what is the issue.
def u0(ig):
x = np.arange(0, ig, ... |
We often want to use numerical methods to evolve a system in time.
That is, for a set of differential equations, we can specify some parameters $\bar{\theta}$ and pass these into our numerical solver program $f$ and get an output $y(t) = f(\bar{\theta})$.
Does automatic differentiation still apply to these types of num... |
Locally refined meshes are often inevitable for accurate, yet feasible computations.
In the context of time-dependent PDEs, however, this comes at the cost that (due to the CFL condition) reducing the mesh width $\Delta x$ implies also that the timestep $\Delta t$ has to be reduced.
To alleviate this problem, many effo... |
The theory
Consider a quantum harmonic oscillator described by the potential $V(q)=\frac{1}{2}m\omega^2 x^2$. In the path integral formulation, the partition function can be written as $$Z\propto\int Dx(\tau)\exp\left(-\frac{S_E}{\hbar}\right) $$ where $\tau$ is Euclidean time and $S_E$ is the Euclidean action for clos... |
I'm attempting to carry out transition state optimisations in Gaussian and a lot of my calculations are coming up with errors, the main one being
no analytic 2nd derivatives for this method.
How can I get past this?
I am using the same input as for the local minima, but using the statement opt=(ts,noeigen,calcfc)
Am ... |
I am currently trying to calculate Landau levels for any system numerically in python. But, I am clueless about where to start rather, how to construct the Hamiltonian. Can anyone help?
|
The time-dependent Schroedinger equation (TDSE) depends linearly on the system's initial state $\vert \psi(0) \rangle$, such that the solution can be generally written as
$$ \vert \psi(t) \rangle = \exp \left( \frac{i}{\hbar} \int_0^t \text{d}t' \widehat{H(t')} \right) \vert \psi(0) \rangle \quad , \quad (1) $$
where t... |
The armijo step length formula states that
f(x+lr*descent_direction) <=f(x)+c*lr*f_gradient*descent_direction
In the above formula lris the learning rate and f is the loss function. In a neural network setup, in order to find the armijo step length for the loss function, I need to calculate the loss on the updated mod... |
I'm trying to estimate the parameters (v, n, k) defined in fit_func. I tried the default least squares fit but I couldn't find the parameters successfully.
def fit_func(x, v, n, k):
return v * x ** n / (k ** n + x ** n)
x = [2.5, 2.71317829, 4.08, 4.18604651, 5.19379845, 6.92,
7.98449612, 8.94,... |
To what extent can you put trust in a numerical solution obtained by direct solver for an ill-conditioned linear system? In other words, how can you test the solution? Dropping it into the system says nothing, because small residual can lead to a big error for an ill-conditioned system.
|
Trying to solve numerically the 2D Poisson equation with variable diffusion coefficient $K$, that in general can be discontinuous.
$$ \frac{\partial}{\partial x} ( K(x,y)\frac{\partial C}{\partial x}) + \frac{\partial}{\partial y} ( K(x,y)\frac{\partial C}{\partial y}) =a$$
where $a$ is a constant. Would this second ... |
I am training a neural network with the multiobjective steepest gradient descent algorithm. The want to steer the direction of the gradient descent so that I land up at a point slightly above where I am landing now. How can I achieve this? Is there any mathematical way to scale the gradients? In case of the neural netw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.