All Questions

1
vote
1answer
86 views

What's the minimum step size that can be used in Euler's method before it becomes unreliable?

In particular, if Euler's method is implemented on a computer, what's the minimum step size that can be used before rounding errors cause the Euler approximations to become completely unreliable? I ...
2
votes
1answer
105 views

Why the numerical solution of advection-dominant problem is challenging

In many CFD text books, usually there is a dedicated chapter for advection term discretization. Why discretization of such term in advection-dominated problems and near the discontinuities is ...
0
votes
0answers
57 views

Need help applying Implicit Eulers Method together with Newtons Method on Burgers' Equation

From the inviscid Burgers' equation: $\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x} = 0$, I get the discretization $\frac{u_i^{n+1}-u_i^n}{\Delta t}+\frac{(u_i^{n+1})^2-(u_{i-1}^n)^2}{\...
1
vote
0answers
20 views

Instability in Lattice Boltzmann Solver

I wrote a Lattice Boltzmann Solver in Rust a little while back using both the BGK approximation and the TRT (two relaxation time) method on the D2Q9 lattice. In both cases I run into major stability ...
1
vote
1answer
123 views

How do I solve the matrix equality constrained optimization problem using Lagrangian multipliers?

Solve the following minimization problem in $\mathbf{X} \in \mathbb{R}^{m \times n}$ $$\begin{array}{ll} \text{minimize} & \frac 12 \| \mathbf{X}\mathbf{X}^T -\mathbf{A} \|^2_\mathcal{F}\\ \text{...
3
votes
0answers
41 views

Use of non-typical values of $\theta$ in theta-methods

The theta-method is a popular solution for solving time-transient PDEs (or ODEs), which consists of solving the general equation for each time step: $$ \frac{u^{n+1} - u^{n}}{\Delta t} + (\theta f(u^{...
2
votes
1answer
21 views

Determine image of hypercube under linear map

Let $A$ be an $3\times N$ matrix (where $N$ is large) with nonnegative real entries. I'd like an algorithm for determining when a vector $v\in\Bbb R^3$ can be written as $Aw$ for some vector $w\in\Bbb ...
1
vote
3answers
106 views

Clustering with points lying along different 3D planes

I have a bunch of data points in 3D that lie along a few planes. What would be the best approaches to estimate the normals of these planes? Edit: There are roughly equal number of points lying along ...
0
votes
1answer
40 views

Optimize multivariable function with interdependent variables

I have a cost function with 2 parameters. The variables are dependent on each other. So, if I just take a partial derivative with respect to one variable the slope is in terms of the other variable ...
1
vote
0answers
112 views

High-accuracy numerical differentiation

I have a $200 \times 200$ matrix representing the values taken by a function over an equally spaced grid. I would like to perform derivatives on it. I am interested in its gradient (i.e. its ...
3
votes
4answers
152 views

Numerical integration in Python with unknown constant

I’d like to solve the below equation for the unknown $T$: $$\int_0^\infty \frac{x^2}{\exp\left(\frac{x}{T}\right)-1}\kappa_x \mathrm{d}x = C,$$ where $C$ is a known constant and $\kappa_x$ is some ...
2
votes
1answer
88 views

Formulation of the least-squares parameter estimation problem

I have a system of 10 ordinary differential equations of the form, $$\frac{dy_1}{dt} = f1(V1,k1,y1,y2)\\ \vdots \\ \frac{dy_{10}}{dt} = f_{10}(V_{10},k_{10},y_{9},y_{10}) $$ I want to estimate the ...
5
votes
1answer
150 views

Advantages and disadvantages of space-time finite element methods

I have heard of space-time finite element methods. Although I was able to find some articles that describe the different possible methods from a mathematical point of view (thanks to Space-time finite ...
0
votes
1answer
68 views

Imposition of Dirichlet BC for Fourier pseudospectral in this paper

I was trying to implement the algorithm from the paper "Adapting a Fourier pseudospectral method to Dirichlet boundary conditions for Rayleigh–Benard convection". I am having a hard time to ...
1
vote
1answer
390 views

What is the state of the art in solving stiff initial value problems?

I'm looking for current references on solving stiff ODEs. Most of what I know (say, BDF methods) apparently date back to the 1980's, and I feel like a lot of progress should have been made in that ...
1
vote
1answer
106 views

Solving differential equation in Python with variable coefficients (I just know the coefficients numerically)

I am trying to implement a routine to solve a differential equation in Python. Basically the kind of equation that I am interested in solving is of the form: $\displaystyle \frac{d}{dx^2} \left(x y(x)...
0
votes
1answer
64 views

Error for the finite differences scheme — Advection equation

Consider the advection equation (1D in space) $$ \frac{\partial u}{\partial t} + V\, \frac{\partial u}{\partial x}=0 $$ and we solve it numerically on $[0,1]\times [0,1]\ni (t,x)$ using a forward ...
1
vote
1answer
61 views

Is there a better way to do run time analysis than this?

I currently have 2 different functions with options to vectorise them: acc_rej_sine(max_iter, algorithm=None) and ...
0
votes
0answers
22 views

Scipy basinhopping custom step update and constrained looping

I am searching for the global minimum of a certain function and trying to use its gradient (here same as Jacobin) to guide the step counter. However, my x is fix ...
1
vote
2answers
85 views

How to compute 16 different simulations on parallel with pbs script on the same machine

I have a 32 cores machine, and I need to run 16 different dynamics simulations in parallel on it. I want the 16 jobs to run in parallel, not sequentially, on the same machine. The 16 dynamics input ...
1
vote
0answers
33 views

How to numerically calculate the transition dipole integral in periodic systems?

Now I have wave functions $\psi_a$ and $\psi_b$ of two states in Gaussian CUBE format. I'd like to evaluate the transition dipole moment integral $\pmb\mu$ between these two states. As my simulation ...
1
vote
1answer
65 views

Approximation Error in a Finite Difference Approximation of the Square of Derivative

First Part: (First-order derivative) Assuming $f$ is an infinitely differential function everywhere, the Taylor series of $f(x + h)$ at $x$ is \begin{align}\tag{1} f(x + h) = f(x) + hf'(x) + \frac{1}...
0
votes
1answer
65 views

Stability of PDEs

I am currently trying to solve some PDEs with FiPy. At page 56, the manual mentions (https://www.ctcms.nist.gov/fipy/download/fipy-3.0.pdf). The largest stable timestep that can be taken for this ...
1
vote
0answers
31 views

Oscillations when solving parabolic heat equation with FTCS

I'm wondering if someone could help me out, or point me in a direction of how I can understand the following oscillations that occur when I solve the Porous Medium Equation $$u_t = u_{xx}^{m+1}$$ ...
0
votes
0answers
13 views

Finding Maximum Value of CST Parameterization over an interval

I have a CST parameterization for a shape over an interval (0,1), so I have y as a function of x like so $$y = C(x)*s(x)$$ where $$C(x) = x^{n1}*(1-x)^{n2}$$ and $$S(x) = \sum_{i = 0}^{n} A_i(x)^i(1-x)...
5
votes
1answer
105 views

Whittaker-Shannon interpolation: Accuracy dies with speedup; can it be fixed?

With a truncated Whitaker-Shannon series (cardinal series) $$ f(t) = \sum_{j = 0}^{n-1} y_{j} \frac{\sin\left(\pi( \frac{t-t_0}{h} -j)\right)}{\pi\left(\frac{t-t_0}{h}-j\right)} $$ we can naively ...
0
votes
0answers
69 views

Analytic vs discrete understanding of PDE

The PDE I am working with: $$\partial_tu = \nabla \cdot (a(x)\nabla u)-\beta(x)u\\ \partial_nu=0, x \in \Omega \subset \mathbb{R}^2\\ \beta(x)>0$$ Integrate the PDE: $$\int_\Omega \partial_t u=\...
0
votes
0answers
32 views

What will PDE discretization matrix look like for time and space? [duplicate]

Please note: this question is not a duplicate of this question since, while the PDE is the same, the nature of this question is different, i.e. the other question treats a different aspect of this PDE....
2
votes
0answers
70 views

Numerical solution to N-dimensional diffusion on simplex?

Assume I have a system of at least (but generally only) $N+1$ points in an $N$-dimensional space ($N > 3$ is possible). At each of these points $x_i, i=1,...,N+1$ I know an initial potential/...
1
vote
0answers
32 views

Can I use the Schur basis returned by ARPACK in a restart capacity?

Reading ARPACK documentation, I see that ARPACK will return an "orthogonal basis for the invariant subspace corresponding to the eigenvalues in D" if eigenvectors are not requested. Can this subspace ...
0
votes
1answer
60 views

Interpolation of function onto mesh gives different results, depending on mesh density

I wanted to test the numerical accuracy of my program. For that I wanted to interpolate the function $$f=I_0\exp\left(-100x^2\right)\exp(-100y^2)$$ onto a grid, defined on $$\Omega=[0,1]^2$$ by using ...
1
vote
0answers
92 views

Connection between piecewise linear basis functions and RELU activation function

ReLU activation is defined as follows $$\sigma(x)=\max(0, x).$$ Let's assume that I have deep network of 1 hidden layer, than output from my layer has form $$ f(x)= \sigma(Wx +b), $$ where matrix W ...
0
votes
0answers
22 views

convex atomic function reformulation to meet concave dcp rule requirements

I have an atomic constraint of the form abs(w - w_prev) >= some_threshold It is supposed to get every value equal to or above my threshold. I am working on a ...
2
votes
0answers
37 views

Biconvex problem whose objective function depends on only one variable

I am solving the following biconvex problem: $$\min_{x,y} f(y)$$ $$s.t. ~~ g(x) \leq 0$$ $$~~~~~h(x,y) = 0$$ $$x \in X, y \in Y$$ where $X$ and $Y$ are compact convex sets, $g(x)$ and $f(y)$ are ...
3
votes
2answers
73 views

Efficient covariance matrix calculation MATLAB (every combination of rows from data)

My friend in the statistics department asked me how to do the following calculation efficiently. Suppose we have data $X\in\mathbb{R}^{N\times 2}$. He needs to do the following calculation: $$C_{i,j}=...
0
votes
0answers
29 views

3D Tollmien-Schlichting Waves Imposed in a Channel Flow (Are Physics correct?, etc)

So I am trying to do some further tests on a 2nd-order code Incompressible Navier Stokes equations, by studying transition to turbulence in a Poiseuille flow. Specifically, I'm interested to see ...
0
votes
1answer
58 views

Creating an Interpolation of a w = f(x,y,z) function

I am trying to finish a series of interpolation functions. The problem is more related with organizing the data than how to do the interpolations. Using the RegularGridInterpolator, I created this ...
0
votes
0answers
37 views

Advection-Diffusion by using Lattice Boltzmann Method, Is it practical for engineering applications?

I want to use lattice Boltzmann method to solve advection-diffusion in three-dimensional space. In fact, my problem is related to drug release in human blood vessels and as a results, I'm interested ...
2
votes
1answer
49 views

Visualization of 3D streamlines in ParaView

Essentially I want to use paraview to recreate a flow visualization like the one shown in the picture above. I am able to create the 3d flow lines using a pipeline that looks like ...
0
votes
2answers
86 views

Overrelaxation with w < 0

Are there any circumstances under which using a value $w < 0$ would help us find a solution in over-relaxation faster than we can with the ordinary relaxation method? Over Relaxation Method: $$x'=...
1
vote
0answers
16 views

Translating grid with extrusion speed

I am putting into MATLAB code the equations that describe a plastic extrusion process. From a paper, I found I should use a spatial grid that translates with the extrusion speed, being the reference ...
0
votes
1answer
33 views

Problems with python's interp 2D

I am writing some functions to interpolate data. While using interp2D, somehow, a sample matrix works but when I change the size of the matrix, it returns an error. ...
1
vote
0answers
51 views

Discretizing a parabolic PDE with finite volume method

I want to discretize the following parabolic PDE: $$u_t = \nabla\cdot(\alpha(x)\nabla u)- \beta u\\ x\in\Omega \subset \mathbb{R}^2\\ \partial_n u = 0\\ u(t,0) = u_0(x)\ge 0, \alpha(x)>0$$ Given ...
0
votes
1answer
28 views

Is open foam Mac version compatible with Linux version

I am recently starting with OpenFoam. I have a Mac as my personal laptop, but I would have to use OpenFoam on linux in my lab. So my questions are: 1) Is the OpenFoam software independent of OS, so ...
1
vote
1answer
63 views

Gaussian Elimination Using Fortran [closed]

I developed the code below for performing gaussian elimination in order to evaluate the determinant of a matrix: ...
0
votes
2answers
118 views

Non-linear Boundary Value Problem. How to compute the Jacobian?

Consider a Boundary Value Problem: $$ \delta u''+u(u'-1) =0 \Leftrightarrow u''=\frac{-u(u'-1)}{\delta}=:f(t,u',u), \\ u(0)=a, u(1)=b $$ $\delta,a,b$ are known parameters. I want to implement Newton'...
1
vote
0answers
59 views

Determine truncation error of PDE discretization

The equation is $$\frac{\partial}{\partial x}\left(u\frac{\partial u}{\partial x}\right)=f(x)\\ 0<x<1, u(0)=u(1)=0$$ I'm discretizing this PDE using FVM as follows: $0=x_0=x_{1/2}<x_1<x_{...
1
vote
0answers
33 views

How can I maximise orthonormality between degenerate eigenvectors using ARPACK?

I am using ARPACK's zndrv1 to diagonalise a matrix (the context is quantum chemistry). While all vectors have a norm 1, as expected, vectors corresponding to degenerate eigenstates aren't always ...
1
vote
0answers
27 views

Paring Large Numbers Question [closed]

I am writing some simple code to raise a base value to a power then perform some operations on the output. I have included the code I am using now, below ( see end of this message ), also see ...
4
votes
1answer
83 views

Examples of problems that cannot be formulated as optimization problems

An optimization problem has 3 main components: decision variables, constraints and an objective function. Such a problem can be mathematically modelled and solved using an optimization solver. For ...

15 30 50 per page