0
$\begingroup$

I have the following system

$$-a_1^2 + 2 a_0 a_2 - 2 b_0 b_2 =0\quad \text{and } \quad a_2^2 - 2 a_1 a_3 + 2 a_0 a_4 - b_2^2 - 2 b_0 b_4 =0$$

where the following $a_i, b_i$ are integral of some heavy function defined before in the notebook. I can give some example, but they basically depend on hypertrigonometric function.

$$ a_i= \int dk f_i(k,c,s) \quad b_i= \int dk g_i(k,c,s) $$

And I am interested in solving the system for $c,s$.

F[m_?NumericQ, p_?NumericQ] := Quiet[Chop[
    -NIntegrate[f1[k,c,s]/. { c -> m, s -> p}, {k, 0,
          Infinity} , WorkingPrecision -> 20, AccuracyGoal -> 50 ]*
      NIntegrate[
       f1[k,c,s]/. {c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50  ] + 
     2 NIntegrate[
      f0[k,c,s]/. { c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50 ] *
      NIntegrate[
      f2[k,c,s] /. {c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50  ] - 
     2 NIntegrate[
      g0[k,c,s] /. { c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50 ] *
      NIntegrate[
      g2[k,c,s] /. {c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50 ]
    ]];

G[m_?NumericQ, p_?NumericQ] :=    Quiet[Chop[
    NIntegrate[
      f2[k,c,s] /. {c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50]*
      NIntegrate[
       f2[k,c,s] /. { c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50] - 
     2 NIntegrate[
      f1[k,c,s]/. { c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50 ] *
      NIntegrate[
     f3[k,c,s] /. { c -> m, s -> p}, {k, 0, 
        Infinity}] + 
     2 NIntegrate[
       f0[k,c,s] /. {c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50] *
      NIntegrate[
      f4[k,c,s] /. { c -> m, s -> p}, {k, 0, 
        Infinity}] -
     NIntegrate[
      g2[k,c,s] /. { c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50]*
      NIntegrate[
      g2[k,c,s] /. { c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50] - 
     2*NIntegrate[
     g0[k,c,s]/. { c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 20, AccuracyGoal -> 50]*
      NIntegrate[
       g4[k,c,s]/. {c -> m, s -> p}, {k, 0, 
        Infinity}, WorkingPrecision -> 30, AccuracyGoal -> 50]
    ]];

FindRoot[{Chop[F[c, s]] == 0,    Chop[G[c, s]] ==0}, {{c, 0.8}, {s, 0.01}}

but FindRoot struggle to find a solution (but I know one should exist around 0.81 and 0.0128), I think it is because of the operations between numerical integrations. Unfortunately, it is not possible to solve analytically, is there a way to combine FindRoot with multiplication and soustraction of NIntegrate?

FindRoot: The line search decreased the step size to within tolerance specified \ by AccuracyGoal and PrecisionGoal but was unable to find a sufficient \ decrease in the merit function. You may need more than
MachinePrecision digits of working precision to meet these tolerances.

I already used FindRoot with a single NIntegrate==0 inside, and it worked well, but here product of NIntegrate must propagate a big error.

$\endgroup$
2
  • $\begingroup$ You should take a look at a basic tutorial about Mathematica's syntax. For example, you probably want f[1][k,m,p] or f1[k,m,p] instead of f_1(k,c,s)/. {c -> m, s -> p} After you've fixed that, do a single example to make sure that your numerical integrations are returning something sensible. Also, try plotting your F[c,s] to see if FindRoot has a chance of finding a root. $\endgroup$ Commented Aug 25 at 15:54
  • $\begingroup$ I have modified my answer sorry, you are right. I mixed up the Latex notation with mathematica on the forum $\endgroup$ Commented Aug 25 at 19:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.