0
$\begingroup$

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


Many tahnks. It works now. However the calcualtion looks quite unstable. Have a look to my .nb:

this is the mathematica .nb file:

 rangeρ = {0, 0.1, 1, 10, 100};
rangeRy = {10^-5, 10^-4, 10^-3, 10^-2, 10^-1, 10^0, 10^1, 10^2, 10^3, 
   10^4, 10^5};
integrale[ξ_, ψ_, ζ_, ρ_] := 
  NIntegrate[ (
   E^(-((2 ξ^2 - 4 ξ δ + 2 δ^2 + 2 ψ^2 + 
      2 ζ^2 + (ρ^2 ζ^2)/δ)/(
    8 δ + 4 ρ^2))))/(
   Sqrt[δ] (2 δ + ρ^2)), {δ, 0, Infinity}];
solu = Table[
  NMaximize[ψ, 
    2/Sqrt[π] Ry integrale[ξ, ψ, 0, ρ] == 
     1, {ξ, ψ}][[2, 2, 2]], {ρ, rangeρ}, {Ry, 
   rangeRy}]    

for example, the large numebr obtained for rho = 0, do not have much sense

for example, the large numebr obtained fro rho = 0, do not have much sense

I beg your pardon but I cannot manage to paste a notebbok as you did before. My code is:

ranger = {0, 0.1, 1, 10, 100};
rangeRy = {10^-5, 10^-4, 10^-3, 10^-2, 10^-1, 10^0, 10^1, 10^2, 10^3, 10^4, 10^5};

integrale[x_,y_,z_,r_]:=NIntegrate[(E^(-((2 x^2-4 x d+2 d^2+2 y^2+2 z^2+(r^2 z^2)/d)/(8 d+4 r^2))))/(Sqrt[d] (2 d+r^2)), {d,0,Infinity}];
solu=Table[NMaximize[y,2/Sqrt[π] Ry integrale[ξ,ψ,0,r]==1,{ξ,ψ}][[2,2,2]],{r,ranger},{Ry,rangeRy}]

If you willl run it you will see very big numbers that are surely a mistake. Problably there is the need of increasing the accuracy or the working precision? many thanks

$\endgroup$
1
  • $\begingroup$ Please edit to add links to-from the cross-post on Wolfram Community. $\endgroup$ – Daniel Lichtblau Feb 6 '19 at 15:15
3
$\begingroup$

First define the integral

int[x_, y_, r_] :=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}]

Now you can maximize as intended. For example r=1

NMaximize[{y , int[x, y, 1] == 1}, {x, y}]
(* {1.30787, {x -> 0.404927, y -> 1.30787}}*)
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.