Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.8K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Get a numerical solution of an equation containing an integral?

Posted 7 years ago

I have the following problem: given r, I have to find the {x,y} which satisfies:

Integrate[1/(E^((2*x^2-4*x*d+2*d^2+2*y^2)/(8*d+4*r^2))*(Sqrt[d]*(2*d+r^2))),{d,0,Infinity}]==1

however, of all the solutions, I am interested to find the one which has the maximum y. Unfortunately, the integral can be solved only numerically. Any help? Bye

POSTED BY: robby piscopo
2 Replies

If you restrict x, say to be nonnegative, then this is a straightforward optimization problem once the integral is made into a "black box" function that only evaluates for numeric input.

f[x_?NumberQ, y_?NumberQ, r_?NumberQ] := 
 NIntegrate[
   1/(E^((2*x^2 - 4*x*d + 2*d^2 + 2*y^2)/(8*d + 4*r^2))*(Sqrt[
         d]*(2*d + r^2))), {d, 0, Infinity}] - 1

Example:

FindMaximum[{y, f[x, y, 1/2] == 0, x >= 0}, {x, y}]

(* Out[69]= {1.26438464527, {x -> 0.340246814653, y -> 1.26438464527}} *)
POSTED BY: Daniel Lichtblau
Posted 7 years ago
Attachments:
POSTED BY: robby piscopo
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard