# What can I do to get Mathematica to solve this equation?

I am trying to solve an equation on Mathematica 12.1 to get angles in radians as part of some analysis:

forceToStrain[in_] := in/(51.76*10^9);
strainFromTheta[in_] := ((in/(2*Sin[in/2])) - 1) // N
(*thickness = 0.28 * 16 ply = 4.48 mm = 4.48*10^(-2 m)*)

Solve[((x/(2*Sin[x/2])) - 1) == forceToStrain, x]


But I am getting this error:

Reduce::inex: Reduce was unable to solve the system with inexact coefficients or the system obtained by direct rationalization of inexact numbers present in the system. Since many of the methods used by Reduce require exact input, providing Reduce with an exact version of the system may help.


It doesn't seem complicated as an equation as I can solve it by hand:

strainFromTheta[.00007]
forceToStrain
Output: 2.04167*10^-10 and 1.93199*10^-10


Can anyone tell me whether I could use a different function or rearrange the equation differently to get the angles?

• It is weird that Solve does not work. You can get solutions using FindRoot, but you will have to specify a "guess" as a starting point. FindRoot[((x/(2*Sin[x/2])) - 1) == forceToStrain, {x, .1}](*{x\[Rule]0.00006809393481894709}*) Aug 25 '20 at 12:23

The result of Plot[((x/(2*Sin[x/2])) - 1) == forceToStrain, {x, -2, 2}, WorkingPrecision -> 35]suggests possible roots are located near the origin. Making use of it, the following commands work well.

forceToStrain[in_] := in/(51.76*10^9);
strainFromTheta[in_] := ((in/(2*Sin[in/2])) - 1) // N

Solve[((x/(2*Sin[x/2])) - 1) == forceToStrain && x >= -0.1 &&
x <= 0.1, x, WorkingPrecision -> 40]
(*{{x -> -0.000068094}, {x -> 0.000068094}}*)
NSolve[((x/(2*Sin[x/2])) - 1) == forceToStrain && x >= -0.1 &&
x <= 0.1, x, WorkingPrecision -> 40, Method ->"DifferentialEvolution"]
(*{{x-> -0.00006809395681119561597156442...},{x -> 0.00006809395681119561597156442191...}}*)
FindRoot[((x/(2*Sin[x/2])) - 1) - forceToStrain == 0, {x, 10^-3},
WorkingPrecision -> 30]
(*{x -> 0.0000680939568079706253704515525266}*)

• That makes sense. Thanks. It seems using absolute timing gives Solve (4.18s), NSolve (3.95s), and FindRoot (0.00836s). Aug 25 '20 at 13:35
• @Zhao: Did you use ClearAll["Global*"] in order to obtain unbiased timings? Aug 25 '20 at 13:46
• No - fair point. Thanks. Doing that now returns Solve (3.9651s), NSolve (3.8633s), and FindRoot (0.0018s). I shall be using FindRoot in this case. Aug 25 '20 at 13:49
• @Zhao: It is not so simple. The FindRoot command returns only one root and fails with {x,0}. I don't think the execution time is of very importance here. Aug 25 '20 at 19:59