Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.3K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

[?] Convolution of a normal distribution and a partially defined function?

Posted 6 years ago
POSTED BY: Mitch Mayerhofer
 Integrate[Sqrt[1 + 1/(-x^2 + 1)]*Exp[-(u - x)^2], {x, -1/2, 1/2}]
(* Returns an input,Mathematica dosen't know the answer.*)

When Mathematica returns the input as the output, it means that the calculation returned unevaluated. This often means that the function does not have the methods available to solve the problem symbolically, or it is mathematically impossible to obtain a symbolic solution (not all sums, integrals, or differential equations have symbolic solutions after all).

With numerics we able a plot solution:

g[u_?NumericQ] := NIntegrate[Sqrt[1 + 1/(-x^2 + 1)]*Exp[-(u - x)^2], {x, -1/2, 1/2}]
Plot[g[u], {u, -3, 3}]

enter image description here

By using NonlinearModelFit command we can find a good approximate function:

data = Table[{u , g[u]}, {u, -3, 3, 1/10}] // N;
nlm = NonlinearModelFit[data, a + b*Exp[-c*u^2 + d], {a, b, c, d}, u] // Normal


(* -0.00114935 + 0.399547 E^(1.20727 - 0.846568 u^2) *)

Plot[{g[u], nlm}, {u, -3, 3}, PlotStyle -> {Black, {Dashed, Red}}]

enter image description here

Plot[{g[u] - nlm}, {u, -3, 3}](*Residuals*)

enter image description here

Regards M.I.

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard