All Questions

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

Improper Numerical integral

I am self teaching myself python and computational physics via Mark Newmans book Computational Physics the exercise is 5.17 of Computational Physics. I have to shift the limits of integration for an ...
1
vote
1answer
83 views

How to compute turbulent energy cascade

I need to compute the kinetic energy cascade using a finite volume solution in an equally spaced grid. I wonder if it is more correct to first compute the kinetic energy in the space (or time) domain, ...
1
vote
1answer
150 views

Imposing boundary conditions for PDE quadratic eigenvalue problem

I have a quadratic eigenvalue problem of the form: $$(A_2 s^2 + A_1 s + A_0)\hat{v} = 0$$ where $s$ is the eigenvalue. The matrices $A_i$ contain derivatives up to order six, and I have six boundary ...
1
vote
0answers
8k views

Using scipy.quad to calculate difficult integral

When evaluating the integral below in python using scipy.quad I get the following warning: UserWarning: The maximum number of subdivisions (50) has been achieved. If increasing the limit yields no ...
1
vote
1answer
364 views

Feasibility checking

Consider the following optimization problem: $Min\;\;\; CX$ $AX\geq b$ $x_ix_j= x_s x_t\;\;\; i\neq j \neq s\neq t$ $x_j\geq 0;$ Where $A$ is the adjacency matrix and $C$ is a constant vector. ...
1
vote
0answers
59 views

Vortex Lattice Method: better basis than horse-shoe vortex?

I read several introductory texts about potential flow and vortex lattice method. Basically, it is fitting of some velocity field described by conditions on velocity at some control points using basis ...
1
vote
1answer
87 views

Classification of method for solving PDEs

If I have a system of equations as follows (where $i = \sqrt{-1}$): $$ \frac {\partial A}{\partial t} = iA^*B - A \tag{1} \\ $$ $$ \frac {\partial B}{\partial z} = AB^* - B \tag{2} $$ Using the ...
1
vote
3answers
166 views

Optimization of a blackbox function

Let's say that we have an objective function $f(\mathbf x,\mathbf y)$ which has the parameters $\mathbf x=[x_1\ldots x_n]$ and $\mathbf y=[y_1\ldots y_n]$. Here, $\mathbf y$ is a blackbox variable ...
1
vote
0answers
51 views

Roe Riemann solver for perfect gas mixture

I have working program for solving one-component 1D Euler equations with Roe's approximate Riemann solver constructed according to this pdf. My implementation of the algorithm is as follows ($\rho$ is ...
1
vote
1answer
300 views

Solving first versus second order PDE

