integrate

Using scipy.integrate.quad to perform 3D integral

点点圈 提交于 2019-12-02 06:25:32
Motivation for the question I'm trying to integrate a function f(x,y,z) over all space. I have tried using scipy.integrate.tplquad & scipy.integrate.nquad for the integration, but both methods return the integral as 0 (when the integral should be finite). This is because, as the volume of integration increases, the region where the integrand is non-zero gets sampled less and less. The integral 'misses' this region of space. However, scipy.integrate.quad does seem to be able to cope with integrals from [-infinity, infinity] by performing a change of variables... Question Is it possible to use

Integrate: the integral is probably divergent

只谈情不闲聊 提交于 2019-12-01 21:27:16
I was doing some integration into a loop using integrate and I come up with an error I can't understand neither get rid of. Here is a MWE I could extract: u_min = 0.06911363 u_max = 1.011011 m = 0.06990648 s = 0.001092265 integrate(f = function(v){pnorm(v, mean = m, sd = s, lower.tail = FALSE)}, u_min, u_max) this returns an error "the integrale is probably divergent" which is obviously false. I tried to modify the parameters a little bit and got this working for example: u_min <- 0.07 u_max <- 1.1 m <- 0.0699 s <- 0.00109 integrate(f = function(v){pnorm(v, mean = m, sd = s, lower.tail = FALSE

Can I integrate MathJax into a Python program?

左心房为你撑大大i 提交于 2019-12-01 03:30:40
问题 This might be a silly question, but is it possible to merge MathJax into Python code? Many times I've wished the program output would look more neat, and honestly MathJax looks awesome. I know MathJax runs on Javascript, yet I have not given up hope. If the answer is no, are there some simple modules to use instead? For example, if: 1.234 / e^23 [and] (I^-)_(aq) +I _(2(s)) -> (I^-)_3(aq) could be formatted as: , that would be ideal. 回答1: I can only presume that maybe you want to output

integrate a very peaked function in R

橙三吉。 提交于 2019-12-01 00:33:22
I am using integrate function in R to integrate a very peaked function. Say that function is a log-normal density: xs <- seq(0,3,0.00001) fun <- function(xs) dlnorm(xs, meanlog=-1.057822,sdlog=0.001861871) plot(xs,fun(xs),type="l") From the plot, I know that the peak is at around 0.3-0.4. If I integrate this density function over its support (with increased abs.tol and increased subdivisions) the integrate gives me zero, which should not be true. integrate(fun,lower=0,upper=Inf,subdivisions=10000000,abs.tol=1e-100) 0 with absolute error < 0 However, if I restrict the interval to 0.3 and 0.4,

Can I integrate checked out files into a different branch on perforce

▼魔方 西西 提交于 2019-11-30 18:40:01
We were working on a design, and for that we created the skeleton of the classes in our main branch. Now, we are starting to code, and for that we got a new branch. So, it would be nice if I can move all the new files in the main branch into the new branch. However, I cannot check them in yet. So, is it possible to integrate the checked out changelist? Thanks. bk1e The Perforce support web site explains how to do this: Perforce Knowledge Base: Branching work in progress . It would be nicer if it was a single step that didn't require running eight different commands. Gareth Rees Since release

integrate a very peaked function in R

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 18:07:51
问题 I am using integrate function in R to integrate a very peaked function. Say that function is a log-normal density: xs <- seq(0,3,0.00001) fun <- function(xs) dlnorm(xs, meanlog=-1.057822,sdlog=0.001861871) plot(xs,fun(xs),type="l") From the plot, I know that the peak is at around 0.3-0.4. If I integrate this density function over its support (with increased abs.tol and increased subdivisions) the integrate gives me zero, which should not be true. integrate(fun,lower=0,upper=Inf,subdivisions

How to integrate KIE Workbench 6.1.0.Final (Drools Guvnor) Project with Java Application

邮差的信 提交于 2019-11-29 15:35:39
I am using KIE Workbench 6.1.0.Final and my Eclipse project where I am trying to execute rules is also 6.1.0 Runtime enabled. I like to know how I can execute/load rules created using Drools Guvnor, from my java application. Before posting this question, I have looked at the following similar questions and tried the given approaches but none of them worked for me. Integrating Drool 6 work bench with Java Application why does loading Drools 6 KIE JAR into code fail? Loading Drools/KIE Workbench artifacts directly from the repository KIE Workbench Integration Responds with 401 I have followed

Is there any way to integrate OpenCV with PHP?

五迷三道 提交于 2019-11-29 03:18:36
I am trying to develop an application with PHP. There are two possible ways this application will be developed. The first one is to try to do something like www.picnik.com , image processing directly on the browser. The other is to develop CBIR (content-bases image retrieval) algorithms. So, is it possible to send an image from a PHP script to an OpenCV program? Or even display the image being manipulated in real time? Thanks. Doing a google search for 'php opencv' suggests - yes you can :) This one looks decent. http://www.xarg.org/project/php-facedetect/ (I know it's specific to face

Is there any way to integrate OpenCV with PHP?

烂漫一生 提交于 2019-11-27 17:28:44
问题 I am trying to develop an application with PHP. There are two possible ways this application will be developed. The first one is to try to do something like www.picnik.com, image processing directly on the browser. The other is to develop CBIR (content-bases image retrieval) algorithms. So, is it possible to send an image from a PHP script to an OpenCV program? Or even display the image being manipulated in real time? Thanks. 回答1: Doing a google search for 'php opencv' suggests - yes you can

Dispersing n points uniformly on a sphere

浪尽此生 提交于 2019-11-27 15:51:04
问题 I am trying to disperse n points on a sphere such that each point has the "same" area "around" it. Basically, I'm trying to integrate a function over a sphere by evaluating at n points and assuming that each area element is the same (and equal to 4pi r^2/n). My question is very related to this one, but I can't seem to agree that the code presented in the "accepted" answer works as desired (see attached photo, generated by choosing R = 1000, nx = ny = 40). Clearly, my points are much more