All Questions

Filter by
Sorted by
Tagged with
2
votes
0answers
22 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{...
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 ...
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
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-...
-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 (&...
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 <...
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
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 ...
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 ...
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
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 ...
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 ...
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. \...
-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
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
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 ...
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
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
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
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 ...
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 ...
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 ...
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 ...
-1
votes
0answers
50 views

Simulation data from VTK to python

I have run some simulations that give the output data in the VTK format. This is very nice for visualization in Paraview. However, I want to take some spatial Fourier transforms of the data in the VTK ...
-1
votes
1answer
38 views

Time complexity and its formula [closed]

Is there any example support the case of $O(n^k)$ where $k$ has a fixed calculated value for every $n$ and $k$ is not a constant value for all $n$. As $k$ depends on the value of $n$ in polynomial ...
1
vote
1answer
94 views

Locking phenomena for $P1 - P0$ elements

Consider the Stokes problem and the usual divergence operator $B:V \rightarrow Q'$, $\langle Bv, q\rangle = b(v,q)=(\operatorname{div} v,q)$ and its discrete versione $B_h : V_h \rightarrow Q_h'$. In ...
-1
votes
1answer
31 views

Parameter explained by many distributions

If we had, for example, labeled data, where for each entry (label) we have several data distributions associated to it, how can I get something meaningful from them? Is this a solvable problem? Is ...
5
votes
0answers
141 views

About the condition $\ker(B_h) \subset \ker(B)$ in mixed finite elements formulation

I'm studying mixed finite elements. The problem is a classical saddle-point one: we seek for $(u,p)$ in $V \times Q$: $$A u + B^t p = f$$ $$Bu = g$$ where $A: V \rightarrow V', B:V \rightarrow Q'$ ...
0
votes
1answer
61 views

Finite Difference Method on a function with multiple elements of the same array

First time posting here, so I apologize for any missing info upfront. I am working on a program in VBA that calculates a function (which itself calls another function), then calculates the derivative ...
2
votes
1answer
130 views

Why can bad jacobians sometimes works better for implicit ODE method?

I'm solving a system of stiff ODEs describing atmospheric chemistry and transport. I am using CVODE BDF from Sundials Computing. I have two ways to approximate the jacobian: Allow CVODE to ...
3
votes
0answers
105 views

Invert a huge sparse operator;

please help me with this question, I want to invert a huge sparse (non-circulant) this below in a $Ax=y$ equation: $$(\lambda I+ \beta D+ \sigma C)x=y$$ where I is an Identity Matrix,D is a Diagonal ...
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 ...
2
votes
0answers
71 views

Understanding inf-sup conditions for classical saddle point problems

I'm studying the inf-sup conditions for saddle point problems. I'm referring to the usual one $$\begin{cases}Au + B^t p = f \\Bu=g \end{cases}$$ In the book I'm using (Ern - Guermond: Theory and ...
1
vote
0answers
82 views

Matlab - Equality between 2 Fisher matrices constructed in a different way

I want to know if, on a Fisher matrix, the projection operation (with a Jacobian matrix) commutes with a matricial inversion operation. The 2 ways to build these 2 matrices are: 1) First method: 1.1) ...
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
votes
0answers
38 views

Inverse matrix euqation problem with restricted condition

$\underset{\Omega}{min}~\lambda\left\|A\Omega^{-1}B+C\right\|_F^{2}+\beta tr(W\Omega^{-1}W^{T}), s.t. tr(\Omega)=1, \Omega_{i,j} \ge 0$, How to solve this problem with $\Omega$?
2
votes
1answer
145 views

Convolute a gaussian kernel with a large array of off-grid centroids without looping? (how to make “A Thousand (Gaussian) Points of Light” )

For a finite object size diffraction simulator, I need to generate arrays which are the sum of thousands of instances of a Gaussian (or other) 2D kernel at centroids that will not fall in any ...
1
vote
0answers
65 views

How to generate the convolution of f(x, y) with a parametric function g(t), x(t), y(t) in Python? (Something better than this brute-force sum)

I'd like to know how to convolute $f(x, y)$ with a parametric shape; a 1D distribution along a parametric path as defined by $g(t), \ x(t), \ y(t)$ in Python, resulting in a 2D array of $f * g$. A ...
1
vote
1answer
82 views

Finding the source of numerical instability in a electrostatic problem solved by conformal mapping

I'm using conformal mapping to solve a 2D electrostatic problem (calculating the potential $u(x,y)$ in the plane). Let $C_1$ and $C_2$ be two circles at an electric potential $U_1$ and $U_2$, ...
3
votes
1answer
126 views

Proof of R. Verfürth paper on adaptive mesh and bubble functions

I'm studying adaptive meshes, and my professor wrote the following property for a bubble function ( see this scicomp post for the definition I'm using)$b_T$ defined on a triangle $T$. $$||b_T \phi ||_{...
-1
votes
1answer
30 views

relres in gmres MATLAB

I think the relres in MATLABis the form that relres = norm(M(b-Ax))/norm(M\b),when it smaller than tol then stop the iteration. I want to know how to change relres to norm((b-Ax))/norm(b). Or use ...
-1
votes
0answers
19 views

Solve_ivp using timestep

I am trying to compute the path of a charged particle as it moves through a magnetic field. I am currently using a uniform field, but I am going to expand into nonuniform fields later on. The problem ...
4
votes
0answers
110 views

Optimization problem

In the expression: ${\underset{\Omega}{\min}\left\|\beta A\Omega^{-1}B+C\right\|_{F}^{2}+tr(W\Omega^{-1}W^T)},$ s.t. ${tr(\Omega)=1, \Omega \ge 0}$, where any element of ${\Omega}$ is nonnegative. ...
1
vote
1answer
85 views

Solving Poisson-like PDE with FFT

Problem I have an $n\times n$ grid, and each point on the grid is assigned two values: a score, and an (inverse) speed factor. There is a "turtle" moving along the grid, and it's goal is to ...
2
votes
0answers
64 views

Efficient solver of a Integer programming

I am solving an Integer programming using MATLAB, yet the efficiency is low. Here is the problem: Suppose $v$ is a $N \times 1$ vector. For $v_i \in v$, $v_i \in \{0,1\}$. $D$ is a 0-1 matrix, which ...
1
vote
0answers
44 views

Maximizing $l_1$-normalized entropy using CVXPY

Suppose that $x = (x_1, ..., x_n)$ is a vector of variables and I would like to maximize the Shannon entropy of $\frac{|x|}{||x||_1}$ (i.e. the vector of absolute values of $x_i$, normalized to have $...
1
vote
1answer
86 views

Classical global estimate for $H^1$ error

I'm having lots of troubles in understanding the proof the estimation of the classical $H^1$ error using finite elements of degree $r$. $$||u-u_h||_{H^1(\Omega)} \leq \frac{M}{\alpha} C h^r |u|_{H^{r+...
-2
votes
0answers
58 views

How to solve nonlinear second order ODE in MATLAB?

0 I am working on simulating a car suspension system using Matlab. Specifically, I have to derive equation of motion using the Lagrange method and then use ode 45 to solve it. However, while using <...

15 30 50 per page
1
2 3 4 5
195