All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
38 views

How to calculate the analytical solution of linear advection equation with Dirichlet's boundary conditions?

I am trying to find the solution of linear advection equation of the form: $\frac {\partial c}{\partial t}+u\frac {\partial c}{\partial x}=0$ $c(x,0)=0$ $c(0,t)=\{c_0 \ \text{for}\ t \leq t_1 \text{...
3
votes
2answers
89 views

Damped Harmonic Oscillation. Efficient algorithm to find the parameters resulting in threshold oscillation amplitude

Let's assume, that we have damped harmonic oscillation of a body in the form of a cone, immersed in a liquid. Equilibrium condition of the body is: $$m\overrightarrow{a} = \overrightarrow{F_\text{...
0
votes
1answer
145 views

Solving $n$ coupled equations numerically in Matlab

I would like to solve the following equations simultaneously and numerically for all $X, Y, Z, W$ where i = 1:Nw, j = 1:Nl, k = 1:K. $W_\text{net1}$, $W_\text{net2}...
0
votes
0answers
63 views

Solving a non-convex optimization problem using fmincon

I am trying to solve a non-convex optimization problem using fmincon(). At each iteration, I am iteratively looking for the optimum value and when the termination ...
0
votes
0answers
53 views

Is there a simple way of implementing dark energy into a n-body simulation?

I'm working on a gravitational n-body simulator and would like to implement dark energy into it but all I can find is papers with relativistic equations which I don't really understand. Is there a ...
0
votes
1answer
40 views

Animation using matplotlib

I am trying to animate a plot of two distinct points (blue and green points) moving about the complex unit circle using Python's Matplotlib library. The problem I am having is that the animation does ...
0
votes
1answer
33 views

PCJACOBI works but the default PCBJACOBI failed in PETSc

I am using PETSc and libmesh to solve a simple linear elastic problem with quite complicated geometry, using linear tetrahedral elements. I am always using the KSP CG as the solver. I noticed that ...
3
votes
1answer
88 views

Why would BFGS converge to a local minima of a non-convex function but maintain a large gradient?

I'm using BFGS to optimize a smooth but non-convex function $f$ that is computed by a simulation. The simulation also gives me a semi-analytical gradient $g$, which is verified by the numerical ...
0
votes
2answers
81 views

3d vs 2d finite element method

Is the theory of 3d finite element method just an assembly of 2d finite element analysis by putting planes on top of each other, or, a much more comple and different theory applies for 3d, with ...
4
votes
1answer
46 views

Definition of Lagrange nodes in Gmsh

When gmsh uses higher-order tetrahedral elements, there is an underlying Lagrange basis used to specify the map from reference space to the element. I'm trying to load a gmsh mesh of 3rd degree ...
2
votes
1answer
63 views

Rank of Hadamard Product with Masked Matrix

I have a matrix $A\in\{0,1\}^{d\times n}$ and $rank(A)=d,d<n$, and another matrix $X\in \mathbb{R}^{d\times n}$, but I do not know the rank of $X$. What can we say about the rank of their Hadamard ...
1
vote
1answer
66 views

Missing something fundamental about condition number estimation

In Higham's Accuracy and Stability of Numerical Algorithms, Chapter 15, algorithm 15.3 and 15.4: The topic is ostensibly condition number estimation, but these algorithms show how to compute $\gamma$ ...
2
votes
0answers
69 views

How can one prove the duality of Voronoi and Delaunay?

Hoping I'm not misunderstanding the concept here, but it is my understanding that Voronoi Diagrams and Delaunay Tesselations are 'dual' to one another, owing to the fact that each' solution makes ...
0
votes
1answer
111 views

Numerically solving a non-linear PDE

I have this non-linear partial differential equation. $$ \frac{\partial C}{\partial t}=\left(\frac{\partial C}{\partial x}\right)^2+C\frac{\partial^2 C}{\partial x^2} $$ I want to use the finite ...
0
votes
0answers
75 views

Double mach reflection at a inclined wedge

I am running into a strange problem when solving the 2D compressible Euler equations on a inclined wedge. To elaborate, my top boundary condition seems to emitting some type of instability. I have ...
0
votes
0answers
50 views

Augmented Lagrangian Techniques Frank-Wolfe Algorithm [python]

I'm trying to solve the convex quadratic problem (quadratic min cost flow problem) using the Frank-Wolfe algorithm. $$ \min\{x^TQx+qx: Ex=b,\quad 0\leq x \leq u\} $$ The standard algorithm is okay ...
1
vote
0answers
41 views

Singular Spectrum Analysis Explanation

I need you to help me understand the Singular Spectrum Analysis algorithm. I already read a lot of articles about the subject but they never answered my questions like what is the mathematical reason ...
2
votes
1answer
75 views

How to compute the determinant of Hessian of a multivariable function?

I have a function $F(\vec x)$ of many variables (let's say in the order of hundreds of thousands). I need to compute the determinant of the Hessian matrix at the point $x_0$. Is there a way to ...
0
votes
0answers
54 views

Bound for Expectation of Singular Value

In my case, $X_{\boldsymbol{\delta}}\in\mathbb{R}^{d\times M}$ is a function of Rademacher variables $\boldsymbol{\delta}\in\{1,-1\}^M$ with $\delta_i$ independent uniform random variables taking ...
3
votes
2answers
67 views

Convexity of Sum of $k$-smallest Eigenvalue

If I have a real positive definite matrix $A\in\mathbb{R}^{n\times n}$, and denote its eigenvalues as $\lambda_1\leq \lambda_2 \leq ... \leq \lambda_n $. Define the function as $f(A)=\sum_{i=1}^{k} \...
0
votes
1answer
99 views

Split-step Fourier method applied on Schrodinger equation

I'm trying to solve a Schrodinger equation of the form $i\frac{\partial}{\partial t}\psi=-\frac{\partial^2}{\partial x^2}\psi + (V(x)+\alpha|\psi|^2)\psi$ using the split-step Fourier method ...
0
votes
1answer
59 views

Numerical Stability of a Generalized Spatial Discretization Scheme

After reading the matrix stability chapter (10) of Hirsch [1], I decided to dive in the reference list of the chapter. One of the papers [2], which is cited as reference shows an very interesting ...
0
votes
1answer
46 views

An Upper Bound of $\left<H,X\right>_F$ with Constrainted Rank

We have $X=[\mathbf{x}_1,\mathbf{x}_2...,\mathbf{x}_n]\in\mathbb{R}^{d\times n}$, $H=[\mathbf{h}_1,\mathbf{h}_2...,\mathbf{h}_n] \in\mathbb{R}^{d\times n}$, and $d<n$. $H$ has rank $r\leq d$ and $X$...
0
votes
0answers
41 views

Computationally obtaining the convergence rate of upwind scheme for Advection equation

The Advection equation (with velocity = 1) is $${\partial u \over \partial x} + {\partial u \over \partial t} = 0$$ I am trying to solve the equation with periodic BC. One of the ways to numerically ...
3
votes
0answers
49 views

Calculating depth mask from different lighting

I have a object which is static, the camera is static and light source is moving. How can the depth mask be calculated ? Concept is to use - calculate height from shadow length Lets imagine a have ...
0
votes
0answers
59 views

Quadrupole moment for a right triangle

The authors define a quadrupole moment for a right triangle in Lazić, Predrag, Hrvoje Štefančić, and Hrvoje Abraham. “The Robin Hood Method – A Novel Numerical Method for Electrostatic Problems ...
2
votes
1answer
86 views

Dormand–Prince 5(4): How to update the stepsize and make accept/reject decision?

https://en.wikipedia.org/wiki/Dormand–Prince_method I want to implement the Dormand-Prince 4(5) version to solve Initial Value problems. Using regular notation I have $A$ matrix and the $c,b,\hat{b}$ ...
2
votes
1answer
116 views

Why do we use hermite interpolation for finite element method in beams?

Why not just Lagrange polynomials basis functions
1
vote
2answers
40 views

denoting a variable as a matrix using octave syms package

I'd like to use the syms package to do some algebra for me, but the baseline assumption seems to be that variables are scalars. I would like to denote some variables as matrices. This will change the ...
0
votes
0answers
68 views

Writing python program for Weierstrass function with Monte Carlo

Our assignment asks us to create a python program to plot the Weierstrass function: Weierstrass function is an example of a pathological real-valued function on the real line. The function has the ...
0
votes
1answer
40 views

Monte Carlo - Random Walk Simulation - polyfit the log log data points?

This is part of the code in matlab for a random-walk simulation. To test the code, I'm using steps=[30]; there will be more values, but I want to run it for 1 trial to decrease code processing. <...
5
votes
2answers
109 views

Choose a subset of $m$ columns that maximize $|A^T A|$?

I have a set of $n$-dimensional vectors, and would like to choose $m$ of them to become the columns of an $n\times m$ matrix. I would like to choose the subset that maximizes $|A^T A|$, where $A^T$ is ...
0
votes
0answers
30 views

Extracting raw data from a graph

I am supposed to do black-box modeling, I need the input and output data for training, however, the authors didn't agree to share the raw data with me, I can only use their publication where these ...
1
vote
1answer
54 views

How to find a pair of divisors as close as possible to each other?

For a given integer $n\in\mathbb{N}^*$, I want to find a pair $(x,y)\in{\mathbb{N}^*}^2$ such that $x*y=n$ and $|y-x|$ is as small as possible. A naive algorithm I found is : ...
1
vote
1answer
174 views

(FEM) Nodes reordering for sparse matrix storing techniques

Is it necessary to reorder nodes (using Reverse Cuthill-Mckee algorithm, for example) if I am already using a CSR or CSC storing technique? Because since CSR/CSC stores only non-zero elements I guess ...
0
votes
1answer
59 views

Fast Poisson solver (with Dirichlet BC zero) on a *truncated* Cartesian 3D grid

I find myself in the position of having to solve $-\Delta u = f$ on a subset of Cartesian grid points that don't necessarily form a cuboid domain subject to a homogenious Dirichlet boundary condition ...
5
votes
1answer
335 views

Is there a database/website with Butcher tableaus?

I have started investigating in mostly Runge Kutta and Runge Kutta Nyström methods and there one of the only differences between the methods of the same type is their Butcher tableu. For the most ...
3
votes
1answer
55 views

Poisson image blending artifacts

I am trying to implement Poisson image blending as in the paper Poisson Image Editing. This is the task of filling in a masked region of an image by minimizing $$\min_f\int_\Omega \left | \nabla f - \...
0
votes
0answers
19 views

work/memory ratio for product of two square matrices

From Scientific Parallel Computing by Scott Ridgway: Definition: The work/memory ratio of an algorithm is the ratio $\rho_{wm}$ of the number of floating point operations to the number of memory ...
2
votes
1answer
55 views

Problem of multiplication of big (sparse) matrix with numpy (python)

I wanted to multiply two simple (big and sparse) matrix with numpy. And I saw that the calculation fails when matrices are too big. If i take $X$ a random vector (size $n$). With pandas, I ...
3
votes
1answer
108 views

Time integration of wave equation

My question is: how come that certain formulations of the wave equation can be time integrated more efficiently then others? Le me expand a bit on that. Consider the wave equation: $$ \frac{d^2 p(t,...
2
votes
0answers
29 views

ILUTP in sparse.linalg.spilu?

In Matlab, an ILU with threshold and pivoting (ILUTP) can be passed by default as: setup.type = 'ilutp'; [L, U] = ilu(A, setup); Looking for an equivalent in ...
2
votes
0answers
45 views

Cover a polygon with least amount of parallelograms [closed]

I am solving the task that is as follows: Input: a polygon. Can be any kind of polygon without self intersections. Can be a non-convex and with holes inside. Goal: to cover it with 2 (at least) or ...
0
votes
1answer
44 views

Gnuplot: How can I determine the maxima of a fit function in gnuplot?

I have a set of data data.txt which can be fit to a Gaussian function, f(x). I want to determine the coordinates of the point of ...
1
vote
1answer
40 views

Gnuplot: How can I fit a range of points (out of the entire data) to a function?

I have a set of data obtained for the I-V characteristics of an LED. ...
2
votes
2answers
70 views

Stability of Crank-Nicolson for $u_t = iu_{xx}+2iu$

I want to use the Crank-Nicolson scheme to solve the equation $$u_t = iu_{xx}+2iu$$ Here's the analysis: Suppose we make a grid, with $k = dt$ and $h = dx$, the usual notation, and also $u_j^n = u(...
1
vote
0answers
44 views

How to integrate the contents of a vector using an adaptive quadrature routine [duplicate]

I have a function which requires the return type to be a container. The problem is that I need to integrate the contents of the container as efficiently as possible and was hoping to use adaptive ...
6
votes
2answers
119 views

Positive root of $x^q + bx - b$

Is there either a closed-form expression or fast/elegant algorithm for computing the positive root of the polynomial $$f(x)=x^q + \beta x - \beta,$$ where $\beta>0$ and $q\geq2$? How about the $q\...
-1
votes
1answer
55 views

Simulating magnetic particles in a field free point generated by two opposing magnets

This is probably a long shot with such a short time, but I've been trying to get theoretical data for a project I'm working on. The project involves using a very simplified version of magnetic ...
2
votes
1answer
82 views

Which pseudo-inverse to compute when Inverse is not possible? (No linear solve)

Let us assume that we have a function, $f(A)=\text{vec}(A^{-1})^\intercal B$, dependent on $A^{-1}$. However, due to some machine-precision limitations, the programming language I'm using cannot ...

15 30 50 per page