I am trying to numerically solve a PDE, and just had a question as to the validity of a certain approach. For example, given the PDE: $$ \frac {\partial ^2 E}{\partial t^2} = - k\frac {\partial E}{\...
1
vote
1answer
55 views

Is there an upper bound for fill-ins for indefinite triangular factorization?

For $A=LU$, or $A=LDL^T$ factorization, bandwidth is preserved when there is no pivoting. This is true even for indefinite A, see question. However, when there is pivoting band structure is destroyed, ...
1
vote
0answers
137 views

Using backward difference approximations for higher order derivatives

I am trying to solve a system of equations and have a question regarding the validity of my approach when implementing a fifth-order Cash-Karp Runge-Kutta (CKRK) embedded method with the method of ...
1
vote
1answer
120 views

Numpy FFT gives me a pulse shorter than it should be. Not sure what I am doing wrong

I've created a code (Python, numpy) that defines an ultrashort laser pulse in the frequency domain (pulse duration should be 4 fs), but when I perform the Fourier Transform using DFT, my pulse in the ...
1
vote
3answers
389 views

Real eigenvalues finding

I have a question about matrix diagonalization. I don't know if this is the right forum... Is there a way to compute the smallest real eigenvalue (and eigenvector if possible) of a general real nxn ...
1
vote
0answers
245 views

Structural mechanics traction boundary condition question

In structural mechanics, are the boundary conditions "free surface," "Traction free", "stress free" all equivalent Neumann boundary conditions?
1
vote
1answer
142 views

FEM oscillations for polynomials of degree 1

I have the following eliptic 1-D problem $$-\mu u'' + \beta u' = 1$$ $$u(0) = u'(1) = 1$$ where $\mu = 10e^{-5}$ and $\beta = 1$. For this specific problem I am using the following space steps $h=[0.1,...
1
vote
2answers
74 views

Maintain Uniform Distribution across Subranges

Note: this is a continuation of Generate Random Number outside Bounds. I have a function (thanks to the previous question) with the following prototype which returns an integer in the range $[0,b]$, $...
1
vote
3answers
155 views

How to choose $h$ in SPH?

I have a 2D implementation of smoothed particle hydrodynamics up and running, however when I tried to move it to 3D, using the appropriate 3D kernels, particles always tend to go apart from each other....
1
vote
0answers
629 views

linearly interpolate and determine gradients for data on non-uniform grid

I have measurements of a quantity on a 3d grid. My measurements are distributed on four x-y planes similar to what is shown in the image below. The measurements roughly follow a Cartesian grid but ...
1
vote
1answer
153 views

Where can an undergraduate go to find cores on a budget?

I've may have reached a point in my neural network research that I cannot continue without significant financial investment. I am using neuroevolution to evolve a network on the EMNIST data set. It ...
0
votes
1answer
94 views

Free access to Xeon Phi clusters

Apologies if this is not the right forum to ask, but there has been a somewhat related question here. I am working on a piece of software (nonlinear constrained optimisation, coded in C++11 and ...
0
votes
1answer
122 views

Calculation of error

I have written a code in which I find the approximation of the solution of this elliptic problem. I calculated the error using the following part of code: http://pastebin.com/7b5mmuRW but I get the ...
0
votes
1answer
90 views

How to recognize boundary nodes and sides from the given element node connectivity data

I'm writing a code in C++ to parse abaqus/calculix input file for 2D plane stress problems. I'm not a user of abaqus/calculix but I noticed that the input file doesn't ask complete boundary details. ...
0
votes
1answer
586 views

roots of polynomials of high degree: LinAlgError: Eigenvalues did not converge

I wrote a simple script to generate random polynoimals $\displaystyle f(z)= \sum_{k=0}^N a_k \frac{z^k}{\sqrt{k!}} $ of high degree and find their roots. For more discussion on random polyomials see ...
0
votes
0answers
40 views

state of art non smooth convex optimization [duplicate]

Basically, I am trying to implement non-smooth convex optimization in c++. I am wondering what is the state of art condition of non-smooth convex optimization. For example, what's the best method ...
0
votes
1answer
148 views

How to compute matrix representation of $\hat{y}\frac{\partial}{\partial x}$?

I have a 2-dimensional system which I would like to solve numerically (I'm using finite difference method right now), and its an eigenvalue problem. I have a term that looks like $H\psi(x,y) = [-\frac{...
0
votes
2answers
323 views

closed form approximation of matrix inverse with special properties

I'm trying to find some theory to help me explicitly express the inverse of a matrix (or a close approximation of the inverse). My matrix has the following properties: invertible positive definite ...
0
votes
1answer
2k views

scipy.integrate.odeint: how can odeint access a parameter set that is evolving independently of it?

I might have some non-linear ODEs that are being solved by scipy.integrate.odeint. However, a parameter at each time step might have to be updated by using a non-DE ...
0
votes
1answer
917 views

Is it possible to output the matrix condition number from pardiso (MKL)? [closed]

I am assuming the pardiso solver calculates (or estimates) the condition number before proceeding to the solution phase. Is there a way to make pardiso output the condition number? Alternatively, ...
0
votes
1answer
856 views

Finite-difference approximation of the 2nd derivative operator matrix for a staggered grid

I'm working on a computational physics assignment and I was looking for some help as I've got stuck! The question is: Write a function to create the finite-difference approximation of the 2nd ...
0
votes
1answer
118 views

How does the animation work in eigenvalue problem of FEM

I have used free vibration analysis in FEM. After analysis, we can usually use animation to see the motion of each eigenmode (In Abaqus or Comsol, I would choose either half harmonic or full harmonic)...
0
votes
1answer
151 views

Fast chain rule algorithm [closed]

Assume I have two functions $f$ and $g$, with derivatives of $g$ at point $x$ and derivatives of $f$ at point $g(x)$ available. What is the fastest way of computing derivatives of $f \circ g (x)$ ?
0
votes
2answers
2k views

Python implementation for Frechet Distance

I am working on a trajectory analysis project using python and its data science related libraries. I am planning to implement Frechet Distance algorithm for trajectory analysis, each trajectory has ...
0
votes
2answers
168 views

Finite element method applied to 1D structural problem - what is wrong with body force?

I have quadratic finite element - shape function is quadratic. Element spans from 0 to 5. Body force is given by (in physical coordinates) $$f_b = \int_0^5 N(x)^T b(x) dx \approx \sum_{i=1}^3 N(\...
0
votes
1answer
231 views

Linear solve using CHLOMOD in C

I am using the open-source CHLOMOD (as here http://faculty.cse.tamu.edu/davis/suitesparse.html) in order to solve a linear system Ax=b (performing A/b=x) in my domain decomposition code but I am ...
0
votes
1answer
728 views

How to define the derivative for Scipy.Optimize.Minimize

I am trying to use scipy.optimize.minimize to minimise a quadratic objective function: $f(x) =x^\top Q x$. As a start, I have successfully implemented this using the built-in Nelder-Mead Simplex ...
0
votes
1answer
178 views

Is there any rapid way to calculate the determinant of NXN covariance matrix?

I searched the web and found some C code for calculating the determinant of a $n\times n$ matrix. This code however seems timing complexity, and run pretty slow especially when handling a larger ...
0
votes
1answer
276 views

boundary conditions of linear advection problem

I am solving the 1D advection problem given by: $$\frac{\partial u}{\partial t}=-c\frac{\partial u}{\partial x}$$ where c is the wave speed, and u is the unknown field variable, and x and t are time ...
0
votes
2answers
243 views

Calculating integrals for a function approximated by Chebyshev polynomials

Setup (complete, but all very standard): My problem is how to best calculate the cumulative integral of a function which comes out of Spectral Collocation with a chebyshev basis. Take some function $...
0
votes
1answer
179 views

stiffness matrix for 3D regular grid in FEM

I have understood the stiffness matrix for 3D truss, and programmed Ku=f from scratch (in Java) to find the displacements. Then I moved to 3D solid but lost in too many concepts and equations, such ...
0
votes
1answer
37 views

Confirmation of FSAL property for IMEX methods by Kennedy and Carpenter

This question is a continuation of Fourth order IMEX Runge-Kutta method and Implementation details for high order IMEX methods by Kennedy and Carpenter. I need confirmation that ARK3(2)4L[2]SA by ...
0
votes
1answer
2k views

Python Finite Difference Schemes for 1D Heat Equation: How to express for loop using numpy expression

Hello all, I've recently been introduced to Python and Numpy, and am still a beginner in applying it for numerical methods. I've been performing simple 1D diffusion computations. I suppose my ...
0
votes
2answers
219 views

Numerical evaluation of the first and second complete elliptic integrals

To get a numerical evaluation of the first (K) and second (E) complete elliptic integrals: $$K(k)=\int_0^1\frac{dt}{(1-t^2)^{1/2}(1-k^2t^2)^{1/2}}, \ \ \ \ \ E(k)=\int_0^1\frac{(1-k^2t^2)^{1/2}}{(1-t^...
0
votes
1answer
140 views

Underdetermined/overdetermined polynomial interpolation

I am trying to apply a polynomial interpolation to 340 points in a 4D space, i.e., $$f(x,y,z)=k\, .$$ What I would like to understand is this: if I use a 6th order polynomial I will end up with 343 ...
0
votes
0answers
31 views

Minimizing the ratio of two specific non negative quadratic convex functions

$F$ is $m\times m$ diagonal, with real non negative elements $D$ is $n \times m$ complex $P$ is $n \times 1$ complex $A$ is $m \times 1$ complex. Minimize $\Gamma(A)$, with respect to $A$. $$\...
0
votes
0answers
54 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 ...
0
votes
2answers
194 views

Convex quadratic problem solver gives different answers?

I am pretty sure that the following variance objective function should be a convex quadratic problem. My objective function is as follows: $$ \text{argmin } \text{var }(X*L) \xi \geq 1, \text{ where }...
0
votes
1answer
491 views

ZGETRF and ZGETRS from MKL - zgetrf fails and still zgetrs works?

I have a large system of equations $$Ax=b$$ and I know matrix $A$ and right-hand side vector $b$. I'm using MKL to solve this system. The matrices are complex. I have used the general solver ...
0
votes
1answer
172 views

Euler-Bernoulli beam element versus continuum beam element

I am using OpenSees to model a simply supported beam with a point load in the middle. The model is in consistent units. The beam is made up of bilinear quad elements. I have used 30 elements along the ...
0
votes
2answers
128 views

Effective way to build the neighbor's list in MD

I'm trying to implement the following form of the cell/neighbor list method in my MD code. I have divided my simulation box into a fixed number of cells, and according to its positions, I have ...

15 30 50 per page