integrate

R integrate: returns wrong solution (is using wrong quadrature points?)

断了今生、忘了曾经 提交于 2020-01-17 06:26:12
问题 I have a function in R which I am trying to integrate, but for some (extreme) values of the function parameters, integrate returns the incorrect solution. I believe the issue may be that integrate selects improper quadrature points for some of these extreme values, but first I will provide demonstrate the issue. The function I wish to integrate is the following. integrandFunc_F <- function(x, func_u, func_u_lowerBar, func_u_upperBar, func_mean_v, func_sigma_v, func_sigma_epsilon, func_sigma_y

how to solve this problem in R: In while (t <= cc[i]) { … : the condition has length > 1 and only the first element will be used

允我心安 提交于 2020-01-16 05:36:11
问题 big thank you and warm regards for the answer Mr. Tom, for the detail problem may you can help me the following step : I have a problem with R Program, first, I make a trendlinier (At+B) from this data set timedelay<-c(76.77,65.88,60.96,51.61,48.72,39.86,35.43,33.36,30.32,23.96,16.95,3.564) timedelayts<-ts(timedelay,start=c(2011,1),freq=12) plot(timedelayts,ylab="Time Delay",col="blue") time=ts(1:length(timedelayts),start=c(2011,1),freq=12) trendlinier<-lm(timedelayts~time) trendlinier Call:

How do I use parameter epsabs in scipy.integrate.quad in Python?

青春壹個敷衍的年華 提交于 2020-01-15 09:46:47
问题 I am trying to make my integral more precise by specifying the parameter epsabs for scipy.integrate.quad , here say we will be integrating the function sin(x) / x^2 from 1e-16 to 1.0 from scipy.integrate import quad import numpy integrand = lambda x: numpy.sin(x) / x ** 2 integral = quad(integrand, 1e-16, 1.0) This gives you (36.760078801255595, 0.01091187908038005) However, if you specify the absolute error tolerance with epsabs with the following from scipy.integrate import quad import

Integration not successful in Python QuTiP

孤街醉人 提交于 2020-01-14 03:27:08
问题 I have been trying to use QuTiP to solve a quantum mechanics matrix differential equation (a Lindblad equation). Here is the code: from qutip import * from matplotlib import * import numpy as np hamiltonian = np.array([[215, -104.1, 5.1, -4.3 ,4.7,-15.1 ,-7.8 ], [-104.1, 220.0, 32.6 ,7.1, 5.4, 8.3, 0.8], [ 5.1, 32.6, 0.0, -46.8, 1.0 , -8.1, 5.1], [-4.3, 7.1, -46.8, 125.0, -70.7, -14.7, -61.5], [ 4.7, 5.4, 1.0, -70.7, 450.0, 89.7, -2.5], [-15.1, 8.3, -8.1, -14.7, 89.7, 330.0, 32.7], [-7.8, 0.8

Error calculating the area between two lines using “integrate”

﹥>﹥吖頭↗ 提交于 2020-01-07 02:57:05
问题 I'm attempting to calculate the area between two plots using R's integrate function. I have two forecast curves that I'm able to place on the same plot and also shade in the area between the two curves, for visualisation: x1 = seq(1,200,1) y1 = # 200 numbers from 0.02 - 1.000 y2 = # 200 numbers from 0.00 - 0.95 plot(x1,y1,type="l",bty="L",xlab="Forecast Days",ylab="Curve Actuals") points(x1,y2,type="l",col="red") polygon(c(x1,rev(x1)),c(y2,rev(y1)),col="skyblue") Following the example here

I need to integrate two sites, what's the best way to carry over login information?

本小妞迷上赌 提交于 2020-01-06 03:59:47
问题 So, I have two sites, sites A and B. I need to make B part of A. I did this by adding a module to A, and within that module, an iframe that contained a link to B. So, effectively speaking, B can still be accessed as a standalone site, but it can also be accessed through A. Now, both sites require a login to allow access. I need to bypass the login for site B when it is accessed through Site A. I managed to bypass it, but only if the two sites are hosted on the same server (I used session

Integrate Python and his libraries with Java

故事扮演 提交于 2020-01-03 06:34:49
问题 I integrate Python and Java with Jython but I need some libraries(pandas, numpy, skfuzzy, matplotlib, sklearn, pickle) but Jython can't support some of them. Is it possible import that libraries from Jython or exist other Framework, language, library, something that afford a complete integrate with Python libraries. 回答1: Unfortunately the code for packages like numpy and scipy includes extension modules written in languages like Fortran and C, which are specifically tailored to the CPython

Divergent Integral in R is solvable in Wolfram

半腔热情 提交于 2019-12-31 07:34:06
问题 I know that I asked the same question before, but as I am pretty new here the question was asked poorly and not reproducible. Therefore I try to do it better here. (If I only edit the old one probably nobody will read it) I have this double integral that I would like to integrate:Here is a picture ff<-function(g,t) exp((16)*g)*exp(-8*t-(-t-0.01458757)^2/(0.0001126501)) integrate(Vectorize(function(t) integrate(function(g) ff(g,t), -2.5,0)$value), -2, 2) Running this in R gives me the error:

Big integration error with integrate.nquad

家住魔仙堡 提交于 2019-12-30 07:49:20
问题 Firstly, I integrate a simple function on an ellipse. Secondly, I integrate the same function to which I add a constant value. The results are not consistent as you can see on the bottom of my message. Thanks in advance for you help. # -*- coding: utf-8 -*- from scipy import integrate from math import * a = 2.0; b = 1.0; Cst = 1.0 def f1(x, y): return sqrt(abs(1. -(x/a)**2 -(y/b)**2)) def f2(x, y): return sqrt(abs(1. -(x/a)**2 -(y/b)**2)) + Cst def un(x, y): return 1.0 def bounds_y(): return

Can you upload data to the Google Analytics API?

烈酒焚心 提交于 2019-12-25 01:44:28
问题 There are companies out there that claim to "integrate" data into GA. I know some phone call tracking companies in particular. Is there a way that they are uploading data to GA through the API or are they using some other method that doesn't require that? 回答1: There is no upload mechanism into Google Analytics besides manual __utm.gif calls like in the browser. Both Google Analytics APIs (Data Export and Management) are completely Read-Only. There are a few ways these solutions work, but one