All Questions

Filter by
Sorted by
Tagged with
2
votes
0answers
23 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{...
5
votes
1answer
128 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
37 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
321 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)...
23
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
12 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
108 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
137 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
23 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-...
0
votes
0answers
49 views

Merge N number of euclidean distance matrices to get overall single euclidean distance matrix

I want to find out the aggregated euclidean distance of a big dataset $D$ comprising of x and y coordinates where the data set is divided into N sub dataset where 1st sub dataset contains 1 to k-th ...
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
0answers
19 views

How can I create a frequency table per group? [closed]

My experiment involves 6 different groups (A...F) subjected to different concentrations of a compound for a period of time. I observed each group at 7 different points in time for 3 binary traits (&...
-1
votes
1answer
78 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....
0
votes
0answers
68 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
296 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
108 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
47 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 ...
3
votes
1answer
88 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
107 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
61 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
403 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
110 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
110k 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=<...
-1
votes
0answers
36 views

Python approach for calculating a 2D matrix by interpolating 'between' two other 2D histograms [closed]

I have two 2D histograms, A and B, calculated from simulations by changing a single input parameter (alpha and beta set at "5" and "7", respectively). I want to calculate a third ...
13
votes
5answers
443 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, ...
1
vote
0answers
44 views

How to determine the orientation of convex/concave hexahedra?

I am writing a code that checks the orientation of a list of vertices (along with face connectivity) describing both convex and concave hexahedra. The face connectivity table stores the list of vertex ...
-1
votes
0answers
64 views

RBF-FD laplacian solver on python

I am trying to find a laplacian of the function explicitly using the RBF-FD approach The function is sin(pi*x)*cos(pi*z/2) and its analytical solution of the ...
-1
votes
0answers
25 views

optimization for complex number [closed]

I don't know how to solve the optimization problem. Please suggest a theory or approach to solving the above optimization problem.
1
vote
1answer
44 views

Efficiency of scipy.sparse.linalg.expm_multiply with sparse vs unsparse vectors

From the package scipy.sparse.linalg in Python, calling expm_multiply(X, v) allows you to compute the vector ...
0
votes
1answer
77 views

deal.ii - ParaView “warp by scalar” of my output is not continuous

During our finite element course, we've solved the linear elasticity problem in 2D on a square (GridGenerator::hyper_cube) with $Q_1$ bilinear finite elements in ...
1
vote
2answers
114 views

Imposing pressure variation instead of Dirichlet boundary conditions on Finite Element Method

I always see Finite Element codes solving PDE with Dirichlet or Neumann boundary conditions. But, I have a problem now consisting of a straight cylinder with a circular base (a simple 3D tube), with ...
0
votes
1answer
76 views

Finite element method for Stokes and Navier--Stokes with square elements only

I wanted to learn how to implement a code for the Stokes and Navier--Stokes equations 2D/3D. I already know how to implement it when the elements are triangles or tetrahedral. Do exists finite element ...
4
votes
4answers
222 views

Learning computational science through guided discovery

I am currently trying to get through Pattern Classification by Duda et al (for a course). However, the book seems too dense for me. Pattern recognition seems like a topic that could be better learned ...
0
votes
1answer
93 views

Specifying mesh spacing for DFT in numpy

I was testing the .fft package of numpy 1.16.1 in Python 3.7.2. In particular I was trying to verify that the transform resembles the analytical one for: $$f(x) = \mathrm{exp}\left[-\left(\frac{x-5}{2}...
1
vote
1answer
53 views

2-norm and infinty norm of a system in controls

How to compute 2-norm or infinity norm of following system? i am confused whether to calculate using simple matrix theory "where it don't regard for s domain" or H2 and H-infinty norm. ...
1
vote
1answer
369 views

Suitable finite difference method for a convection-diffusion system?

I am trying to solve a system of PDEs $H_{t} = \frac{0.3}{0.7} - \frac{0.005 B f(h(H))}{\theta} - \frac{0.3 f(h(H))}{0.7} + \frac{500}{0.7} (HH_x)_x + (HH_y)_y$ $N_t = \frac{N_{in} - 0.002 [N] B f(h(...
2
votes
1answer
585 views

How can I evaluate more accurate energy eigenvalues from Schrodinger equation using shooting method?

I am trying to use the "shooting method" for solving Schrodinger's equation for a reasonably arbitrary potential in 1D. But the eigenvalues so evaluated in the case of potentials that do not have hard ...
1
vote
1answer
130 views

Material properties for a node in a 2-material FEM code

I'm trying to debug an FEM that I inherited, and I unfortunately do not have much knowledge of FEM. I only know FD and FVM. If you're modeling a system with 2 materials, there will be an interface ...
3
votes
0answers
47 views

Solving multiple linear regression in parallel

I am working on a problem where I need to solve approximately 500 Million Linear Regressions (OLS). What would be the most efficient way to do this (e.g. using GPU or a some framework that can do this ...
1
vote
1answer
175 views

What is difference between L2 norm and H2 Norm?

When someone refers 2-norm of system,L2 and H2 are used interchangeably by author and is rather confusing. Even the matlab has different functions for H-infinity norm and L-infinity norm. as shown in ...
1
vote
2answers
106 views

Need software for generating self-avoiding random walks on a tetrahedral lattice

I am looking for FOSS code that can generate self-avoiding random walk trajectories on a tetrahedral lattice. The purpose of the exercise is to create random conformations of model polymer chains that ...
1
vote
0answers
68 views

Finite Difference Approximation for the Laplacian in 2D that produces a nonsymmetric matrix

Consider the following PDE \begin{align} -\Delta u &= f \ \ \text{en} \ \ (0,1)\times (0,1) \label{P1} \\ u &= 0 \ \ \text{en} \ \partial ((0,1)\times (0,1)) \label{P2} \end{align} if we ...
2
votes
0answers
39 views

How to obtain smallest eigenvalues with Arnoldi iteration

I understand that the Arnoldi iteration produces a basis which tends to include in its span the eigenvectors corresponding to eigenvalues of large magnitude (hence the analogy between the last vector ...
0
votes
0answers
38 views

Does the leap-frog algorithm conserve energy for n-body problems?

The leap-frog algorithm is able to conserve to a certain extent the energy of a system, which flucutates as a cosine around a stable value. Is this true if we apply the algorithm to a n-body ...
2
votes
2answers
77 views

Time complexity analysis

I want to know the time complexity of following code Say I have a list unique_element[] There is an array which contain elements {4,5,2,4,7,8,1,5,9,8,1} Now as per my code I want to find out the ...
0
votes
1answer
59 views

How to Calculate magnetic and electric field in 2D Magnetotelluric using Edge based Finite Element

I calculate 2D Model of Magnetotelluric responses which are apparent resistivity and phase. I do the calculation for Transverse Electric (TE) mode. Then I used edge based finite element with ...
3
votes
1answer
69 views

Quantify difference between two discrete 1D solutions

I have an ordinary differential equation that is solved as an initial value problem using different numerical schemes. I end up with several discrete time signals that should display a reasonably ...
1
vote
2answers
93 views

what finite elements are stable for the mixed form of the elasticity equations?

The mixed form of the elasticity equations is to find the unique critical point of the Hellinger-Reissner functional $$J(u, \sigma) = \int_\Omega\left(\frac{1}{2}A\sigma : \sigma - (\nabla\cdot\sigma)\...
3
votes
1answer
2k views

Applying Neumann boundaries to Crank-Nicolson solution in python

Consider the heat equation $$u_t = \kappa u_{xx}$$ with boundary conditions of $$u(x,0)=0\\ u(0,t)=100\\ u(l,t)=0$$ Numerical analysis by pyton can be done with ...

15 30 50 per page
1
2 3 4 5
195