2
$\begingroup$

I'm stuck on this and chagrined I'm even asking, but this:

NSolve[{-12 + 16 Cos[t]^2 == 4 - 2 s^3, 
  4 - 2 t^3 == s^3, -π <= s < π, -π <= t < π}, {s, t}]

gives "NSolve::nsmet: This system cannot be solved with the methods available to NSolve", or Solve for that matter. Thank you

$\endgroup$
1
  • 1
    $\begingroup$ From the documentation: "NSolve deals primarily with linear and polynomial equations". This is more of a problem for FindRoot. $\endgroup$ – Sjoerd Smit Oct 21 '20 at 15:00
3
$\begingroup$

You could solve it as a minimization:

NMinimize[{(-12 + 16 Cos[t]^2 - (4 - 2 s^3))^2 + ( 
    4 - 2 t^3 - s^3)^2, -π <= s < π, -π <= t < π}, {s, t}]
(* result: {3.16777*10^-30, {s -> 1.49116, t -> 0.699433}} *)

system = {-12 + 16 Cos[t]^2 == 4 - 2 s^3, 4 - 2 t^3 == s^3, -π <= s < π, -π <= t < π};
system /. {s -> 1.4911575481418087`, t -> 0.6994333479233502`}

(* result: {True, True, True, True} *)
$\endgroup$
3
$\begingroup$
Clear["Global`*"]

eqns = {-12 + 16 Cos[t]^2 == 4 - 2 s^3, 4 - 2 t^3 == s^3};

The exact solution for t is a Root expression

solt = Solve[{Eliminate[eqns, s], -π <= t < π}, t][[1]]

enter image description here

solt // N

(* {t -> 0.699433} *)

The exact solution for s is similarly

sols = Solve[{eqns[[2]] /. solt, -π <= s < π}, s][[1]]

enter image description here

sols // N

(* {s -> 1.49116} *)

(eqns /. solt /. sols) // N

(* {True, True} *)
$\endgroup$
2
  • $\begingroup$ Strangely, your Solve[{t^3 == 2 Cos[2 t], -π < t < π}, t] works but the equivalent Solve[t^3 == 2 Cos[2 t], t] does not work. Your solution is better than the FindRoot application I proposed. $\endgroup$ – Roman Oct 21 '20 at 15:31
  • 1
    $\begingroup$ @Roman - in this case, the constraint is equivalent to specifying the domain as real, i.e., Solve[t^3 == 2 Cos[2 t], t, Reals] $\endgroup$ – Bob Hanlon Oct 21 '20 at 16:23
2
$\begingroup$

Substitute the second equation into the first:

FullSimplify[-12 + 16 Cos[t]^2 == 4 - 2 s^3 /. s^3 -> 4 - 2 t^3]
(*    t^3 == 2 Cos[2 t]    *)

By inspection we see that there is only one solution:

Plot[{t^3, 2 Cos[2 t]}, {t, -2, 2}, PlotRange -> {-3, 3}]

enter image description here

Find the solution and compute $\{s,t\}$:

{(4 - 2 t^3)^(1/3), t} /. FindRoot[t^3 == 2 Cos[2 t], {t, 1}]
(*    {1.49116, 0.699433}    *)
$\endgroup$
2
$\begingroup$

NSolve can solve the system as complex problem:

csol = NSolve[{-12 + 16 Cos[t]^2 == 4 - 2 s^3, 
   4 - 2 t^3 == s^3, -π <= Re@s < π, -π <= Re@t < π,
    -1/10 < Im@s < 1/10, -1/10 < Im@t < 1/10}, {s, t}]
rsol = Chop[csol]
(*
  {{s -> 1.49116 + 0. I, t -> 0.699433 + 0. I}}
  {{s -> 1.49116, t -> 0.699433}}
*)

Update

Solve also works if you avoid the singularity at s == 0:

Solve[{-12 + 16 Cos[t]^2 == 4 - 2 s^3, 4 - 2 t^3 == s^3,
  1 < s < 2, -π <= t < π}, {t, s}, Reals]
(*
{{t -> Root[{2 - 4 Cos[#1]^2 + #1^3 &, 0.69943334792335012145}], 
  s -> Root[-4 + 2 Root[{2 - 4 Cos[#1]^2 + #1^3 &, 
         0.69943334792335012145}]^3 + #1^3 &, 1]}}
*)

Also if it is "factored" out (as a product $(s,t)\times (u)$):

Solve[{-12 + 16 Cos[t]^2 == 4 - 2 u, 4 - 2 t^3 == u, u == s^3,
  -π <= s < π, -π <= t < π}, {t, s, u}, Reals]
(*
{{t -> Root[{2 - 4 Cos[#1]^2 + #1^3 &, 0.69943334792335012145}], 
  s -> Root[-8 + 8 Cos[Root[{2 - 4 Cos[#1]^2 + #1^3 &, 
          0.69943334792335012145}]]^2 + #1^3 &, 1], 
  u -> 8 - 8 Cos[Root[{2 - 4 Cos[#1]^2 + #1^3 &, 
          0.69943334792335012145}]]^2}}
*)
$\endgroup$
1
$\begingroup$

Use ContourPlot and Graphics`MeshFindIntersections.

And then use FindRoot again.

Clear["`*"];
Clear["`*"];
curves = ContourPlot[{-12 + 16 Cos[t]^2 == 4 - 2 s^3, 
   4 - 2 t^3 == s^3}, {s, -π, π}, {t, -π, π}, 
  PlotPoints -> 200, 
  ContourStyle -> {Directive[Red, Thickness[Tiny]], 
    Directive[Blue, Thickness[Tiny]]}, ImageSize -> Full]
Graphics`Mesh`FindIntersections[curves[[All, 1]]]
(* {{1.49114,0.699426}} *)

FindRoot[{-12 + 16 Cos[t]^2 == 4 - 2 s^3, 4 - 2 t^3 == s^3}, {s, 
  1.49114}, {t, 0.699426}]
(* {s -> 1.49116, t -> 0.699433} *)

enter image description here

$\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.