Skip to main content
deleted 74 characters in body
Source Link

This is more an exercise in learning Mathematica than a real issue because the solution for me is just to solve half of the system.

I have a simple system of trig equations and can't solve the angle, presumably because it can't find a solution with the numerical precision available.

m = Quantity[6, "Kilograms"];
\[Theta]θ = 38 Degree;
v1 = Quantity[13, ("Meters")/("Seconds")] {-1, 0};
v2 = Quantity[25, ("Meters")/("Seconds")] {Cos[\[Theta]]Cos[θ], 
    Sin[\[Theta]]Sin[θ]};
t = Quantity[3, "Seconds"];
L1 = m v1;
L2 = m v2;
\[CapitalDelta]LΔL = L2 - L1;
F = Norm[\[CapitalDelta]L]Norm[ΔL]/t // UnitSimplify // N
i = t F {Cos[\[Phi]]Cos[ϕ], Sin[\[Phi]]Sin[ϕ]};
L1 + i == L2 // UnitSimplify // Reduce // NSolve[#, \[Phi]]ϕ] & (* no solution *)

This definitely could find a solution if I knew how to let it relax

L1 + i == L2 // Reduce
    Cos[\[Phi]]Cos[ϕ] == 0.904785 && Sin[\[Phi]]Sin[ϕ] == 0.425869

ArcCos[0.9047848529545457`] // Sin
    0.425869

I tried fiddling with the WorkingPrecision in NSolve to no avail. I also tried adding an inequality to constrain the angle and constrained it to Reals.

If it's not possible to get an answer straight out like this, how do I separate the output from Reduce and run NSolve on only one of the equations (as I've done manually here)? I know how to do this when Solve gives a list of solutions, but not with the boolean equation from Reduce.

Cheers

This is more an exercise in learning Mathematica than a real issue because the solution for me is just to solve half of the system.

I have a simple system of trig equations and can't solve the angle, presumably because it can't find a solution with the numerical precision available.

m = Quantity[6, "Kilograms"];
\[Theta] = 38 Degree;
v1 = Quantity[13, ("Meters")/("Seconds")] {-1, 0};
v2 = Quantity[25, ("Meters")/("Seconds")] {Cos[\[Theta]], 
    Sin[\[Theta]]};
t = Quantity[3, "Seconds"];
L1 = m v1;
L2 = m v2;
\[CapitalDelta]L = L2 - L1;
F = Norm[\[CapitalDelta]L]/t // UnitSimplify // N
i = t F {Cos[\[Phi]], Sin[\[Phi]]};
L1 + i == L2 // UnitSimplify // Reduce // NSolve[#, \[Phi]] & (* no solution *)

This definitely could find a solution if I knew how to let it relax

L1 + i == L2 // Reduce
    Cos[\[Phi]] == 0.904785 && Sin[\[Phi]] == 0.425869

ArcCos[0.9047848529545457`] // Sin
    0.425869

I tried fiddling with the WorkingPrecision in NSolve to no avail. I also tried adding an inequality to constrain the angle and constrained it to Reals.

If it's not possible to get an answer straight out like this, how do I separate the output from Reduce and run NSolve on only one of the equations (as I've done manually here)? I know how to do this when Solve gives a list of solutions, but not with the boolean equation from Reduce.

Cheers

This is more an exercise in learning Mathematica than a real issue because the solution for me is just to solve half of the system.

I have a simple system of trig equations and can't solve the angle, presumably because it can't find a solution with the numerical precision available.

m = Quantity[6, "Kilograms"];
θ = 38 Degree;
v1 = Quantity[13, ("Meters")/("Seconds")] {-1, 0};
v2 = Quantity[25, ("Meters")/("Seconds")] {Cos[θ], 
    Sin[θ]};
t = Quantity[3, "Seconds"];
L1 = m v1;
L2 = m v2;
ΔL = L2 - L1;
F = Norm[ΔL]/t // UnitSimplify // N
i = t F {Cos[ϕ], Sin[ϕ]};
L1 + i == L2 // UnitSimplify // Reduce // NSolve[#, ϕ] & (* no solution *)

This definitely could find a solution if I knew how to let it relax

L1 + i == L2 // Reduce
    Cos[ϕ] == 0.904785 && Sin[ϕ] == 0.425869

ArcCos[0.9047848529545457`] // Sin
    0.425869

I tried fiddling with the WorkingPrecision in NSolve to no avail. I also tried adding an inequality to constrain the angle and constrained it to Reals.

If it's not possible to get an answer straight out like this, how do I separate the output from Reduce and run NSolve on only one of the equations (as I've done manually here)? I know how to do this when Solve gives a list of solutions, but not with the boolean equation from Reduce.

Cheers

Source Link

Loosen tolerances to get a solution from NSolve for trig system

This is more an exercise in learning Mathematica than a real issue because the solution for me is just to solve half of the system.

I have a simple system of trig equations and can't solve the angle, presumably because it can't find a solution with the numerical precision available.

m = Quantity[6, "Kilograms"];
\[Theta] = 38 Degree;
v1 = Quantity[13, ("Meters")/("Seconds")] {-1, 0};
v2 = Quantity[25, ("Meters")/("Seconds")] {Cos[\[Theta]], 
    Sin[\[Theta]]};
t = Quantity[3, "Seconds"];
L1 = m v1;
L2 = m v2;
\[CapitalDelta]L = L2 - L1;
F = Norm[\[CapitalDelta]L]/t // UnitSimplify // N
i = t F {Cos[\[Phi]], Sin[\[Phi]]};
L1 + i == L2 // UnitSimplify // Reduce // NSolve[#, \[Phi]] & (* no solution *)

This definitely could find a solution if I knew how to let it relax

L1 + i == L2 // Reduce
    Cos[\[Phi]] == 0.904785 && Sin[\[Phi]] == 0.425869

ArcCos[0.9047848529545457`] // Sin
    0.425869

I tried fiddling with the WorkingPrecision in NSolve to no avail. I also tried adding an inequality to constrain the angle and constrained it to Reals.

If it's not possible to get an answer straight out like this, how do I separate the output from Reduce and run NSolve on only one of the equations (as I've done manually here)? I know how to do this when Solve gives a list of solutions, but not with the boolean equation from Reduce.

Cheers