0

After solving many issues with the below integral, I still need some help to get to a proper solution. I tried to reduce the complexity as much as possible, thanks for your help.

Lets take this example:

b <- function(t) { # variable upper bound
  if (t<0) t
  else 0
}

Doubleintegral:

f<-function(g,t){
    exp(75*g)*
    exp(-35*t-((-t + 0.001283464)^2)/0.0001468898)
}

result <- (integrate(Vectorize(function(t) integrate(function(g) f(g,t), -2.5,b(t))$value), -2, 2, stop.on.error=FALSE)$value)

This gives me:

> (integrate(Vectorize(function(t) integrate(function(g) f(g,t), -2.5,b(t))$value), -2, 2, stop.on.error=FALSE)$value)
[1] 0.0002256195

While Wolfram Alpha gives me only 0.00012.. Link to Wolfram

I checked the function in Wolfram and it is the same as here. Does someone has a solution to solve this problem? thank you very much!

Valegard234
  • 45
  • 1
  • 7
  • When I click on your W|A link, I get a message "standard computation time exceeded". That sounds suspicious. – Hong Ooi Sep 19 '14 at 02:30
  • PS. anonymous downvoter, explain your reasons please. – Hong Ooi Sep 19 '14 at 02:30
  • The Link works for me. copy past this to wolfram: `integration [//math:exp(75*x)*exp(-35*y-((-y + 0.001283464)^2)/0.0001468898)//] [//math:dx dy//] for x from [//math:-2.5//] to [//math:min(0,y)//] for y from [//math:-2//] to [//math:2//]` – Valegard234 Sep 19 '14 at 08:02
  • 1
    Yes, it gives a numeric result. But did you also see the box underneath with that warning message? It may be that the computation was stopped prematurely. – Hong Ooi Sep 19 '14 at 08:27
  • omg I did not see that message and I actually have a pro account. If i extend the computation time it gives me the same result. thanks for your hint. – Valegard234 Sep 19 '14 at 08:44
  • You might want to put that as an answer, or edit your question to note that you've solved it. – Hong Ooi Sep 19 '14 at 13:11

1 Answers1

0

By extending the computation time, the results are consistent. thanks @Hong Ooi

Valegard234
  • 45
  • 1
  • 7