2
$\begingroup$

I have the integral

enter image description here

which I express in Mathematica code as:

Integrate[
   (-((x^2 (c + x^2 (b + a x^2)))/(m + x^2 (v + d x^2))) + Abs[x])^2, 
   {x, -1, 1}]

I am looking to find the coefficients/constants c, b, a, d, m, and v which minimize this nonelementary integral.

I was thinking I might find a series approximation of the integral, then minimize that, but I'm not sure how to do so using Mathematica.

$\endgroup$
  • 1
    $\begingroup$ as it should be the same as minimizing the norm of $Abs [x]$ and $(x^2 (c + x^2 (b + a x^2)))/(m + x^2 (v + d x^2))$,how about using of NonlinearModelFit? expr = (x^2 (c + x^2 (b + a x^2)))/(m + x^2 (v + d x^2)); input = x; cofs = {a, b, c, d, m, v}; NonlinearModelFit[ {#, Abs[#]} & /@ Range[-1, 1, .01], expr, cofs, input] $\endgroup$ – Xminer Dec 20 '19 at 1:45
3
$\begingroup$

In order to be more specific refering to the answer of @Yusuf, try:

func[x_, a_, b_, c_, d_, m_, v_] = 
     (-((x^2 (c + x^2 (b + a x^2)))/(m + x^2 (v + d x^2))) + 
     Abs[x])^2;

nint[a_?NumericQ, b_?NumericQ, c_?NumericQ, d_?NumericQ, m_?NumericQ, v_?NumericQ] := 
NIntegrate[func[x, a, b, c, d, m, v], {x, -1, 1}]

NMinimize[nint[a, b, c, d, m, v], 
   {{a, 0, 1}, {b, 0, 1}, {c, 0, 1}, {d, 0, 1}, {m, 0, 1}, {v, 0, 1}}]

(*   {0.0000131187, {a -> 1.25015, b -> 2.12136, c -> 0.0859803, d -> 2.75847, 
          m -> 0.00319823, v -> 0.680549}}   *)

But you have no warranty, that this is a global minimum. Use starting values for the parameters, that make sense according to your problem.

| improve this answer | |
$\endgroup$
0
$\begingroup$
NMinimize[NIntegrate[f[x, a, b, c(*extend to however many coefficients/constants are in your function*)], {x, -1, 1}], {a, b, c(*extend to however many coefficients/constants are in your function here as well*)}]
| improve this answer | |
$\endgroup$

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.