All Questions

Filter by
Sorted by
Tagged with
4
votes
0answers
70 views

Identifying an unknown P.D.E. from solution data

I have a black-box simulation that produces the time evolution of a probability density function p(x, t) in 1 dimension from arbitrary initial conditions p(x, 0). The underlying simulation occurs on a ...
0
votes
0answers
32 views

Biot-savart numerical integration

I have a mesh structure of tetrahedrals and I know the current density on each node. I want to evaluate the magnetic flux density. Therefore, I use Gaussian quadrature. However, I do not know how to ...
0
votes
1answer
150 views

coarsening coefficient matrixes (A2h, A4h...) for geometric multigrid method in 2-D/3-D

I am learning about multigrid methods from the textbook section 6.3 Multigrid Methods, which shows a geometric multigrid algorithm for 1-D examples in detail, including how to build restriction/...
2
votes
0answers
38 views

Extracting a mid-plane for thick shell analysis

I have a complex part that contains features of the form shown in the figure below. Because of the cost of 3D finite element simulation of the part, I want to try an analysis with 2D thick shells. ...
9
votes
1answer
1k views

Sensitivity of $y$ w.r.t. to $x$ in $y=f(x)$ where f is a routine

Given a model $f$ as a programming routine, such that we are able to compute $y=f(x)$ for any $x \in \mathcal{D}$, I am interested in the sensitivity (or let us say derivative) of $y$ with respect to $...
3
votes
0answers
55 views

Typo in a-priori error estimate in a Discontinuous Galerkin paper

I'm looking at this famous paper which is available in the link below: Franco Brezzi, LD Marini, Endre Süli, Discontinuous Galerkin methods for first-order hyperbolic problems, Mathematical Models ...
33
votes
6answers
28k views

What is the fastest way to calculate the largest eigenvalue of a general matrix?

EDIT: I am testing if any eigenvalues have a magnitude of one or greater. I need to find the largest absolute eigenvalue of a large sparse, non-symmetric matrix. I have been using R's ...
11
votes
1answer
481 views

DG local equation, how to interpret mean-averaged test function

In the paper http://www.sciencedirect.com/science/article/pii/S0045782509003521, an HDG element-local equation is described on page 584 equation (4), with one of the equations taking the following ...
4
votes
2answers
304 views

Computing size of N-Dimensional Polynomial Basis and Efficient Representation of Basis

A problem I have had on my mind recently has been a compact way to compute the size of an $N$-Dimensional Polynomial basis of some order $p$, where a linear basis is $p=1$. I have attempted searching ...
5
votes
1answer
174 views

Discrete divergence free functions

