Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
4 votes
1 answer
174 views

I'm trying to take the following integral using sympy and it won't take it: >>> from sympy import * >>> integrate(x*exp(-(x-x0)**2), (x, 0, k)) If I 'help' it by adding and ...
0 votes
0 answers
42 views

I am unable to use PyCuba, a Python interface for the multidimensional-integration library Cuba, on macOS 15.5. PyMultiNest, which requires PyCuba, is common for Bayesian analysis in the scientific ...
0 votes
0 answers
73 views

Problem description I am trying to numerically calculate 4d integral: where d^4 x = dt d^3 x and the function f(x)=f(t,x) should be resolved on a large grid. In order to fit it in memory (I have a ...
0 votes
1 answer
66 views

I am trying to use sympy to integrate 1 / (1 + cot(x)) for variable x, (or its equivalent sin(x) / (sin(x) + cos(x)) ). I tried from sympy import * x = symbols("x", real=True) integrate(sin(...
0 votes
1 answer
64 views

I try to numerically compute the marginal densify function from the joint Gaussian probability density function given a specific value in the joint density. I use dmvnorm from mvtnorm package: library(...
YCao0920's user avatar
0 votes
2 answers
64 views

One way of calculating definite integrals is using finite difference methods. I have two ways: function1: def function1(f, dx, a, b): g=0 while a<b: g=g + dx*f(a) a=a + dx ...
1 vote
1 answer
99 views

I want to numerically evaluate the following integral: If the function f is given in discrete form on a grid, I want to be able to very efficiently compute the integral. The idea is to understand it ...
0 votes
1 answer
78 views

I was trying to make a little c++ program that integrates using the Simpson rule, but while I was testing I found out that it only works for some functions and some intervals. For example it works for ...
2 votes
1 answer
153 views

I am trying to solve a simple integral in Python using different methods for numerical integration. However, when I try to calculate the integrals, I obtain wrong results for small values of my x ...
0 votes
2 answers
83 views

I have a data frame where each row represent a community with number of species and number of individuals: n.species<- c(3,5,10,15,20) n.indiv <- c(30, 40, 50, 100, 200, 300, 500, 750, 1000) n....
dor sh's user avatar
  • 11
0 votes
0 answers
129 views

I am running a classic Quantum Harmonic Oscillator problem, and thus I need to find integrals containing Hermite polynomials. Unfortunately, sympy does not return a result for the integrals containing ...
0 votes
0 answers
92 views

I have been trying to solve the following for a couple of days now, using the Metropolis algorithm: This is taken from: https://arxiv.org/pdf/astro-ph/0505561. I basically approximate A with the ...
0 votes
2 answers
151 views

I have a problem with finding an integral of a function using Python sympy. I have tried the code below, but it prints the same expression as I had entered. import sympy as sp t, w, n = sp.symbols('t ...
0 votes
0 answers
123 views

I am trying to integrate in Julia: I have tried both QuadGK and Cubature with no success. This was my attempt with Cubature: function h_10(K, i) function integrand(x, v) return f_X_opt(K, i, x) ...
KBon's user avatar
  • 31
2 votes
1 answer
44 views

So I got this exercise: Using formula (18), implement the Gauss-Legendre method. The attached function [t, w] = gauleg(n) returns the node values ti and weights wi for the given polynomial degree n. ...

15 30 50 per page
1
2 3 4 5
...
56

AltStyle によって変換されたページ (->オリジナル) /