2
$\begingroup$

Mathematica throws the following message when I try to solve the equation below

"Solve::nsmet: This system cannot be solved with the methods available to Solve".

Setting $P_T = 0.5$, $\sigma=0.1$ and $S=1$ and plotting with $w$ from $0$ to $1$, however, provides clear indication the equation crosses through $0$.

So, what are my options for advancing. At the very least, I would like numerical approximations

enter image description here

Assuming[
 Subscript[P, T] >= 0 && Subscript[P, T] <= 1 && Subscript[w, 1] <= 1 && Subscript[w, 1] >= 0 && σ > 0,
 Solve[1/(6 σ^2 (-1 + Subscript[w, 1]) Subscript[w, 1])S ((Log[Sqrt[3] σ + Subscript[P, T]] - Log[Subscript[P, T] + Sqrt[3] σ (1 - 2 Subscript[w, 1])]) Subscript[P,T] (Sqrt[3] σ + Subscript[P, T]) - (6 σ^2 +Sqrt[3] σ (Log[-Sqrt[3] σ + Subscript[P, T]] +Log[Sqrt[3] σ + Subscript[P, T]] - 2 Log[Subscript[P, T] + Sqrt[3] σ (1 - 2 Subscript[w, 1])]) Subscript[P, T] + (-Log[-Sqrt[3] σ + Subscript[P, T]] + Log[Sqrt[3] σ + Subscript[P, T]])\!\(\*SubsuperscriptBox[\(P\), \(T\), \(2\)]\)) Subscript[w, 1] + 6 σ^2 \!\(\*SubsuperscriptBox[\(w\), \(1\), \(2\)]\)) == 0, Subscript[w,1]
  ]
]
$\endgroup$
  • $\begingroup$ See NSolve or FindRoot. $\endgroup$ – Henrik Schumacher Jun 23 '18 at 10:18
  • 6
    $\begingroup$ You should avoid using Subscript while defining symbols (variables). Subscript[x, 1] is not a symbol, but a composite expression where Subscript is an operator without built-in meaning. You expect to do $x_1=2$ but you are actually doing Set[Subscript[x, 1], 2] which is to assign a DownValues to the operator Subscript and not an OwnValues to an indexed x as you may intend. Read how to properly define indexed variables here $\endgroup$ – rhermans Jun 23 '18 at 10:29
  • $\begingroup$ There are things to do after your question is answered. It's a good idea to stay vigilant for some time, better approaches may come later improving over previous replies. Experienced users may point alternatives, caveats or limitations. New users should test answers before voting and wait 24 hours before accepting the best one. Participation is essential for the site, please do your part. $\endgroup$ – rhermans Jun 30 '18 at 11:19
6
$\begingroup$
With[
 {Pt = 0.5, σ = 0.1 , S = 1},
 FindRoot[
  1/(6 σ^2 (-1 + w) w)
     S ((Log[Sqrt[3] σ + Pt] - 
         Log[Pt + Sqrt[3] σ (1 - 2 w)]) Pt (Sqrt[3] σ + 
         Pt) - (6 σ^2 + 
         Sqrt[3] σ (Log[-Sqrt[3] σ + Pt] + 
            Log[Sqrt[3] σ + Pt] - 
            2 Log[Pt + 
               Sqrt[3] σ (1 - 2 w)]) Pt + (-Log[-Sqrt[
                 3] σ + Pt] + 
            Log[Sqrt[3] σ + Pt]) Pt^2) w + 6 σ^2 w^2) == 0
   , {w, 0.5}
  ]
 ]
(* {w -> 0.409537} *)
$\endgroup$
  • 3
    $\begingroup$ If given a range spec such as 0<=w<=10 then NSolve can find solutions although one is spurious. Giving exact values for the parameters fixes that issue though. $\endgroup$ – Daniel Lichtblau Jun 23 '18 at 13:18
4
$\begingroup$

Using exact numbers Solve will provide an exact solution expressed as a Root object.

sol = With[{Pt = 1/2, σ = 1/10, S = 1}, 
    Solve[{1/(6 σ^2 (-1 + w) w) S ((Log[Sqrt[3] σ + Pt] - 
             Log[Pt + Sqrt[3] σ (1 - 2 w)]) Pt (Sqrt[3] σ + 
             Pt) - (6 σ^2 + 
             Sqrt[3] σ (Log[-Sqrt[3] σ + Pt] + 
                Log[Sqrt[3] σ + Pt] - 
                2 Log[Pt + 
                   Sqrt[3] σ (1 - 2 w)]) Pt + (-Log[-Sqrt[3] σ +
                    Pt] + Log[Sqrt[3] σ + Pt]) Pt^2) w + 
          6 σ^2 w^2) == 0, 0 <= w <= 1}, w]][[1]] // FullSimplify

(* {w -> Root[{5 (5 + Sqrt[3]) Log[
        5 + Sqrt[3]] (-1 + #1) + (6 + 5 (-5 + Sqrt[3]) Log[5 - Sqrt[3]] - 
         6 #1) #1 + 
      5 Log[5 + Sqrt[3] - 2 Sqrt[3] #1] (5 + Sqrt[3] - 2 Sqrt[3] #1) &, 
    0.40953666596770227094}]} *)

The last argument to Root is the approximate numeric value

sol // N[#, 20] &

(* {w -> 0.40953666596770227094} *)

EDIT: Note that Solve does not use Assumptions

Options[Solve]

{Cubics -> True, GeneratedParameters -> C, InverseFunctions -> Automatic, 
 MaxExtraConditions -> 0, Method -> Automatic, Modulus -> 0, Quartics -> True,
  VerifySolutions -> Automatic, WorkingPrecision -> ∞}

Consequently, conditions from Assuming (e.g., 0 <= w <= 1) are not used by Solve and must be entered as part of the "system expr of equations or inequalities".

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