2
$\begingroup$

I want to know how I can solve this or plot a versus b ?

Solve[ Sqrt[a] Cosh[1.2 Log[1.65 Sqrt[1/a]]] == Sqrt[-b] Sinh[1.2 Log[1.65 Sqrt[-(1/b)]]], b]

Thanks

$\endgroup$

3 Answers 3

4
$\begingroup$

Your current code mentions that Solve tried to rationalize your floating-point constants. If you try to do that by hand, then Solve will return Solve::nsmet: This system cannot be solved with the methods available to Solve.

However, you can use ContourPlot to obtain a plot as a function of $a$ and $b$:

ContourPlot[
  Sqrt[a] Cosh[12/10 Log[165/100 Sqrt[1/a]]] == Sqrt[-b] Sinh[12/10 Log[165/100 Sqrt[-(1/b)]]],
  {a, 0, 8}, {b, -1/8, 0}, MaxRecursion -> 6
]

2D contour plot of the solution of the equation in OP

$\endgroup$
4
$\begingroup$

We can help Solve by converting the equation to a polynomial one.

eqn = Sqrt[a] Cosh[1.2 Log[1.65 Sqrt[1/a]]] == 
   Sqrt[-b] Sinh[1.2 Log[1.65 Sqrt[-(1/b)]]];

(* replace constants with symbols *)
coeff = DeleteDuplicates@Cases[eqn, _Real, Infinity] -> {c1, c2} // 
  Thread
(*  {1.2 -> c1, 1.65 -> c2}  *)

(* here's what the equation looks like *)
eqn /. coeff
(*
Sqrt[a] Cosh[c1 Log[Sqrt[1/a] c2]] == 
 Sqrt[-b] Sinh[c1 Log[Sqrt[-(1/b)] c2]]
*)

To get a polynomial equation, we rational the coefficients. Only c1 needs to be rationalized. We also convert the rational exponents to integers by raising the variables to the 10th power. This will introduce extraneous solutions which we will have to filter out.

Reverse@Rationalize@First@coeff
(*  c1 -> 6/5  *)

(* here's the polynomial equation *)
Simplify[
  eqn /. coeff /. Reverse@Rationalize@First@coeff /. {a -> u^10, 
     b -> -v^10} // TrigToExp,
  a > 0 && b < 0 && u > 0 && v > 0] // PowerExpand
(*
  c2^(6/5) (u - v) == (u v (u^11 + v^11))/c2^(6/5)
*)
vsol = Solve[
   Simplify[
     eqn /. coeff /. Reverse@Rationalize@First@coeff /. {a -> u^10, 
        b -> -v^10} // TrigToExp, a > 0 && b < 0 && u > 0 && v > 0] //
     PowerExpand, v];

Now check the solutions (one can use the tooltip in the front end if the legend is not clear enough):

Plot[
 eqn /. Equal -> Subtract /. b -> -Values[vsol]^10 /. 
      Reverse@Last@coeff /. u -> a^(1/10) // RealExponent // 
   MapIndexed[Tooltip] // Evaluate,
 {a, 0, 8}, PlotStyle -> "Rainbow", PlotRange -> {1, -18}, 
 PlotLegends -> Automatic]

enter image description here

The second and twelfth are solutions (over some interval), but the twelfth is complex-valued. The second one is the desired solution.

Plot[
-Values[vsol][[2]]^10 /. Reverse@Last@coeff /. u -> a^(1/10),
 {a, 0, 8}, PlotRange -> All]

Thus

bsol = -Values[vsol][[2]]^10 /. Reverse@Last@coeff /. u -> a^(1/10) // First
(*
-Root[1.82381 a^(1/10) + (-1.82381 - 0.548301 a^(6/5)) #1 - 
    0.548301 a^(1/10) #1^12 &, 2]^10
*)

Note that the 10th power arose from the rationalization of 1.2. If 1.2 is approximate, then the solution, while symbolic, is only approximate too.

$\endgroup$
1
$\begingroup$

One way to get solution in terms of root expression with variable substituion. (Use onesided eq.)

f[a_, b_] = 
 Sqrt[a] Cosh[
      1.2 Log[1.65 Sqrt[1/a]]] - (Sqrt[-b] Sinh[
       1.2 Log[1.65 Sqrt[-(1/b)]]]) // Rationalize // 
  FullSimplify[#, a >= 0 && b <= 0] &

(*   Sqrt[a] Cosh[3/5 Log[(400 a)/1089]] - 
 Sqrt[-b] Sinh[3/5 Log[-(1089/(400 b))]]   *)

Substitute the arguments of Sinh and Cosh.

sola = First@Solve[aa == 3/5 Log[(400 a)/1089] && a > 0, a, Reals]

(*   {a -> 1089/400 E^(5 aa/3)}   *)

solb = First@Solve[bb == 3/5 Log[-(1089/(400 b))] && b < 0, b, Reals]

f2[aa_, bb_] = 
 f[a, b] /. sola /. solb // Simplify[#, Element[{aa, bb}, Reals]] &

(*   33/20 (E^(5 aa/6) Cosh[aa] - E^(-5 bb/6) Sinh[bb])   *)

sol3 = First@Solve[f2[aa, bb] == 0, bb, Reals]

(*   {bb -> 6 Log[Root[-1 - 2 E^(5 aa/6) Cosh[aa] #1^11 + #1^12 &, 2]]}   *)

sol4 = sol3 /. aa -> 3/5 Log[(400 a)/1089] /. 
  bb -> 3/5 Log[-(1089/(400 b))]

solb = First@Solve[sol4 /. Rule -> Equal, b] // FullSimplify

(*   {b -> -(1089/(
   400 Root[-33 - 40 Sqrt[a] Cosh[3/5 Log[(400 a)/1089]] #1^11 + 
       33 #1^12 &, 2]^10))}   *)

Plot[b /. solb, {a, 0, 5}]
$\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.