[关闭]
@Arbalest-Laevatain 2018-07-04T03:20:55.000000Z 字数 2497 阅读 598

平差期末作业

测绘专用 MATLAB


7-6-51

  1. Xa = 4728.008;Ya = 227.880;
  2. Xb = 4604.993;Yb = 362.996;
  3. Xc = 4750.191;Yc = 503.152;
  4. Xp = 4881.27;Yp = 346.86;
  5. %输入数据
  6. %将角度(度、分、秒)转换为弧度
  7. L1 = [94 29 32];L2 = [44 20 36.3];
  8. L3 = [47 19 43.3];L4 = [85 59 51.6];
  9. L10 = dms2degrees(L1);
  10. L20 = dms2degrees(L2);
  11. L30 = dms2degrees(L3);
  12. L40= dms2degrees(L4);
  13. L10=deg2rad(L10);
  14. L20=deg2rad(L20);
  15. L30=deg2rad(L30);
  16. L40=deg2rad(L40);
  17. p=206265;
  18. %计算边长
  19. S1=sqrt((Xa-Xp)^2+(Ya-Yp)^2);
  20. S2=sqrt((Xb-Xp)^2+(Yb-Yp)^2);
  21. S3=sqrt((Xc-Xp)^2+(Yc-Yp)^2);
  22. %计算角度观测近似值
  23. L10 = rad2deg(atan2(Yb-Ya,Xb-Xa)) - rad2deg(atan2(Yp-Ya,Xp-Xa)) ;
  24. L10 = degrees2dms(L10);
  25. L20 = (360 - rad2deg(atan2(Ya-Yb,Xa-Xb))) + rad2deg(atan2(Yp-Yb,Xp-Xb)) ;
  26. L20 = L20-360;
  27. L20 = degrees2dms(L20);
  28. L30 = rad2deg(atan2(Yc-Yb,Xc-Xb)) - rad2deg(atan2(Yp-Yb,Xp-Xb)) ;
  29. L30 = degrees2dms(L30);
  30. L40 = rad2deg(atan2(Yp-Yc,Xp-Xc)) - rad2deg(atan2(Yb-Yc,Xb-Xc)) ;
  31. L40 = degrees2dms(L40);
  32. %计算误差方程系数B
  33. B = [
  34. -206265*(Ya-Yp)/(S1^2*100) 206265*(Xa-Xp)/(S1^2*100);
  35. -206265*(Yb-Yp)/(S2^2*100) 206265*(Xb-Xp)/(S2^2*100);
  36. -206265*(Yb-Yp)/(S2^2*100) 206265*(Xb-Xp)/(S2^2*100);
  37. -206265*(Yc-Yp)/(S3^2*100) 206265*(Xc-Xp)/(S3^2*100)
  38. ];
  39. %计算误差方程系数l
  40. l1 = L1-L10;
  41. l2 = L2-L20;
  42. l3 = L3-L30;
  43. l4 = L4-L40;
  44. l=[
  45. l1(3);
  46. l2(3);
  47. l3(3);
  48. l4(3)
  49. ];
  50. P = [
  51. 1 0 0 0;
  52. 0 1 0 0;
  53. 0 0 1 0;
  54. 0 0 0 1
  55. ];
  56. %计算NbbW
  57. Nbb = (B')*P*B;
  58. W = (B')*P*l;
  59. %解法方程
  60. x=(Nbb^-1)*W;
  61. Xp0 = Xp+x(1)/10;
  62. Yp0 = Yp+x(2)/10;
  63. sprintf('%.3f',Xp0)
  64. sprintf('%.3f',Yp0)
  65. %计算协因数
  66. Q = vpa(Nbb^-1,4);

7-7-58

  1. Xa = 586.843; Ya = 488.027;
  2. Xb = 776.407;Yb = 568.693;
  3. Xc = 795.565; Yc = 191.581;
  4. Xp1 = 880.267; Yp1 = 367.025;
  5. Xp2 = 585.832; Yp2 = 238.972;
  6. S1 = 249.115;
  7. S2 = 380.913;
  8. S3 = 317.406;
  9. S4 = 226.930;
  10. S5 = 321.154;
  11. S6 = 215.109;
  12. S7 = 194.845;
  13. %输入数据
  14. %计算边长近似值
  15. S10 = sqrt((Xp2-Xa)^2+(Yp2-Ya)^2);
  16. S20 = sqrt((Xp2-Xb)^2+(Yp2-Yb)^2);
  17. S30 = sqrt((Xp1-Xa)^2+(Yp1-Ya)^2);
  18. S40 = sqrt((Xp1-Xb)^2+(Yp1-Yb)^2);
  19. S50 = sqrt((Xp2-Xp1)^2+(Yp2-Yp1)^2);
  20. S60 = sqrt((Xp2-Xc)^2+(Yp2-Yc)^2);
  21. S70 = sqrt((Xp1-Xc)^2+(Yp1-Yc)^2);
  22. %计算B矩阵
  23. B = [0 0 -(Xa-Xp2)/S10 -(Ya-Yp2)/S10;
  24. 0 0 -(Xb-Xp2)/S10 -(Yb-Yp2)/S20;
  25. -(Xa-Xp1)/S30 -(Ya-Yp1)/S30 0 0;
  26. -(Xb-Xp1)/S40 -(Yb-Yp1)/S40 0 0;
  27. (Xp1-Xp2)/S50 (Yp1-Yp2)/S50 -(Xp1-Xp2)/S50 -(Yp1-Yp2)/S50;
  28. 0 0 (Xp2-Xc)/S60 (Yp2-Yc)/S60;
  29. (Xp1-Xc)/S70 (Yp1-Yc)/S70 0 0];
  30. %计算常数项
  31. l = [S1-S10;
  32. S2-S20;
  33. S3-S30;
  34. S4-S40;
  35. S5-S50;
  36. S6-S60;
  37. S7-S70];
  38. %计算权阵
  39. P = [100/S1 0 0 0 0 0 0;
  40. 0 100/S2 0 0 0 0 0;
  41. 0 0 100/S3 0 0 0 0;
  42. 0 0 0 100/S4 0 0 0;
  43. 0 0 0 0 100/S5 0 0;
  44. 0 0 0 0 0 100/S6 0;
  45. 0 0 0 0 0 0 100/S7];
  46. %计算法方程系数NbbW
  47. Nbb = (B')*P*B;
  48. W = (B')*P*l;
  49. %解法方程
  50. x = (Nbb^-1)*W;
  51. %求观测值改正数
  52. V = B*x-l;
  53. %求观测值平差值
  54. v = [
  55. S1+V(1);
  56. S2+V(2);
  57. S3+V(3);
  58. S4+V(4);
  59. S5+V(5);
  60. S6+V(6);
  61. S7+V(7);
  62. ];
  63. %求坐标平差值
  64. Xp10 = Xp1+x(1);
  65. Yp10 = Yp1+x(2);
  66. Xp20 = Xp2+x(3);
  67. Yp20 = Yp2+x(4);
  68. %单位权中误差
  69. e0 = sqrt((V')*P*V/(7-4));
  70. P0 = Nbb^-1;
  71. exp1 = e0*sqrt(P0(1,1));
  72. eyp1 = e0*sqrt(P0(2,2));
  73. ep1 = sqrt(exp1^2+eyp1^2);
  74. exp2 = e0*sqrt(P0(3,3));
  75. eyp2 = e0*sqrt(P0(4,4));
  76. ep2 = sqrt(exp2^2+eyp2^2);
  77. PP = [exp1 eyp1 ep1;
  78. exp2 eyp2 ep2];

7-8-61

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注