1
$\begingroup$

I am trying to find solutions of an equation in two variables k and n. Alternatively, I would also be okay with a plot which shows the variation of one versus another.

Nnorm[n_] := 
  Sqrt[2]*(1 - 2/(n + 1/6))^(1/4)*(1 - 2/n)^(-1/
   2)*(1 - 2/(n + 1/12))^(1/2);

F[u_, L_, k_, w_] := 
  u^2/(8 Pi*L*Sqrt[1 + (L/(2 k))^2])*Cos[2*w*k*ArcSinh[L/(2 k)]];

The value of parameters u, L, w are known. After using FullSimplify[F[0.01, L, k, 10]]and my requirement between relation of F and Nnorm : F = -0.00003*Nnorm I will obtain an equation like this :

 (7.957747154594767`*^-6 Cos[20 k ArcCsch[(2 k)/L]])/(
  L Sqrt[4 + L^2/k^2]) + (0.00003*(
    2 n (1 - 2/(1/12 + n)) Sqrt[1 - 2/(1/6 + n)])/(-2 + n)) == 0

This is what I want to solve or plot, an equation in two variables. The only thing that partially works is the following :

F[0.001, 100, 200, 10];

(* obtaining the value of F here and then manually substituting as follows : *)

Solve[-0.00003*2*(1 - 2/(n + 1/6))^(1/
   2)*(1 - 2/n)*(1 - 2/(n + 1/12)) == 3.55881271708, n]

This doesn't always work so I cannot put this in a loop or an Export command.

I have tried using Simplify, FullSimplify, Solve, ContourPlot, Reduce, InverseFunctionto no avail.

I cannot use FindRoot by taking some value for either k or n and using it on the other because I simply have no idea what to give for starting value for the FindRoot function.

I have also looked at this, this and this at the very least.

The main culprit here, I think, is ArcSinh without which Solve will probably do the job. I tried to eliminate ArcSinh by comparing the values of L and k but again nothing.

Please give me some help on how to tackle this issue.

Edit : I use

Plot3D[{F[1/1000, 10^90, k, 10], -3*^-5*(Binomial[n, 2])^-1}, {n, 
  10^16, 10^17}, {k, 10^60, 10^61}, PlotPoints -> 100, 
 MaxRecursion -> 5, WorkingPrecision -> 110, AxesLabel -> Automatic, 
 PlotLegends -> "Expressions"]

to get

n from 10^16 to 10^17

For any higher values of n the plot disappears and this plot also seems to be missing things compared to the answer below. Can I say that for n=6.4*10^16 the constraint I require is satisfied?

$\endgroup$

1 Answer 1

2
$\begingroup$
Clear["Global`*"]

Nnorm[n_] := 
  Sqrt[2]*(1 - 2/(n + 1/6))^(1/4)*(1 - 2/n)^(-1/2)*(1 - 2/(n + 1/12))^(1/2);

FunctionDomain[Nnorm[n], n]

(* n < -(1/6) || n > 2 *)

However, if Nnorm is simplified for n > 0

FunctionDomain[Simplify[Nnorm[n], n > 0], n] //
 Simplify[#, n > 0] &

(* 11/6 <= n < 23/12 || n > 2 *)

Plotting

Plot[-3*^-5*Nnorm[n], {n, -2, 5},
 PlotPoints -> 100,
 MaxRecursion -> 5,
 WorkingPrecision -> 15]

enter image description here

F[u_, L_, k_, w_] := 
  u^2/(8 Pi*L*Sqrt[1 + (L/(2 k))^2])*Cos[2*w*k*ArcSinh[L/(2 k)]];

Plot3D[
 {F[1/1000, 100, k, 10], -3*^-5*Nnorm[n]},
 {n, 11/6, 23/12}, {k, 0, 200},
 PlotPoints -> 100,
 MaxRecursion -> 5,
 WorkingPrecision -> 15,
 AxesLabel -> Automatic,
 PlotLegends -> "Expressions"]

enter image description here

sol1[k_?NumericQ] := FindRoot[
    F[1/1000, 100, k, 10] == -3*^-5*Nnorm[n],
    {n, #}, WorkingPrecision -> 15] & /@
  {11/6, 23/12 - 1*^-6}

sol1[200]

(* {{n -> 1.83333333333333}, {n -> 1.91666666622529}} *)

sol2[k_?NumericQ] := NSolve[{11/6 <= n < 23/12,
   F[1/1000, 100, k, 10] == -3*^-5*Nnorm[n]},
  n, WorkingPrecision -> 15]

sol2[200]

(* {{n -> 1.91666666663313}, {n -> 1.83333333333333}} *)

% /. x_Real :> RootApproximant[x]

(* {{n -> 23/12}, {n -> 11/6}} *)
$\endgroup$
4
  • $\begingroup$ Can you please help me understand your answer better? Since I had no idea about what to give as initial value to FindRoot you found the domain of Nnorm. I am interested in the range of n>0 or even n>2. I don't understand why you did the 3D plot. Then you give 2 ways to solve for constraint between F & Nnorm. I could use either of them with a loop or Export to generate a data file with values of n & k. Perfect. The only problem is that for some reason this is not working for n>2. I get the output as {}. Was the reason to do 3D plot to show what values of n work? $\endgroup$
    – Nitin
    Commented Apr 24, 2020 at 8:21
  • $\begingroup$ When I use sol2[k_?NumericQ] := NSolve[{3 <= n < 5, F[1/1000, 100, k, 10] == 3*^-5*Nnorm[n]}, n, WorkingPrecision -> 15] and sol2[200] I get the output : {} $\endgroup$
    – Nitin
    Commented Apr 24, 2020 at 8:23
  • $\begingroup$ Since you said that you tried ContourPlot it appeared that you were looking for real-valued solutions. Nnorm has a very limited range where it is real and takes values such that F == -0.00003*Nnorm for the values of u, L, and w that you gave. The plot above was used to determine how to estimate the initial values for FindRoot. In this case, constants could be used over a wide range of k. sol2 works with v12.1, perhaps you are using a different version. sol2 is not needed if sol1 works for you since they should give identical results. $\endgroup$
    – Bob Hanlon
    Commented Apr 24, 2020 at 14:13
  • $\begingroup$ Actually, please let me modify it a little bit. I had used an approximation for factorial. Original equation that I need to solve would be this : -0.00003 = Binomial[n,2]*(3.97887*10^-8 Cos[200 k ArcSinh[L/(2 k)]])/(L Sqrt[1 + L^2/(4 k^2)]) for various values of L, specially when L>>k. Inspired from your answer I have been using Plot3D to get the available regions for n which is also quite large maybe of order 10^23 but I am not getting anything. I am posting some outputs, if possible please look at them and give me a little bit more help. $\endgroup$
    – Nitin
    Commented Apr 24, 2020 at 14:41

Your Answer

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

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