All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
10 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 ...
4
votes
1answer
55 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^...
0
votes
1answer
69 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
102 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
63 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
212 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
90 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
48 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
365 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
577 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
120 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
40 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
157 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
2answers
104 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
61 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
35 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
votes
0answers
32 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
76 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
57 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
66 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
88 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 ...
0
votes
0answers
43 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
vote
1answer
99 views

A better word to indicate slowness/high latency?

We are comparing two techniques in computer science. We want to say X has "significantly high latency" when executed on system Y. Is there a better one-word term we can use for the above to ...
5
votes
0answers
132 views
+200

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'$ ...
-1
votes
1answer
37 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
92 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 ...
0
votes
1answer
58 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 ...
-1
votes
1answer
29 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 ...
2
votes
1answer
115 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 ...
3
votes
0answers
98 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 ...
1
vote
1answer
80 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$, ...
2
votes
1answer
123 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 ...
2
votes
0answers
67 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
78 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
264 views

Calculating Error for Poisson Equation using Successive Over-Relaxation technique, Python

I am trying to solve the Poisson Equation $\frac{\partial^2 T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2} = 32(x(x-1) + y(y-1))$ for a 61x61 grid using Python3 with boundary conditions being $T=...
4
votes
0answers
107 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
votes
0answers
36 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$?
1
vote
1answer
303 views

Robin Boundary Condition with Implicit Upwind - Finite Difference Method for 2D Convection-Diffusion Equation

I am trying to solve a problem with 2D Convection-Diffusion equation with U = Concentration ($mg/m^{2}$) using Implicit Upwind Finite Difference Method like this $$ \frac{\partial U}{\partial t} + ...
3
votes
1answer
175 views

Good languages/packages for interior point optimization with non-linear constraints?

I'm currently using Python's scipy.optimize package to perform parameter estimation for a system of 10 ODEs. I have some observed data, and I'm trying to find the set of parameters which makes the ODE ...
3
votes
1answer
123 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
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 ...
6
votes
6answers
5k views

What is the difference between MATLAB and FORTRAN?

In our university some Ph.D students for computational methods prefer FORTRAN over MATLAB. I can't understand why? What is the difference between them when are used in computational methods like ...
1
vote
2answers
162 views

Sum of norms over elements is not equal to norm over the whole $\Omega$

In my finite element notes, after the proof of the global estimate for the interpolation error, assuming a regular triangulation with triangles $T_m$: $$\sum_m|v - \Pi_h^r v|_{s,p,T_m} \leq \sigma^{-s}...
-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
vote
1answer
84 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 ...
-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 ...
5
votes
1answer
222 views

Non-negative least squares with very small numbers

(I have asked this question on StackOverflow previously but it has been pointed to me that CSSE or MSE could be more appropriate) I have to solve a constrained optimization problem of the following ...
1
vote
1answer
131 views

Confusion about bilinear form for elasticity equation in deal.ii tutorial

I'm learning how to solve vector-valued problems with deal.II library. In particular, I'm looking at the following introduction from the official website https://www.dealii.org/current/doxygen/deal.II/...
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 $...

15 30 50 per page
1
2 3 4 5
195