I'm studying the weak formulation of NS equations. During the analysis, the book I'm using (Quarteroni-Valli, page 301-302), defined $$Z_h=\{v_h \in V_h: (\operatorname{div}(v_h),q_h)=0 \quad \forall ...
2
votes
1answer
66 views

Derivation of a parabolic PDE using Alternating Direction Implicit method

I have a very simple question concerning Alternating Direction Implicit (ADI) Scheme. If I have an equation of the form: \begin{equation*} \frac{df(x,y,t)}{dt} = \nabla^2 f(x,y,t) + f(x,y,t) \end{...
1
vote
1answer
46 views

Definite Numerical Integration with Unknown limit

How to solve for small gamma in the integral equation in Scipy ? I recognize it has to be solved with both the numerical integral and a root solver (Newton's method) $$ \int_{\gamma}^{+\infty}f(x) dx =...
1
vote
1answer
63 views

Finite element method with two different Dirichlet boundary conditions

I have the problem like this $$ -\triangle u = f \ \ on\ \Omega \\ u = g_1 \ \ on \ \partial \Omega_1 \\ u = g_2 \ \ on \ \partial \Omega_2 $$ If we choose $$ V_1 = \{ \nu_1 \in H^1 : \nu_1 = 0 \ ...
0
votes
0answers
23 views

Computing Row-Wise Divergence of Matrix-Valued Functions by Automatic Differentiation

Suppose I have some matrix-valued function $B : \mathbf{R}^d \to \mathbf{R}^{d \times d}$, and I want to compute the row-wise divergence of $B$, given in vector form as \begin{align} \alpha &:= \...
0
votes
1answer
107 views

interface value on the error equation

https://www.jstor.org/stable/pdf/2157482.pdf, here I have a problem in last equation of (2.6) in section (2.1). When they are considering error equation on the interface $\Gamma$ they get $e_v^{(n)} = ...
2
votes
1answer
958 views

Local truncation error of Dufort Frankel Scheme

The scheme is given by $$\frac{v_m^{n+1}-v_m^{n-1}}{2k} + b\frac{v_m^{n+1}+v_m^{n-1}-v_{m-1}^n-v_{m+1}^n}{h^2} = 0$$ where $v_m^n$ is the numerical solution at the $m^\text{th}$ spatial coordinate ...
0
votes
0answers
82 views

Find coefficients in general second order differential equation

Suppose you have a system that can be described via the following equations of motion: $$\ddot{y}+\delta(t)\dot{y}+\alpha(t) y = \gamma\sin(\omega t)$$ The functions $\delta(t)$ and $\alpha(t)$ are ...
18
votes
4answers
2k views

Why do we usually not want the eigenvalues of non-symmetric matrices?

I came across this line in a class note I am reading where it discusses finding eigenvalues of matrices. In reality we don't go all the way with Arnoldi. We stop at a decent value of 𝑘. Then the 𝑘 ...
0
votes
1answer
60 views

Expressing a Constraint in an optimization problem

If I have a vector of M "continuous" decision variables (say it is called x) , and if I want a constraint to express that only one of them is allowed to have a nonzero value (i.e. no more ...
0
votes
0answers
49 views

O(N^2 k) implementation of non-random truncated SVD

I am looking for an implementation that calculates a truncated singular value decomposition (SVD) of a dense NxN matrix in O(N^2 k) steps with a deterministic rather than randomized method. (Here, 0&...
4
votes
1answer
130 views

Discontinuous Galerkin: confusion about the weak formulation for linear advection equation

In an introduction to Discontinuous galerkin methods, I have some problems in checking the weak formulation. I'm looking at page 16 here The context is the advection reaction equation: $$\operatorname{...
0
votes
1answer
644 views

How to make a less diffusive code to solve 2D advection equation?

I would like to solve the following differential equation numerically in 2D, $$\frac{\partial z^-}{\partial t}+(\vec{B}\cdot\vec{\nabla})z^-=0,$$ see Wikipedia if you are curious about what the ...
3
votes
1answer
94 views

Preconditioning a least-squares problem?

I need to solve an equation system $$ \begin{pmatrix} A \\ I \end{pmatrix} x = \begin{pmatrix} b_0\\b_1 \end{pmatrix} $$ in the least-squares sense. Let's assume $I$ is the $n$-by-$n$ identity matrix, ...
0
votes
2answers
111 views

Integrate a function from samples using computer codes

I have a function $c ( I (\vec{r}) )$. Not a constant, $c$ doesn't denote a constant. So $c$ is a function of $I$ which is a function of $\vec{r}$. $I$ is an intensity (W/cm2). This $c$ is hard to ...
1
vote
1answer
52 views

QUICK scheme derivation

I am reading about QUICK scheme for calculating the value of unknown variable $\phi$ in finite volume method. Given a locally one dimensional flow, we assume the value of $\phi$ is computed as a 2nd ...
2
votes
1answer
95 views

Discontinuous Galerkin order of convergence on arbirary refined mesh: step-12 deal.ii tutorial

I'm learning DG methods and in order to practice a little bit I'm using the deal.ii library. In particular, I'm looking at step-12, where they solve $$\operatorname{div}(\beta u) = 0$$ $$u = g_D \text{...
1
vote
3answers
142 views

preconditioner for Laplace "without" boundary values

I'm looking at solving systems with the FEM discretization $$ -\int_\Omega (\Delta u) v = \int_\Omega \nabla u \cdot \nabla v - \int_\Gamma (n\cdot\nabla u) v. $$ without applying Dirichlet- or ...
3
votes
0answers
79 views

Numerical Soultion to Background equations of cosmology

I am trying to solve the background equations of cosmology numerically using Runge-Kutta Dormand Prince method with simplified assumption $8\pi G=1$ and $c=1$. The equations are $$\ddot a = - \frac{1}{...
5
votes
1answer
160 views

Write incompressible Navier Stokes as ODE in $(\mathbf{u},p)$

Consider the Navier stokes equation after the discretization with conforming finite elements with source term $f=0$. We have the algebraic structure of a saddle point problem: $$M \dot{u} = f- Au -B^...
1
vote
0answers
65 views

Binarization for optimization problems

I have a nonlinear mixed-integer optimization problem, and because of very high complexity when solving it using methods like Branch and Bound, I resorted to solve it using alternating method and ...
0
votes
1answer
333 views

Proving solution existence and uniqueness of the Helmholtz equation with Robin boundary conditions with complex coefficients

I am trying to solve the Helmholtz equation with Robin boundary conditions with complex coefficients and the weak formulation $$ \iint_\limits\Omega\nabla p_0(x,y)\nabla\left(\overline{v(x,y)}\right)...
25
votes
3answers
16k views

Recommendation for Finite Difference Method in Scientific Python

For a project I am working on (in hyperbolic PDEs) I would like to get some rough handle on the behavior by looking at some numerics. I am, however, not a very good programmer. Can you recommend ...
1
vote
2answers
33 views

scipy odeint: excess work done on this call depending on initial values even with analytically solvable ODE

I am trying to solve a differential equation in the form: dx/dt = funct(x) using scipy odeint. However, for some initial values, I get a "ODEintWarning: Excess work done on this call", even ...
5
votes
1answer
128 views

Solving absolute value systems

Let $z, b \in \mathbb R^n$, $A \in M_n (\mathbb R)$ and $|z| := (|z_1|, \dots, |z_n|)$. I am searching for an efficient algorithm to solve the absolute value system: \begin{equation} z - A |z| = b. \...
22
votes
5answers
8k views

Why should non-convexity be a problem in optimization?

I was very surprised when I started to read something about non-convex optimization in general and I saw statements like this: Many practical problems of importance are non-convex, and most non-...
3
votes
1answer
153 views

Time discretization Navier Stokes equation

This question is a follow-up of this one. The weak form of Navier Stokes equation is (assuming $v,q$ test functions for the velocity and the pressure, respectively) $$(\frac{du}{dt},v)_{\Omega} + (\...
0
votes
0answers
35 views

Plotting the motion of a positive charge in a cylindrically symmetric magnetic field

I want to plot the motion of a positive charge in a cylindrically symmetric magnetic field. I am assuming a cylinder around the z-axis, with the magnetic field going in clockwise direction. The B-...
12
votes
1answer
5k views

Meaning of "-0.0" in Python?

We are finding in Python some occasional errors in our coordinate transforms and other similar computations that produce a result of -0.0. What purpose does this ...
-1
votes
1answer
82 views

Solving ODEs, Rotations, Angular Velocity, Euler Angles

I am implementing a simulation that needs to rotate and object based on known angular velocity (assumed constant for simplicity). I followed the ideas given below, pg. 32) https://graphics.stanford....
1
vote
0answers
87 views

Efficient multidimensional numerical integration in R and C++

I'm trying to perform a 4-dimensional numerical integration in R using a function I wrote in C++ code which is then sourced in <...
0
votes
1answer
336 views

Global stiffness matrix from element stiffness matrices for a thin rectangular plate (Kirchhoff plate)

I have the element stiffness matrix for a thin "kirchhoff" plate. The plate is 3 [m] x 5 [m] and is simply supported on all edges. It's thickness is 0,2 [m]. On the plate there acts a ...
1
vote
1answer
115 views

Reason behind different outputs for Fast Fourier Transform in Numpy and Matlab

Here is the output of Numpy np.fft.ifft([0, 4, 0, 0]) array([ 1.+0.j, 0.+1.j, -1.+0.j, 0.-1.j]) # may vary Here is the output of Matlab ...
-1
votes
2answers
82 views

CVODE Warning: Internal t = *** and h = 2.09813e-13 are such that t + h = t on the next step. The solver will continue anyway

I have a system to simulate the bubble evolution at different temperature conditions. I used CVODE_DENSE algorithm to solve the ODEs and get the bubble size and ...
4
votes
1answer
106 views

How can i solve these Coupled differential Equations?

I am trying to solve this with odeint module. But the first equation is function of second equation. If i ignore dw/dz in first equation and second equation is function of first one. I can solve it ...
1
vote
1answer
110 views

Is it possible to resample grid in such a way so that continuous objects remain continuous?

Suppose I rasterize a rectangle of width 2.5 gridpoints and get the values as shown: =============== | 0 | 1 | 1 | 0.5 | 0 | Now I resample that ...
2
votes
1answer
63 views

Python documentation on creation of an exponential random variable [closed]

I didn't really know if this stack was the right place to post but I was reading the documentation for creating an exponential random variable in numpy. But isn't there a typo. Like shouldn't it be : $...
9
votes
1answer
405 views

Increasing V-cycles for constant Coarsest Grid Size and increasing Fine Grid size

Problem statement I implemented geometric multigrid for $-\nabla^{2}=f$ where $f=\frac{3\pi^{2}}{4}sin \frac{\pi x}{2} sin \frac{\pi y}{2} sin \frac{\pi z}{2}$ on $\Omega \in [0,1]$ on a unit cube. ...
0
votes
1answer
114 views

Mesh aspect ratio issue with adaptive mesh refinement (AMR)

I am working on implementation of AMR for my finite volume code. Let me use a 2-D mesh to describe my question. Starting with SINGLE initial cell (let the mesh refine level k = 0) as a root of a quad-...
88
votes
18answers
112k views

Is there a high quality nonlinear programming solver for Python?

I have several challenging non-convex global optimization problems to solve. Currently I use MATLAB's Optimization Toolbox (specifically, fmincon() with algorithm=<...
13
votes
5answers
458 views

Rapidly determining whether or not a dense matrix is of low rank

In a software project that I'm working on, certain computations are vastly easier for dense low-rank matrices. Some problem instances involve dense low-rank matrices, but they're given to me in full, ...

15 30 50 per page