instruction stringlengths 43 28.1k |
|---|
I am working on a modified version of Schrodinger's equation (time-independent) where $\frac{d^2ψ}{dx^2}=-2(E-V)ψ$, where I have to consider $V = 0$ at all times.
I have been asked to use Python in order to solve this equation.
I have used the following code:
e = 200
dx = 0.01
xlim = 100
p = np.zeros(xlim+1)
x = n... |
I am building a gradient descent model based on portfolio optimization. Currently, I have finished the model and am able to run it smoothly without any problem. However, there's one issue that I couldn't fix: the optimal vector components have negative values. As my portfolio does not support short-selling stocks, this... |
I am doing a physics experiment that involves releasing gas from a reservoir into a vacuum chamber via a pulsed nozzle and I am interested in knowing what would be a simple (and reasonably accurate) way to simulate the gas density distribution over a certain volume in space in front of the nozzle and over time after th... |
The diffusion equation is
∂u/∂t =∂^2u/∂x^2.
Consider using an explicit finite difference method to solve it. What does it mean for that explicit finite difference method to be conditionally stable?
|
An arithmetic expression written in Reverse Polish (postfix) Notation is an ordered list of numbers and algebraic operators, which are sequentially evaluated as a stack would process them to return a single numeric result. If the expression contains n numbers, it must contain precisely (n-1) algebraic operators if ever... |
At the institution I work for we have a User Exit made in Pro*C (SQL embedded in C language). We are having some troubles because identical shared libraries are generated when compiling different source files. These .so files have no symbols. Everything was working alright just a few days ago, but suddenly this trouble... |
I am having trouble getting a good parallelization with FDTD simulations in Meep. Originally, I tried to use the Python interface on a rather big computing cluster, but the runtime of my simulations did not change appreciably upon changing the number of cores for parallelization. I know that this might have a lot of re... |
I am solving Darcy flow now with mixed finite element method. The Dary flow is
$$\begin{equation}\begin{aligned}k^{-1}\mathbf{q} + \nabla h=0, \text{ in } \Omega\\ %
\nabla\cdot \mathbf{q} = 0, \text{ in } \Omega, \\ %
h =h_D, \text{ on } \partial\Omega_D, \\%
\mathbf{q}\cdot \mathbf{n} = q_N = 0, \text{ on } \partial\... |
I'm a PhD working in a computational mechanics lab. I come from a Math department, and I have a good background for what concerns the basics of finite elements, like inf-sup conditions, DG, non-conforming FEs. I also did some basic codes, like Poisson on a square/L-shape/etc. (or other elliptic problems) using the clas... |
I want to find some kinds of matrices for testing my code such as GMRES , MINRES and so on. But I can't find some testing matrices and corresponding preconditioner to verify my program.
I know some website like MatrixMarket (see this question) ,but I couldn't find corresponding preconditioner of a matrix.
Can anyone h... |
I ask for help in solving the problem. I am developing an optimization program that selects the coefficients of a polynomial of order $n> 5$ so that all its zeros are just real numbers. And I cannot find sufficient conditions suitable for this, which would include its coefficients.
In the article A Sufficient Condition... |
I am looking for a MINLP solver that works with Pyomo models which can be used in the Google Colab environment. I have already found MindtPy but it doesn't work in google colab.
|
This is a follow-up question to my earlier question Stochastic cellular automata - algorithm limited by 1 cell per timestep. I am considering blending two approaches to a cellular automata model of how mold spreads in a petri dish.
A probability based approach
A quick review: I am trying to model the spread of mold in... |
This question is a follow-up of this previous one. I decided to solve the linear elasticity \begin{cases}- \nabla \sigma(u)=f \\ u=0 \text{ on } \partial \Omega\end{cases}
with P1 Lagrangian finite elements on the square $[-1,1]^2$. Here I want to highlight and ask for a confirmation the crucial steps, that were totall... |
I have some data, (xrd data), that I would like peak fit with a pseudo-Voigt function, a combination of a Gaussian and a Lorentzian function. These are the functions
$G(x) = I \exp\left( -\frac{4\ln(2)(x-\Theta)^2}{w_G}\right)$
$L(x) = I \frac{w_{L}^2}{w_{L}^2+\left(x-\Theta\right)^2}$
Where $I$ is the intensity, $\The... |
Was trying to implement a poisson 2d solver using Conjugate Gradient Method, so from 10x10 grid the matrix becomes 100x100 (since we have 100 nodes to find the values at), 100x100 grid goes to 10000x10000 matrix, but matrix is sparse with 5 elements on each row (not pentadiagonal!).
Hence, receiving segmentation fault,... |
I am trying to understand the attached python 3X code.
The following dispersion relation is given
$$\epsilon (k, \omega) = 1 - \frac 1 2 \left[ \frac{\omega_p^2}{(\omega-kv_0)^2} + \frac{\omega_p^2}{(\omega+kv_0)^2}\right]$$
What I am trying to understand is how to find the minimum grid length $L_{min}$ (as a function ... |
I have discrete data of a function plotted below:
The "Y" values of the function near "X=1.57" are very close to each other and zero, like 9.25558265263186E-11 and 5.92357284527227E-11.
Using "Trapz" function directly, or using "Integral" function indirectly as
f1 = griddedInterpolant(x,y); %I used also spline and oth... |
I want to use the SDEint package to give a numerical solution (plot) of the following stochastic SIR model. Namely, a system of SDEs.
$$\begin{cases}
dS = -\beta SIdt - \sigma SIdW \\
dI = (\beta SI - \gamma I)dt + \sigma SIdW \\
dR = \gamma Idt
\end{cases}$$
Here is the code I have been trying so far. Below I will ex... |
I'm trying to solve \begin{cases} - \Delta p=f \text{ in } \Omega\\ p=0 \text{ on } \partial \Omega \end{cases} with in $\Omega = [-1,1]^2$ by writing it as
\begin{cases} u + \nabla p=0 \\ -\operatorname{div}(u) = -f \\ p = 0 \text{ on } \partial \Omega \end{cases}
whose weak form is \begin{cases}(v,u) - (\operatorna... |
I'm trying to learn about collocation. As an example, I am using Numerical Recipes, 20.7.12, but changing the basis. To wit, I'm trying to solve
$$y'' + y' - 2y + 2 = 0, -1 \le x \le 1, y(-1) = y(1) = 0$$
which has exact solution $y(x) = 1 - \frac{e^{x} \sinh(2) + e^{-2x}\sinh(1)}{\sinh(3)}$.
Now, Numerical Recipes is ... |
Consider the following partial differential equation
\begin{align}
\frac{\partial u}{\partial t}+\frac{\partial f}{\partial x} &= g(x,t), \ \ x\in \Omega = [x_{L},x_{R}] \\
u(x,0) &= u_{0}(x) \\
\frac{\partial u}{\partial x}(x_{L},t) &= g_{1}(t)
\end{align}
where the flux function $f(u,x)$ is nonlinear. Let $\{x_{i}\... |
I code mostly in Matlab, simulating various simple fluid dynamics models.
One particular simulation has the potential to become sort of complex, though I believe the set of coupled equations will still be pretty simple / greatly simplified.
Is a 2021 MacBook Air sufficient for simulations?
My 10-year-old MacBook Pro ru... |
I have some confusion in this diagram
My confusion : why is $Hx= x-2u^{H}xu$ ? why not $Hx=x(x-uu^H) + 2((u^Hx)u)^2?
$
My thinking is that by using pythogoras theorem blue line(vector) denotes $(x-(u^Hx)u)^2 +(u^Hx)^2= x^2 + ((u^Hx)u)^2- 2xu^Hu +((u^Hx)u)^2 = x(x-uu^H) + 2((u^Hx)u)^2 \neq (I-2uu^H)x$
|
I am trying to speed up some multi-camera system that relies on calculation of fundamental matrices between each camera pair.
Please notice the following is pseudocode. @ means matrix multiplication, | means concatenation.
I have code to calculate F for each pair calculate_f(camera_matrix1_3x4, camera_matrix1_3x4), and... |
Fast Givens rotations seem like a nice upgrade from standard Givens rotations. They take fewer multiplications to apply and avoid the calculation of a square root.
They are, however, given very little focus in the recent literature. They appear as an exercise in Golub and Van Loan. They get a short section in Gentle bu... |
My Math SE question determining if a coincident point in a pair of rotated hexagonal lattices is closest to the origin? explains the problem I have. I won't reproduce the whole thing in detail here, but this image illustrates the problem graphically.
On the right: the coincident point defined the closed dot point (5,... |
Let A and B be sparse matrices in $ \mathbb{R}^{m\times m}$ with (roughly) the same density $p$. I want to efficiently compute a matrix $C$ that in some sense is "closest" to $AB$ while still having density $p$. "Closest" should probably mean "minimizes $||C - AB||_F$" but I'm open to other interpretations.
If $\textrm... |
I would like to solve following the basic equation of linear elasticity (for simplicity in 1D)
$$
\frac{d}{dx} \left( E \frac{du}{dx} \right) = 0 \quad \textrm{with} \quad u(1)=0, \; u(-1)=b
$$
Following the example on page 138 (program 33) in Nick Trefethen's book "Spectral Methods in Matlab" (https://people.maths.ox.... |
Below is kind of a broad question.
Was given Poisson equation with BC, on meshgrid of NxM.
Rewrote as system of N*M linear equations,
Converted to sparse format (CSR/CRS/Yale), solved using Conj Grad method
As for 100x100 grid computation time is ~0.3s and
if I increase the grid to 500x500, code runs for 11 seconds alr... |
I am attempting to evaluate an expression that defines a probability of a particular event. With 3 different events, I can (under some statistical assumptions) characterize the probability of event 1 (for example) occurring as
$$\frac{e^{v_1+2 v_2} (v_2-v_1)}{\left(e^{v_2}-e^{v_1}\right)^2 \left(e^{v_2}-e^{v_3}\right)}... |
I have a (numerical, noisy) function $f$ that I'd like to optimize (in 3 < dimension < 10).
The function $f$ has a fairly prominent valley/ravine structure due to physical symmetries present in the input data. To be more precise: there is a submanifold $V$ of low dimension (let's say 1 or 2) along which function values... |
Let's consider that we have large number of boxes being transported in a truck. These boxes contain certain number of vials which in turn contain some other products. Now one would like to simulate the impact of truck vibration during the transport on the vials. An impact such as the shock and other mechanical constrai... |
Supposing that $\{B_{ij}\}_{i,j}$ are all Hermitian matrices and $\{c_{ijk}\}_{i,j,k}$ are all real numbers, the corresponding SDP(Semidefinite Programming) problem is as follows:
$$
\begin{aligned}
&\!\!\min_{\{X_{ij} \;\!\}}\quad \mathrm{tr}\sum_{i,j}X_{ij}B_{ij} \\
&\mathrm{s.t.}\quad\sum_{i,j} c_{ijk}X_{ij}\succeq0... |
I want to plot some functions f(x,y) including singularities.
For example;
f(x,y)=tan(x-y)
In Matlab, when I run the following code
syms x y; func=@(x,y) tan(x-y); fsurf(@(x,y) func(x,y), [-4 2 -1 1]);
I get
In Mathematica, when I plot the same function, I can remove the discontinuities using Exclusions -> "Singul... |
Sorry in advance if this question has already been asked, I found nothing to help.
I want to buid a 3D box whose top surface is topography. This topography is defined by a DEM i.e. a set of points (x,y,z) where z is the elevation and (x,y) are known on a cartesian grid.
How to include this set of points to generate a s... |
Sorry for question's silly tittle. I don't quite know how to name my problem, that's why I'm here.
Imagine you wish do add the collumns of you data ('1','2','3'...'30k' etc.) in such a way as to obtain the numbers in the Goal column.
You don't have to combine all the columns, combine only as many as necessary for you ... |
I have $d\times d$ real-valued matrices $A_1,\ldots,A_k$, $1000<d<4000$, $k\approx 50$, and need to estimate the trace of the following matrix product
$$t=\text{tr}(A_1 A_2\cdots A_k A_k^T \cdots A_2^T A_1^T)$$
$\|u\|^2$ gives me an unbiased estimate of $t$ where $u=A_1 \cdots A_k v$ and $v$ is some random vector with... |
This is a time fractional PDE,where $0<\alpha<1$.
I would like to know how to describe this equation and where does this equation come from.
|
I wish to build a simulation of self-assembling wires. Think lots of ball bearings in a 20KV electric field and they form emergent structures.
If I use the method of images to figure out what the induced charges on various parts of these ball bearings due to all the other charges, is this enough to specify a general si... |
I need to solve a few eigenvalues of a large sparse matrix specified by their index range. These indices are according to the whole eigenspectrum sorted in algebraic (not absolute value) ascending order.
For example in python, I notice this is made available by the subset_by_index option in scipy.linalg.eigh for non-sp... |
I have developed an Octave script to solve the nonlinear Euler-Bernoulli beam equations with linearized von Karman-strains, i.e. higher-order terms are dropped. The simulation results agree with analytical results in small and moderately large displacements in static analysis. However, when doing a dynamic simulation w... |
While browsing a disk image from the Soviet mainframe BESM-6, I've found some bits and pieces of a computational math library for Algol-60, stored in plaintext (if the Soviet GOST 10859 encoding with parity, as if on punched cards, can be considered plaintext).
One function is of particular interest because of an error... |
I have a parallel code. The code is implemented using MPI.
I want to find a package that can help to implement global mesh refine and optimize meshes (avoid very thin element).
The mesh in my work is all organized by triangle or tetrahedra.
Do you have any state of art packages for suggestions?
I know the metis/parmeti... |
I am interested in calculating the total potential energy stored in a finite element mesh given its nodal point displacements alone. The forces that created the displacements are irrelevant because the objective is to calculate the strain energy stored in the mesh post-deformation.
From what I understand the total pote... |
Is it possible to conduct an Eigen-decomposition of a matrix one eigenpair by one eigenpair?
And related to this question, what is the time complexity of truncated eigendecomposition?
I am trying (hard) to find a way to reduce the time complexity of my algorithm which involves the calculation of eigendecomposition of ... |
I'm trying to understand how Lagrange multipliers are applied in order to impose constraints in PDEs. Consider $B \subset \Omega$. For instance, a square inside another square domain $\Omega$. Let's say we want the solution to the Poisson problem $$-\Delta u = f \text{ in } \Omega$$ subject to the constraint $$u = g \... |
For integer $k>0$, it is well-known that one can use binary exponentiation to evaluate the matrix power $\mathbf A^k$, where $\mathbf A$ is an $n\times n$ matrix.
However, it is not clear to me if that method can be readily modified to evaluate $\mathbf A^k \mathbf v$, where $\mathbf v$ is a vector of dimension $n$. Of... |
Suppose that we have $N$ points, and a distance matrix $D \in \mathbb{R}^{N \times N}$ describing the Euclidean distance among those points. For now, assume that we do not necessarily know how many dimensions the original points lived in.
Is there a general way to construct a new matrix $B \in \mathbb{R}^{N \times P}$,... |
If I have the Poisson equation $\Delta u = f$ a standard transfer operator (for a regular grid) is the full weighting/bilinear interpolation scheme:
$$K = \frac{1}{4}\begin{bmatrix}\frac{1}{4} & \frac{1}{2} & \frac{1}{4} \\ \frac{1}{2} & 1 & \frac{1}{2} \\ \frac{1}{4} & \frac{1}{2} & \frac{1}{4}\end{bmatrix}.$$
General... |
By writing the direct integration of the 2D Euler Equations in a wide and short box where the fluid enters and exits through the horizontal faces using the Runge Kutta O(4) method I have found that the CFL coefficient, here approximately computed as follows, oscillates with an increasing amplitude over time. If integra... |
Let's say I have a 2x2 matrix (with symbols) called 'A'. Now, if do
B = sympy.tensorproduct(A,A)
print(sympy.shape(B))
I get,
(2,2,2,2)
which is a 4 rank tensor.
However, what I want back is a 2 rank 4x4 matrix. How can I do that?
I tried reading documentations for sympy and found out about reshape. But it didn't ... |
Cross-posted from Stack Overflow. (https://stackoverflow.com/questions/70686368/can-i-use-periodic-boundary-conditions-for-u-but-not-for-p)
I am trying to numerically compute the drag force around a cylinder due to pressure-driven flow. Here is a crude diagram:
I am using OpenFOAM v2012 (the openfoam.com version, not ... |
I'm currently trying to implement a python script for solving a constrained nonlinear optimization problem with ~800 variables and 2 constraints, one linear and one nonlinear. There already exists a Matlab implementation of this script and I'm trying to use cyipopt to implement an equivalent Python implementation that ... |
I have a system of 2 non-linear, coupled PDEs that I would like to transform to a stiff ODE system to solve them using the method of lines. The 2 equations:
$$\begin{align}
\frac{\partial \phi}{\partial t} &= - \phi^m \frac{P}{R - H(P)(R-1)}\\
\phi^m \frac{P}{R - H(P)(R-1)} &= \nabla \cdot [\phi^n(\nabla P + u_z)]
\end... |
Background
I want to solve the following biharmonic equation:
$$\frac{ \partial^4 s }{ {\partial \xi}^4 }+\frac{ \partial^4 s }{ {\partial \xi}^2{\partial t}^2 }+\frac{ \partial^4 s }{ {\partial t}^4 }=0\label{1}\tag{1}$$
on the unit square with the four Edges E1, E2, E3, and E4 (Fig. 1 left) and its prescribed boundar... |
Even if the formulation is the same the TVD slope limiter can be applied:
to state reconstruction at the interface, in 1D FV formulation, we reconstruct the $Q^*_{j+1/2}$ and the $Q^*_{j-1/2}$ in the formulation:
$$
Q_J^{n+1}=Q_J^n+\frac{\Delta t}{\Delta x}\left[F\left( Q^*_{j+1/2}\right)- F\left( Q^*_{j-1/2}\right)\r... |
I need some good references on how to implement programmatically the hp-refinement of meshes in the Finite Element Method in two/three-dimension. I've searched the web a lot and read many articles and books without success. Most of the references in this regard have only concisely discussed the details of the hp-refine... |
I have a linear system of the type
$A x = y$
where A is a dense, square, symmetric, positive definite matrix, $x$ a vector of unknown parameters, and $y$ is a vector of observed quantity.
I know that using a Cholesky decomposition based algorithm should be the fastest way to find the values of $x$ that fulfil the equat... |
I am currently trying to compute the value of the first Fibonacci number recursively. the idea is as follow:
Compute $f_{n}$ and $f_{n-1}$ for $n = 2,...,100$,
Compute $f_k$ for $k = n−2, n−3, \dots, 0$,
Call $\hat{f}_0(n)$ the value of $f_0$ computed as a function of $n$.
Here is the Matlab code I used:
N = 101;
n =... |
A basic question on low Reynolds number hydrodynamics. When a slender beam is moved through a fluid, the dynamics may be calculated using slender body theory (e.g. Slender-body theory for slow viscous flow J. B. Keller and S. I. Rubinow, J. Fluid Mech. 1976; https://en.wikipedia.org/wiki/Slender-body_theory). In effect... |
The LOBPCG algorithm finds eigenpairs of the generalized eigenproblem
$$
Ax = \lambda B x
$$
where $B$ is symmetric and positive-definite, $A$ is symmetric. One of the features that makes LOBPCG so interesting is the fact that one can use preconditioners of $A$ to speed up convergence.
When applying LOBPCG to the FEM-d... |
Let's take the heat equation. We have a time derivative and spatial derivative. How to discretize the spatial derivative using Chebyshev spectral method and convert it into DAEs? Like in the form of $ F(\dot{x}(t),x(t),t) $
$$ \frac{\partial u}{\partial t} = \frac{\partial^2u}{\partial x^2} $$
Assuming boundary conditi... |
I'm trying to solve a differential algebraic equation in Julia's modelingTookKit.JL, where the vector field has the form f(X) = 0.
I found an example of a DAE in the below link
modelingToolkit.JL DAE](https://benchmarks.sciml.ai/html/DAE/ROBERDAE.html)
with follwing code. However, when I replace say
D(y₁) ~ -k₁*y₁ + k₃... |
I would like to evaluate the chi-square of the form $\chi^2=v^{T}C^{-1}v$ where $v$ is a column vector and $C$ is a covariance matrix. Both $v$ and $C$ are known and $C$ is a $740\times740$ matrix. All quantities involved are real valued.
The straightforward fastest way I know is to compute the solution to the equation... |
$$
argmin(x,y)=x^2+y^2+2y
$$
$$
s.t.\ \ y=|x-10|
$$
How can I convert the absolute value constraint to the constraint matrix (GX<=h, AX=b) in cvxopt?
|
I am trying to formulate a convex optimization problem using CVXPY. Everything works, except a constraint that does not seem to follow DCP rules.
Let $D \in \Bbb R^n$ be a decision variable and let $Q$ be another decision variable that is derived from $D$ using the following constraint,
Q = cvxpy.pos(D)
I am not sure ... |
I have a simple square mesh, and a curve (discretised by another mesh) inside it. Here a picture worths thousand words. What I want to achieve is to find, for every cell $K$ of the circular (discretised) grid, I want to get the intersection points with the cells T of other grid. Here they are marked with a red dot.
Wh... |
I wanted to attempt an implementation of a finite-difference-based solver for the 2D elctrostatic Poisson equation when metallic objects are present. Also, I hope to take as input, the location of charges and their magnitude.
For the sake of simplicity, I consider a rectangular domain, inside which I attempt to solve t... |
I am trying to numerically solve the advection equation $y_t + y_x = 0$ using a the "classical" Runge-Kutta 4 explicit timestepping method, along with a left-hand finite difference approximation for the x-derivative, in MATLAB.
Specifically:
$\frac{d}{dt}y(t_i,x_j)= -\frac{y(t_i,x_j) - y(t_i,x_{j-1})}{dx} = f_j(\vec{y}... |
I am used to solve parabolic or elliptic non-linear PDE and the common methods to tackle non-linearity are Picard's iteration and Newton's method. I am a bit confused by the way things are done with hyperbolic equations.
For example, with the classical inviscid Burgers' equation in the non-conservative form:
$\begin{al... |
I was redirected here from physics stack exchange where hopefully my question is more appropriate. Per my advisor, I have read the textbook Chaos, an introduction to dynamical systems by Alligood, Sauer, and Yorke. (side note, I have really enjoyed this book). In chapter 5, the numerical calculation of Lyapunov exponen... |
I have a discretized 2D mesh over which I calculate eigenvalues and eigenvectors of some
Hermitian 2 x 2 matrix at each point along a closed loop parameterized by parameter t. The eigenvectors are usually complex-valued. I then calculate a quantity z(t) using the eigenvectors. The complex-valued number z(t) is calculat... |
Does anyone know a library that implements sparse direct solver working in already open omp parallel region? The only library that I know that works with this requirement is Pardiso7.2 worth ~8K USD for a single-user license.
Intel MKL Pardiso and MUMPS solvers assume the execution environment is single-threaded, so wh... |
I am trying to solve an equation for chemical advection of a fluid in a porous media with this equation:
$\begin{align}
\frac{\partial (\phi(x,t) C(x,t))}{\partial t} = - \nabla . (\vec{q(\phi, t, x)} C(x,t))
\end{align}
$
with $\phi$ beeing the porosity, C the concentration of an element, and $\vec{q}$ the fluid flux... |
I'm new to C++ programming. This seems a common error but I can't seem to solve: I'm trying to use the gsl library, with no luck: using /usr/bin/g++ to compile, for instance, the following minimal (supposed to be) working example (available here).
#include <iostream>
#include <gsl/gsl_linalg.h>
int main() {
cout <... |
Is there an "Unspoken Tradeoff" in Convergence Rates for "Quasi-Newton Methods vs. Gradient Descent"?
As a quick summary:
Gradient Descent based algorithms try to find the minimum of the function they are optimizing by repeatedly using information obtained from the First Derivatives
Quasi Newton methods (e.g. BFGS) t... |
Is there any method to linearize the following optimization problem?
\begin{align}
min_{x,y} &~~ c~[x; y] \\
st &~~ \sum x\leq \alpha_1 \\
&~~ \sum |y|\leq \alpha_2 \\
&~~ \sum y= 0 \\
&~~ x+|y| \leq 1 \\
&~~ (x,y)\in \{0,1\}*\{-1,0,1\}
\end{align}
|
I need to solve a linear system of the form $(\mathrm{Id} + \mathbf{J})\mathbf{x} = \mathbf{b}$ for $\mathbf{x}$ and I also need to compute the operator norm of $\mathbf{J}$ (i.e. the largest singular value). The matrix $\mathbf{J}$ has no special structure other than being real-valued; the vector $\mathbf{b}$ is also ... |
I remember there is a software (and its website interface) that can generate numerically stable equation from an expression automatically.
To see the problem it tries to solve, let’s take a look at a simple example of $f(x) = \log(1 + \exp(x))$.
If $x$ is a relatively large number (e.g. 800), $\exp(x)$ could be very la... |
Can anyone help me prove that, if the residual $r_0 = b-Au_0$ can be written as a linear combination of $k$ eigenvectors of $A$, then the CG method will converge to a solution $x^{*}= A^{-1}b$ in at most k steps. With $N=I_n$ and $A$ is symmetric and positive definite.
|
I need help to know, how can I convert an unstructured 2d mesh for structured mesh? (Software Gmsh version 4.9.3).
This is my script in Gmsh.
Mesh.MshFileVersion = 2.2;
// Geometry
//Points
Point(1) = {0, 1, 0, 0.3};
Point(2) = {0, 2, 0, 0.3};
Point(3) = {7, 2, 0, 0.3};
Point(4) = {7, 0, 0, 0.3};
Point(5) = {1, 1, 0... |
I have an equation like
$$ \frac{\partial u}{\partial t} =A\frac{\partial^4u}{\partial x^4} $$
with boundary condition $$ u(x = \pm L,t) = 9; u_{xx} (x=\pm L,t) = 4 $$
I tried to use the method of lines and rewrote the whole PDE equation in the form of
$$ \frac{\partial u}{\partial t} = A \frac{ u_{i+2} - 4u_{i+1} + 6u... |
I am purchasing a new workstation to run FDS (Fire Dynamics Simulator) simulations, a CFD code for thermally driven fluid flow.
Currently, I am using an Ubuntu Linux build with a Xeon E5-2630 v3 @ 2.40 GHz with 8 cores and 16GB of RAM. The total mesh is about 20,000 cells (4.5 by 4.5 by 10cm), divided into 8 meshes, 3... |
In the p-adaptive version of the finite element method, elements are allowed to have shape functions with arbitrary different polynomial orders. Therefore regarding a 2D problem with quadrilateral hierarchic shape functions, the polynomial orders of four edge-modes of an element, $p_e^1,p_e^2,p_e^3,p_e^4$, and its inte... |
I am used to solving elliptic PDEs of even order. I was wondering what would one do for odd order PDEs. Notably the discretisations of those results in unsymmetric matrices. I tried solving the following simple problem:
$$\frac{d^3u}{dx^3}(x) = 0,\, x\in \Omega \quad u(x) = f(x), \, x \in \Gamma_D, \, \partial^{l}_nu(x... |
I want to simulate a vibration of a thin plate (the Kirchhoff-Love model) on triangular meshes. Can you advise me on an introductory-level review of different elements for thin-plate FEM simulation?
I was thinking about Morley elements, but they seem non-conforming (is it really bad? never worked with non-conforming FE... |
I was reading the Wikipedia page for "Well-posed problems". Supposedly, if a problem is well-posed, it must meet the following conditions:
a solution exists
the solution is unique
the solution's behavior changes continuously with the initial conditions
I can understand why the first two conditions are desirable for a... |
Is there a name for the following optimization problem? Is it solvable?
\begin{align}
\min_{\pmb{u}} & \qquad \frac{1}{2}(\pmb{u}-\pmb{u}^m)^{T}(\pmb{u}-\pmb{u}^m)\\
\textrm{s.t.} & \qquad \pmb{A}(\pmb{u}) \textrm{ is positive definite}
\end{align}
Here $\pmb{u}\,\in\mathbb{R}^{n},\pmb{u}^m\,\in\mathbb{R}^n$, $\pmb{u}... |
I want to solve the advection equation ($v_0 \in \mathbb R$)
$$
\frac{\partial f}{\partial t} + v_0 \frac{\partial f}{\partial x} = 0
$$
using 2nd order Runge Kutta like the midpoint rule for the time integration and an upwind (backwards finite differences) for the spatial derivation.
Here is a general Runge-Kutta impl... |
Suppose I have values of log(P(x_i)), i.e. log-probabilities to events x_i. The probabilities are very small, so that these log-values are of the order of -1e3.
I want to compute an expectation value. In order to evaluate the corresponding sum, I need the probabilities P(x_i) themselves so I tried to call numpy.exp. Th... |
On an informal level, I have heard the following statements being made:
The "Branch and Bound" Algorithm has the ability to provide exact solutions to optimization algorithms, but can take a long time to run.
Evolutionary Algorithms can only provide approximate answers, but take less time to run.
My Question: Are t... |
I work to solve PDE using FEM in the case P2 on Matlab. I try to correctly assemble load vector using quadratic Lagrange shape functions $$b_i =(f,\phi_i)=\sum_{q=1}^{nq}f(r_q,s_q)*\phi_{i}(r_q,s_q)*w_q*det(J(r_q,s_q)).$$
Here is what I did
[rspts,qwgts] = Gausspoints(precision); % quadrature rule
np = size(p,2);... |
How can I visualize 3D data volumes with arbitrary cutting plane on web pages? I could not find a library that allows so.
|
I want to put (non-dirichlet) boundary conditions inside the code I wrote to solve the 2dim TDSE using the alternating direction implicit Peaceman - Rachford method.
$$
(1 + iB\Delta t/2 ) \psi^{n+1/2} = (1 - iA\Delta t/2) \psi^n
$$
$$
(1 + iA\Delta t/2 ) \psi^{n+1} = (1 - iB\Delta t/2) \psi^{n+1/2}
$$, where $A$ con... |
I want to solve this set of 2D advection-diffusion equations of this form in spherical coordinates:
$$
\frac{\partial f}{\partial t}=-\mathbf{u}\cdot\nabla f+\eta\nabla^2f+\eta_1(\mathbf{e}_1\cdot\nabla)(\mathbf{e}_1\cdot\nabla)f+\eta_2(\mathbf{e}_2\cdot\nabla)(\mathbf{e}_2\cdot\nabla)f+s_f(g)
$$
$$
\frac{\partial g}{\... |
In the context of mechanical simulation, where I solve the stationary action principle directly (i.e. $\nabla S = 0$ for some scalar function $S$), I use the wrapper scipy.optimize.newton_krylov to access several different nonlinear Krylov based solvers (in particular, lgmres and cgs).
The equations have many solutions... |
Introduction
I am building an application in which, given a surface and a pair of points on it, an analytic expression of some geodesic arc between them is needed, preferably the one with the shortest length. Furthermore, this parameterized curve, needs to have minimal geodesic curvature.
Is there a suggested tool that... |
In a previous answer the following identity was presented
$$-i \vec \kappa \exp^{[i\vec \kappa \cdot (\vec r_j - \vec r_i)]} = -\vec \kappa \sin[\vec \kappa \cdot (\vec r_j - \vec r_i)] \, .$$
Why does it hold?
|
I am in need of some help to valdate a consistency test with a finite volume method solver.
The idea is the following:
Based on the method of manufactured solutions (MMS) I am supplying the analytical solution, $\mathbf{x}$,
I am letting the solver assemble the matrix, $\mathbf{A}$ from discretization, and I am supplyi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.