instruction stringlengths 43 28.1k |
|---|
I am doing a comparison of different algebraic modeling langues (AMPL, AIMMS, GAMS, Pyomo) in both theoretical and practical terms. As a practical experiment I am trying to measure problem model instance creation time. I.e. taking optimization problem defined in one of the above languages I am trying to load the model ... |
I have done an experiment Estimation of silver nitrate by potentiometric titration with standard KCl solution.
A plot of $\dfrac{\Delta E}{\Delta V}$ versus Volume of KCl solution gives the following:
$\dfrac{\Delta E}{\Delta V}$ versus Volume of KCl ">
What would be the possible equation which I can fit this data to?... |
Testing on an MPI scientific code for compressible flow dynamics I noticed that the results may depend on the number of processors used for the calculation. In fact, comparing the binary files they differ around 10.0E-10 ~ 10.0E-11
Since I am optimising the application and I am almost completely rewriting it from zero,... |
I'm trying to solve multicomponent Euler equations for perfect gas mixture with Godunov-like scheme using exact Riemann solver. Of course, some approximate solver would probably be more cost-effective, but for now I'd like to make it work with exact solver.
Here is the problematic part of algorithm:
We have left and r... |
I have working program for solving one-component 1D Euler equations with Roe's approximate Riemann solver constructed according to this pdf. My implementation of the algorithm is as follows ($\rho$ is density, $u$ is velocity, $h=\frac{e+p}{\rho}$ is total specific enthalpy, $c$ is speed of sound):
First, we compute Ro... |
I may be incorrect, but it seems like commercial graphics codes typically use smoothed particle hydrodynamics (SPH) to produce stunning simulations and not continuum based methods. Why is this? Is SPH much less costly than continuum methods?
If it is that case the SPH is much less expensive than direct numerical simula... |
I'm trying to calculate the xyz velocity vectors for a circular orbit given a set of position vectors, but I can't seem to get it right.
The formula for obtaining the velocity magnitude is the square root of gravitational constant multiplied by the mass of the primary divided by the distance from the primary to the ob... |
I have a somewhat large (20+ dimensional) root finding problem that I'm solving with Levenberg-Marquardt. One of the functions has box constraints on [0, 2]. When it is against those bounds it will not be able to find a zero of the function. Leaving that in the solution and letting the optimizer try to find a minimu... |
Let us think on the Poisson equation $\nabla^2 u(\bf{x})=\rho(x)$ with Neumann boundary conditions, with $\bf{x}=\it (x,y)$ in 2D.
Here is a stencil with central differences in both $x$ and $y$ (forgive my label $t$ on the vertical, it is supposed to be $y$) directions.
with $\beta=\Delta x/\Delta y$. More specifica... |
Recently, I have taken an interest in performing combinatorial analysis for the game of 21 (blackjack) and attempted to use my AMD APU to try and thread the program via the 4 cores on the chip. Generating the proper strategy and expectations has proven to be a success, as well as taking very few seconds (around 12) to ... |
I'm a noob into eigenvalues algorithms, but something call my attention. QR algorithm works with real/complex matrices producing real/complex eigenvalues. However, it can not produce complex eigenvalues from a real matrix. Here a simplistic example written in Julia and derivated from here and here:
using LinearAlgebra
... |
To implement maximum likelihood estimators, I am looking for a good C++ optimization library that plays nicely with Eigen's matrix objects. Eigen has some capability of interfacing of its own but if anyone here has experience of using Eigen with an optimizer library in tandem, that would be great!
I am aware of similar... |
$\vec{a}\cdot\vec{b} \approx c$
$\vec{\alpha} \cdot \vec{\beta} = c$
$\vec{\alpha}$ is close to $\vec{a}$ and $\vec{\beta}$ is close to $\vec{b}$
Given $\vec{a}$, $\vec{b}$ and c, how to find $\vec{\alpha}$, $\vec{\beta}$ quickly?
If necessary, I can assume distance between $\vec{\alpha}$ and $\vec{a}$ is usually m... |
Consider the least squares problem,
$$
\min_{\mathbf{a},\mathbf{b}} || \mathbf{f}(\mathbf{a},\mathbf{b})||^2
$$
where $\mathbf{a},\mathbf{b}$ represent the unknown parameters to be found. In my problem, the parameters $\mathbf{a}$ appear linearly in the residual vector $\mathbf{f}$ while the parameters $\mathbf{b}$ are... |
The system in the title has a damper factor $\lambda > 0$ and the matrix $A$ is sparse and rectangular, with a structure I can exploit to solve matrix vector products very fast. My current solver, LSMR, is trying to solve the normal equations $(A^TA + \lambda I) x = A^T b$ associated to the original problem $\min \|Ax ... |
Consider two sets of points $P = (P_1, ...,P_n), \ Q = (Q_1, ..., Q_m) $ included in $\mathbb{R}^3$.
I'm looking to compute an optimal affine transformation that "maps" $Q$ to $P$, although the sets don't have the same number of elements.
A trivial case is one where $m=n$ and $Q = (R \cdot P_1 + T, R\cdot P_2 + T, ..... |
Given
\begin{equation}
A_i=B+C_i
\end{equation}
where $A_i$,$B$ and $C_i$, $i=1,\dotsc,N$ are large square matrices, $B$ is symmetric, $C_i$ are zero matrices aside for a square block on the diagonal.
I would like to factor the $A_i$, preferably but not necessarily by $LU$ decomposition, but I don't want to do this rep... |
I was reading the documentation of the MatLab ODE solver ode23t, and I've seen that the trapezoidal rule is used.
Moreover, the error is estimated by differentiating a cubic polynomial, and that's still fine to me.
My big question is about the step size selection: most of ODE solver usually are embedded Runge-Kutta m... |
I'm extremely new to Autodesk CFD, and I'm working on a project that deals with diodes heating up and cooling down based on a fixed temperature regulated by a temperature switch. Basically, I have a string of 6 diodes soldered together hooked up to a temperature switch, and when the diode temperature reaches 150C, the ... |
I am trying to numerically solve the following PDE,
$$\frac{\partial u^A}{\partial t} = c_1\frac{\partial^2 u^A}{\partial^2x} \,,$$
where $c_1$ is a constant. The above can be discretized using the numerical approximations
$$
\begin{align}
\frac{\partial u^A}{\partial t} & ~\Rightarrow~ \frac{u_{i}^{t+1} - u_i^t}{\Del... |
Can anybody explain me the relation between the condition of a Matrix and the convergency of a problem.
For example how is the relation between the condition of the stiffness Matrix occuring in FEM to the convergency of the FEM method?
Thank you!
Note: For example I want to solve problem In weak formulation: find ... |
I want to uniformly sample a point within each of $10^5$ convex polytopes in each iteration of a solver.
The polytopes in one iteration are completely different from the polytopes in another iteration.
The dimension of the space is about 15.
The vertices of each polytopes are known.
I only want one point per polytope... |
I have implemented a small compressible Euler solver, discretizing in primitive variables (rho, u, v, p) with standard Galerkin FEM P1 triangular elements, and mixed isotropic and anisotropic/streamline diffusion for stabilization.
I have verified the solver on several test cases with shock tube, double shocks, and flo... |
I would like to numerically solve the following system of coupled nonlinear differential equations:
$$
-\frac{\hbar^2}{2m_a} \frac{\partial^2}{\partial x^2}\psi_a + V_{ext}\psi_a +
\left( g_a |\psi_a|^2 + g_{ab} |\psi_b|^2 \right)\psi_a = \mu_a \psi_a
$$
$$
-\frac{\hbar^2}{2m_b} \frac{\partial^2}{\partial x^2... |
Is there any software available which can directly render higher order finite element results? In particular, 3D finite elements would be preferable. It seems gmsh has some capability in this regard but am looking to explore more options.
Also, when I say "higher order" I mean rendering of quadratic and above elements.... |
I would like to extremize a certain function $f$ with respect to a parameter $x$, under constraints $g_1(x) = 0, ..., g_m(x)=0$. In order to achieve this, I consider the Lagrangian function $L(x, \lambda) = f(x) - \sum_{i=1}^m\lambda_i g_i(x)$ and look for a stationary point.
In my particular case, this amounts to look... |
I am attempting to solve for a displacement field where I know the thermal stresses on my discretized domain, which consists of hex cells.
My first question is: is easier way to solve for the displacements besides integrating the linear elasticity equations:
$$
\nabla \cdot \sigma = 0
$$
where $\sigma$ is stress (cont... |
I'm trying to understand the Schrödinger equation and solving it a bit better, and I'm running into some doubts while coding, even though I am adapting the code to this situation. Also I tried asking this on the physics stack exchange and I was directed here.
this is the situation I am trying to solve:
It's supposed t... |
There is a lot of literature that indicates using rand() for simulations might be harmful. A couple of them are as follows:
https://www.sciencedirect.com/science/article/pii/S0167947398800029
https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful
A common recommendation has been to use the ran1/ran... |
Im just working on a preconditioner for the linear equation system $Ax = b$ arising in FEM for elliptic PDE. $A$ is a s.p.d Matrix with real valued entries. I read something about the element by element preconditioner and now I have a question about the following:
Defining a preconditioner $P$ such that $P \approx A$. ... |
I'm trying to simulate basic semiconductor models for pedagogical purposes--starting from the Drift-diffusion model. Although I don't want to use an off-the-shelf semiconductor simulator--I'll be learning other (common, recent or obscure) models, I do want to use an off-the-shelf PDE solver.
But even for the simple 1D ... |
Can someone please explain what is the Sherman-Morrison formula and it's specialities when it comes to matrix calculations? I'm a little bit confused on understanding how the preconditioning works with Sherman-Morrison formula.
|
I am having trouble with a C/C++ program that uses the BLAS routine ddot.
I am running Linux and so far LAPACK routines worked without any problems.
I get a wrong result, no matter if I choose the type int for integer arguments of ddot or if I choose ptrdiff_t.
The Code is:
#include <iostream>
#include <stdlib.h>
using... |
I am dealing with a *.cgns file. This mesh format, when saved as an unstructured grid, holds nodes coordinates, nodes connectivity per element and boundary conditions. It is a neat mesh format with good documentation. However, I am still responsible for building the rest of the data structures for the calculations. For... |
I am aware than Euler explicit is conditionally stable, and Euler implicit is unconditionally stable. And I am aware that it is probably pointless to use Euler implicit with a small computational step $\Delta t$ for which Euler explicit is stable. But from a theoretical point of view, should one of the two be more accu... |
What is the best approach to go about solving a PDE problem of the type
\begin{equation}
k^3\Delta u - k(\mathbf{1}\cdot\nabla u) = 0\, ,\\
u=g\; \text{on}\; \Gamma_D\, ,\\
mean(u) = u_\text{mean}
\end{equation}
where one wants to find for which positive constant scalar coefficient $k>0$ the mean of the solutio... |
I'm trying to solve
$
\begin{cases}
-u''=f \\
u(0)=0 \\
u(1)= \alpha
\end{cases}
$
with FEM using reference elements and local coordinates.
So we have the global matrix $K_{ij}=\int_\Omega N_i'(x) N_j'(x)$.
Computing each local matrix for a 2noded element, I have $K^e(\xi)=\begin{pmatri... |
I am trying to run an MD simulation using this generalized version of Lennard Jones.
$$
U(r) = \left(\frac{r_0}{r}\right)^A -\frac{A}{B}\left( \frac{r_0}{r} \right)^B
$$
However, I do not know how to implement this potential in Lammps.
I have been going through the manual and, as far as I cal tell, this potential is... |
When solving $A*x=b$ using preconditioned conjugate gradient methods one has to solve $z=K^{-1}*r$ for the preconditioning where $K$ is the preconditioner of $A$ and $r$ is the residual vector.
Instead of performing classical preconditioning like incomplete Cholesky or ILU one can also perform one V-cycle of algebraic ... |
Let's say, I have a compact area $S$ (for example a circle, a square or some arbitrary polygon) and a function $f: S \rightarrow \mathbb{R}$. I want to numerically calculate the Integral
$$ \int_S f(\vec{x})\ \mathrm{d}x \approx \sum_i f(x_i)\Delta x_i $$
of the function over $S$.
My question is, how to choose the sapl... |
The convolutional layers are most computationally intense parts of Convolutional neural networks (CNNs).Currently the common approach to impement convolutional layers is to expand the image into a column matrix(im2col) and perform and perform Multiple Channel Multiple Kernel (MCMK) convolution using an existing paralle... |
I want to discretize the following problem
\begin{cases}
\mu \nabla^2u+(\lambda+\mu)\nabla \nabla\cdot u = \rho \frac{\partial^2u }{\partial t^2 } + \beta \frac{\partial u}{\partial t}\\
u(x,y,t) = c, (x,y) \in \partial( [0,L_{x}]\times [0,L_{y}]), t \in [0,T]\\
u(x,y,0) = u_{0}(x,y), (x,y) \in [0,L_{x}]\time... |
I am implementing an optimization problem using semi-definite approach. One of my constraints is of following form
$ trace(A∗X)−(k∗trace(A∗X))+(k∗\sqrt {(trace(B∗X)} )==0$
where k is a constant, A and B are constant complex hermitian matrices, $B=A^2$ and $X$ is $m∗m$ complex, hermitian semi-definite matrix optimizatio... |
I am trying to factorize the following Laplacian matrix in terms of $ D^TD$, D is the first derivative matrix.
The tridiagonal form of the secon derivative matrix using Neumann boundary condition is given by,
$\begin{bmatrix} -1 & 1 & 0 & 0 & 0 \\ 1 & -2 & 1 & 0 &0\\ 0 & 1 & -2 &1&0\\0&0&1&-2&1\\0&0&0&1&-1\end{bmatrix... |
I'm trying to solve the following system of differential equations numerically. What are the available finite difference approaches and matlab solvers to solve such a system? Other approaches to solve the problem are welcome as well. The first two equations are quasi-steady and the rest of the equations have time deriv... |
I need to compute a matrix-matrix product, $A^T B$, where $A$ is $n \times r$ sparse, and $B$ is $n \times q$ dense. The number of rows $n$ is far larger than both $r$ and $q$. In fact $n$ is so large I cannot store the entire matrix $B$ in memory, so I build it one row at a time and update the matrix product $A^T B$ a... |
For an ODE:
$\frac{dy}{dt}=f(y(t),t)$
The Euler Explicit scheme reads:
$y_{n+1}=y_{n}+\Delta tf_n$
and it can be easily shown with a Taylor expension that:
$y_{n+1}=y_{n}+\Delta t \frac{dy}{dt}|_n+\Delta t^2 \frac{d^2y}{dt^2}|_n$
and therefore by comparing the scheme with the Taylor expansion we have:
$LTE= O(\Delta t... |
I am working on determining the spatial information of a set of $M$ points in $N$-dimensional space. It is well-known that the construction of Delaunay triangulation is expensive in high dimensional space. Thus, I would like to only find the largest simplex of $N$-dimensional Delaunay triangulation (DT). I am going to ... |
the classical Newton's method for non-linear systems of equations is $x_{k+1} =x_k-J_F(x_n)^{-1} F(x_n)$. In pratice, rather than compute the inverse of the Jacobian matrix, one solves the systems $J_F(x_k) (x_{k+1}-x_k)=-F(x_k)$, for the unknown $x_{k+1}-x_k$.
In my notes (about ODE) I found:
Newton's method require... |
Lanczos/Arnoldi/Rietz/CG-like algorithm share the same core strategy...
In each, a little miracle appears, most of the Gram-Schmidt inner products are zeroes! In others words, new direction need only get orthonormalized with the one previous updated search direction (or two in Lanczos case), no need to check other prev... |
I'm searching for lower bounds of bilinear forms arising in FEM for elliptic second order PDEs with mixed boundaries.
I did some research and found:
$$\max_{v_{h}\in\mathcal{V}_h(\mathcal{\Omega})}a(v_{h}, v_{h}) \geq Ch^{d-2}\, ,$$
where $d$ is the Dimension of the domain, $C$ a positive constant and $h$ the mesh size... |
I work in Python 3 on astrophysics projects. I need to compute the smallest circumscribed circle of a set of points in the sky (so described by Right Ascension and Declination). I have found a code here (real-time demo here).
It implements an algorithm in $\mathcal O(n)$ instead of the naive $\mathcal O(n^4)$ one, whi... |
I need to compute a $n-$dimensional integral with $n<10$ on a convex polytope. Since most numerical integration libraries (e.g. Cuba) expect the function to be integrated defined inside an axis aligned bounding box (AABB), I need to compute a (minimum volume) AABB enclosing the polytope. Since the polytope is defined b... |
I'm trying to understand the asymptotic error behaviour of forward Euler (finite difference method), as timesteps are decreased (refined), so I feel trust in the method of manufactured solutions (MMS).
But looking at a simple model of a ball accelerating, I noticed you can make the error asymptote to whatever you want.... |
I have a trouble of defining a Jacobian matrix for my problem. Basically, I have 4 differential equations to be solved.
$$
\begin{aligned}
\dot x_1(t)&=x_2(t)\\
\dot x_2(t)&=p_2(t)−\sqrt 2 x_1(t)e^{-αt}\\
\dot p_1(t)&=\sqrt 2p_2(t)e^{-αt}+x_1(t)\\
\dot p_2(t)&=−p_1(t)
\end{aligned}
$$
with initial and boundary values o... |
Is there any library or routine for high-performance matrix-matrix product, where the matrix elements are computed on-the-fly using a given function of $i$ and $j$?
More specifically, in the problem I am currently facing, I have to compute a matrix-matrix product
$$
\mathbf{y} = \mathbf{A} \mathbf{b}
$$
where $\mathbf{... |
I am writing a model for an optimization problem. I need to write the following constraint:
$$\sum^{N - 1}_i \lvert (a_i - a_{i+1}) \rvert \leq 2\, .$$
How to write this constraint (or linearize)?
Is it permissible to use absolute value constraints in an optimization problem (even for nonlinear programming)?
After I ... |
I have a quick questions which has been troubling me lately.
When reading the FENICS Finite Element Book they assess various approaches to solver the Stokes equation. Obviously, they discuss the notion of elements that satisfy the LBB conditions, but they also discuss stabilized method. They briefly explain that the co... |
I have a system of nonlinear equations on the general form:
\begin{align}
\mathbf{M}(\bar{y})\dot{\bar{y}} =\bar{f}(\bar{y},t)
\end{align}
Where $\mathbf{M}(\bar{y})$ is a matrix and $\bar{f}$ is a system of non-linear functions acting on $\bar{y}$. This system has many stiff elements and so i wish to solve it using th... |
I have ~30 non-negative variables and 24 equations and I want to find out the upper and lower bound for each variable. Feasible solutions are guaranteed.
So for each variable, I solve two LP problem, one for min and one for max
$$
\begin{array}{rl}
\min & c^T x\\
\textrm{s.t.} & Ax = b\\
&x\geq0
\end{array}
$$
where $c... |
I wonder if there are any theorems which can help me to calculate an upper bound for the spectral norm of:
$$\left\| \left[ I + \sum_{i=1}^{\overline{n}\in\mathbb{N}} \big( C_i - I\big)\right]^{-1}\right\|_2$$
with the identity matrix $I \in \mathbb{R}^{n\times n}$ and $C_i$ are triangular matrices arising from a Cho... |
Statement of the problem
Suppose, we consider the following model
$$
\begin{array}{l}
(1)~\mathbf{u}_t + \mathbf{F(u)}_x = \mathbf{S}(\mathbf{u},\mathbf{w}), \\
(2)~\mathbf{w}_x = \mathbf{P}(\mathbf{w},\mathbf{u}).
\end{array}
$$
Computational domain to be as follows $(x,t)=[0,L]\times[0,T]$. Let's consider Neumann bou... |
I need to solve a simple, low-dimensional Hamilton-Jacobi-Bellman equation.
Is there a simple guide for doing this numerically using finite-difference schemes? I found a few research articles discussing higher order methods or discussing theoretical properties of numerical schemes but nothing that really helped me, as... |
I am using 3D FEM with 8-node brick elements to model a certain type of growth/expansion, which is not a plastic deformation. First, I apply a pressure/load and I get displacement and the new position of nodes and calculate stress/strain. Next, I would like to change the 'edges' relaxing length (different edges by diff... |
The condition number of function evaluation
$$
\mathrm{cond}(f,x) := \left| \frac{x f'(x)}{f(x)} \right|
$$
is infinite at a root of $f$. Hence it is useless for rescaling a tolerance which defines an exit condition from Newton's method. For instance, naively, you would exit the Newton iteration
$$
x_{k+1} := x_{k} - f... |
I want to minimize a cost function of the form,
$$
\min_{q,t}\left(q^T\left(\mathcal A + \mathcal B\right)q + t^T\mathcal C t+\delta t+\varepsilon Q(q)^TW(q)t+\lambda\left(1-q^Tq\right)^2\right)
$$
with the Levenberg-Marquart method using scipy.optimize.least_squares function. But I do not see how to formulate it in te... |
For the diffusion equation
$$
\frac{\partial u(x,t)}{\partial t} = D \frac{\partial ^2 u(x,t)}{\partial x^2} + Cu(x,t)
$$
with the boundary conditions $u(-\frac{L}{2},t)=u(\frac{L}{2},t)=0$ I've programmed the numerical solution into python correctly (I think).
import numpy as np
import matplotlib.pyplot as plt
L=np.... |
In my numerical linear algebra class, I learned that for some matrices, it could have an element that is a very small number that is approximately 0 (and many orders of magnitude different from all the other non-zero elements), can destroy the conditioning of a matrix.
Now I am wondering how this works practically. Whe... |
I recently moved towards computational biophysics from an experimental science background. As of now, I am learning the fundamentals and doing some basic monte carlo simulations of LJ fluid on my desktop PC. However, when I tried to run my code on the cluster, it was equally or more slower than my desktop. Later, my la... |
when solving the advection equation in 1D that is:
$$ \frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x} = 0 $$
with $ u'(t,0) = 0$ and $u(t,L) = 0$ , $u(0,x) = u_{0} $
one numerical scheme is the FTCS (Forward time-centered space), but this numerical scheme is unstable.
$$\frac{u_{j}^{n+1}-u_{j}^{n}}{ ... |
I'm using SIMD processor arrays to compute the eigen-decomposition for large numbers of small (up to $32\times 32$) matrices. For assorted technical reasons, Jacobi iteration maps well to the SIMD architecture and gives excellent results for diagonalisation of symmetric, Hermitian and normal matrices using unitary simi... |
I am repeatedly solving quadratic program,
$x^T Q x$ with time dependent linear constraints $Ax=b_t$.
Dimension of $x$ is around 10000 and there are around 50 constraints. I want to solve the system as fast as possible at each time $t$. I know that $b_t$ and $b_{t+1}$ are pretty close, say, in L2-norm. I also know, th... |
I bought three boxes of tea bags with different flavors (A, B, C).
I wish to mix them in such a way that
- there is never two consecutive bags of the same flavor (ABCCAB is avoided) ;
- the mixing is the "most" random, i.e. avoid patterns such as ABCABCABC... or
ABABAB...BCBCBC...CACACA.
Is there a known algorithm fo... |
I am looking for some intuition in making comparisons of FEM simulations to experimental measurements. In particular, I am interested in comparisons to strain gauge readings, and perhaps even LVDTs.
From an FEM simulation, the strains you compute would typically be at a certain node's location. For an FVM simulation, ... |
If you compute 1+x for x less than the machine precision, the answer will be 1 which is the exact result for x = 0. But this would then imply that the relative backward error is |0 - x| / |x| = 1, i.e. this method is not backwards stable and no method based on standard floating point arithmetic can ever be.
It feels l... |
In my full 3D solutions I am solving for the potential throughout a $100\times 200\times 200$ grid. Inside is a ring electrode set to -5V via a Dirichlet boundary condition, and surrounded on all sides by Dirichlet boundary conditions at 0V.
When I solved for this setup in full 3D vs solving for the same setup in 2D ax... |
I am (naively) trying to solve the 2d wave equation with finite differences. But the system blows up instantly.
For simplicity I set the constant $c=1$, then I am left with
$$\Delta u =u_{tt}.$$
I set up the FDM with
N = 9
u = np.zeros((N**2,1))
u.reshape(N,N)[N//2,N//2] = 1
Now, at the time t=0 the function looks l... |
I am running simulations of a cantilever beam where it is fixed on one end and negative force applied to the other end. The first simulation is with 4-node linear quadrilateral elements and the other is simulation with 9-node quadratic quadrilaterial elements. At first I ran the simulations with a poisson's ratio of 0.... |
I'm given a matrix. How do I find the nearest (or a near) positive definite from it?
The matrix can have complex eigenvalues, not be symmetric, etc. However, all its entries are real valued. The resulting matrix from the algorithm must be positive definite, with all its entries real valued only. Symmetry is a plus, but... |
The original post was on stackoverflow : I transfert it here.
I have to solve numerically the advection equation with periodic boundaries conditions : u(t,0) = u(t,L) with L the length of system to solve.
I start also with u(0,x) = uexacte(0,x) = sin(2*pi*x/L)
Here the main part of the code with loop time (we use here ... |
I am poking at reproducing some fundamental research in group theory. In particular, I want to reproduce the OEIS sequence #1. The crux of the problem is not generating potential groups, this can be accomplished by a sat-solver and about 20 lines of code, but determining which of those groups so generated are isomorp... |
There are a lot of algorithms which seem to have been supplied an official number, such as Algorithm 76, Hierarchical clustering using the minimum spanning tree. Another example is Algorithm 123, Single Transferable Vote by Meek's Method. These numbers seem to refer to some official registry, but I haven't been able to... |
The question is pretty much the title. Note that I have lots of experience using open-source meshing tool, e.g. Gmsh and OpenFoam blockMesh & snappyHexMesh. Nevertheless, I have no idea on how to generate the 2D mesh shown below when doing some simple test in SU2 (CFD code).
I believe some commercial meshing kits can d... |
I have an array of length L with N zeros, and L-N non-zero values. I have another array of length N. I would like to put the values of the shorter array into the positions of the longer array which are zero, keeping them in order. For example, if I had,
$$
L = \, [1,2,3,0,0,4,5,6,0]
$$
$$
N = \, [10,0,20]
$$
I would wa... |
Compared to the transient PDE for linear elasticity, the steady equations appear to less well-conditioned. Are they inherently ill-conditioned without the transient term?
The condition number for the operator matrix seems to be fairly large (at least $O(10^4)$) for all the problems that I have solved. Is this fairly n... |
In an attempt to create three-dimensional volumes with inclusions in Gmsh I stumble upon a problem which was non-existent in the two-dimensional case.
I'm using the OpenCASCADE geometry kernel because this facilitates convenient boolean operations to remove parts of the inclusions outside my considered domain box.
In ... |
I am trying to understand the meshless methods as described in https://arxiv.org/pdf/1409.7395.pdf. I'm having trouble understanding the following step: (Page 7, just after equation 17)
Now, rather than take the flux functions F directly at the particle location and time of i or j, in which case the scheme would
req... |
Nonlinear ODE Statement
I would like to use scipy to solve the following:
u'' + (u')^2 = sin(x)
u(0)=0,
u(1)=1
where u = u(x).
Approach
I am looking at the following link
https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.integrate.solve_bvp.html
Problem - Not sure about variable wrt x or How to in... |
I'm having two sets of grids. One is uniform and another one is not uniform. I will calculate the derivative in uniform grid points and I like to transfer(map) the derivative to the non-uniform grid points. I have the relationship between uniform and non-uniform grid points.
A similar question was already asked. I'd l... |
I am working on an FEA mesh of hexahedron elements. The elemental level calculations involve finding the surface normals and area for each surface of a hex element. I preferred the vector cross product approach. But that doesn't seem to work when the faces are non-planar. Will the isoparametric transformation of each ... |
I am trying to identify the weak form of PDE in structural mechanics. I read a lot of papers where they are using the elliptic boundary value problem
\begin{equation}
\int\limits_{\Omega} \delta \epsilon : \sigma \,d\Omega - \Big[\int\limits_{\Omega} \delta u \cdot b \, d\Omega + \int\limits_{\Gamma_N} \delta u \cdot ... |
I have a set of $K$ keywords. Each of this keywords can have set of bids from $1\$,\dots,N\$$. For each bid for a keyword, it will get a specific amount of clicks and a specific cost. Clicks and Cost are monotonic in bids. Now, the problem is this
Select a bid for each of the keyword such that overall clicks across t... |
One can use GMRES as it is, but there is also a version of GMRES called k-step restarted GMRES, which is used for large matrices, where $k$ is some fixed number of steps after which we take a new $x_0$ and restart the algorithm to save memory storage.
I want to count the number of flops and memory storage required in e... |
I am currently working on a numerical algorithm involving a lot of floating point arithmetic, involving some badly conditioned problem sets.
I am using the relation $|x - y| / (\max(|x|, |y|, 1)) \leq \epsilon$. Unfortunately, the corresponding relation $=\sim$ is not invariant with respect to additions, i.e. $x =\sim ... |
I want to obtain the algebraic values of, for example, Hermite polynomials using SciPy but in a recursive manner.
Using Maple, for example, these can be defined as
H(0,x):=1;
H(1,x):=2*x;
for n from 1 to 6 do
H(n_1,x):= 2*x*H(n,x) - 2*n*H(n-1,x);
print( simplify(%) );
end do:
I can find no way in SciyPy to do... |
I have an explicit FD (Finite Difference) code for diffusion/heat on a PDE in a cuboid domain, and it works fine. I would like to update the discretized equations and change the code so as to solve the problem on a sphere. From some preliminary searches, I can't seem to find any examples of FD on spheres using rectangu... |
I have 5 at most 4th order polynomials in 5 variables,
$$p_i(x_1,x_2,x_3,x_4,x_5) \qquad i = 1, \ldots, 5$$
where all coefficients are either rational or floating point. I'd would like to get the roots of the simultaneous equations $p_1 = 0, p_2 = 0, p_3 = 0, p_4 = 0, p_5 = 0$ and I'm partially able to do this quite ea... |
I am trying to solve a simple optimal control problem using the Hamilton-Jacobi-Bellman equation, numerically in Python. This is proving to be rather difficult as I end up having to solve the following:
$$
J_t - (J_x)^2 + x\cdot J_x = 0
$$
I believe this to be a non-linear first order PDE. Being the HJB, we are given b... |
Consider the nonlinear least-squares minimization of a vector of $n$ residuals $\mathbf{f}$ in $p$ parameters $\mathbf{x}$:
$$
\min_{\mathbf{x}} || \mathbf{f}(\mathbf{x}) ||^2
$$
This can be done with a standard Gauss-Newton or Levenberg-Marquardt approach, using the $n \times p$ Jacobian matrix
$$
J_{ij} = \frac{\part... |
Is there a faster way to check whether $A\in\mathbb{R}^{n\times n}$ is positive definite on $b^{\bot}:=\{x\in \mathbb{R}^{n}: x\cdot b=0\}$ than
function foo(A,b)
N = null(b);
e = eig(N'*A*N);
return all(e>0);
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.