Message Boards Message Boards

Solve a system of equations in polar coordinate?

GROUPS:

My system contains 6 equations and 6 unknowns in polar coordinate and I wrote them in Cartesian coordinates and now 3 of the unknowns are the radii and 3 of them are angels. But I am not sure if I write the angles in the correct format. This code runs but solutions are not correct since by changing the initial values the answers stay the same. Here is my code:

ClearAll;
s1 = 0.067;
theta1 = -152 Degree;
s2 = 0.015;
theta2 = -130 Degree;
s3 = 0.0078;
theta3 = -165 Degree;
exp1 = ExpandAll[
   s1*Cos[theta1 Degree] - 
     s1*s*Cos[theta1 Degree + thetas Degree + 180 Degree] - 
     d*Cos[thetad Degree] + 
     d*s*Cos[thetad Degree + thetas Degree + 180 Degree] == 
    1 - r*Cos[thetar Degree + 180 Degree]];
exp2 = ExpandAll[
   s2*Cos[theta2 Degree] - (0.3)*s2*s*
      Cos[theta2 Degree + thetas Degree + 180 Degree] - 
     d*Cos[thetad Degree] + (0.3)*d*s*
      Cos[thetad Degree + thetas Degree + 
        180 Degree] == (0.3) - (0.3)*r*
      Cos[thetar Degree + 180 Degree]];
exp3 = ExpandAll[
   s3*Cos[theta3 Degree] - (0.0001)*s3*s*
      Cos[theta3 Degree + thetas Degree] - 
     d*Cos[thetad Degree] + (0.0001)*d*s*
      Cos[thetad Degree + thetas Degree] == (0.0001) - (0.0001)*r*
      Cos[thetar Degree]];
exp4 = ExpandAll[
   s1*Sin[theta1 Degree] - 
     s1*s*Sin[theta1 Degree + thetas Degree + 180 Degree] - 
     d*Sin[thetad Degree] + 
     d*s*Sin[thetad Degree + thetas Degree + 180 Degree] == 
    1 - r*Sin[thetar Degree + 180 Degree]];
exp5 = ExpandAll[
   s2*Sin[theta2 Degree] - (0.3)*s2*s*
      Sin[theta2 Degree + thetas Degree + 180 Degree] - 
     d*Sin[thetad Degree] + (0.3)*d*s*
      Sin[thetad Degree + thetas Degree + 
        180 Degree] == (0.3) - (0.3)*r*
      Sin[thetar Degree + 180 Degree]];
exp6 = ExpandAll[
   s3*Sin[theta3 Degree] - (0.0001)*s3*s*
      Sin[theta3 Degree + thetas Degree] - 
     d*Sin[thetad Degree] + (0.0001)*d*s*
      Sin[thetad Degree + thetas Degree] == (0.0001) - (0.0001)*r*
      Sin[thetar Degree]];
v = Total[{exp1, exp2, exp3, exp4, exp5, exp6} /. 
    Equal[l_, r_] -> Norm[1 - (r)]];
NMinimize[v, {s, thetas, r, thetar, d, thetad}, MaxIterations -> 10^3]
POSTED BY: elaheh motaharifar
Answer
10 days ago

Group Abstract Group Abstract