数学研发论坛

 找回密码
 欢迎注册
查看: 76|回复: 8

[讨论] Mathematica7.0问题在哪里

[复制链接]
发表于 2021-11-22 19:53:45 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?欢迎注册

x

第二次运行出错

第二次运行出错

为什么第二次出现提示?很长时间运行不出结果?第一次很快出来?

第一次正确

第一次正确


  1. \!\(\*OverscriptBox["i", "_"]\) = i = 0;
  2. \!\(\*OverscriptBox["m", "_"]\) = 1/m;
  3. a = (2 p m)/(m + p);
  4. \!\(\*OverscriptBox["a", "_"]\) = 2/(m + p); b = (2 p n)/(n + p);
  5. \!\(\*OverscriptBox["b", "_"]\) = 2/(n + p); c = (2 n m)/(n + m);
  6. \!\(\*OverscriptBox["c", "_"]\) = 2/(m + n);
  7. d = (a + c)/2;
  8. \!\(\*OverscriptBox["d", "_"]\) = (
  9. \!\(\*OverscriptBox["a", "_"]\) +
  10. \!\(\*OverscriptBox["c", "_"]\))/2; f = (a - \[Lambda] d)/(
  11. 1 - \[Lambda]);
  12. \!\(\*OverscriptBox["f", "_"]\) = (
  13. \!\(\*OverscriptBox["a", "_"]\) - \[Lambda]
  14. \!\(\*OverscriptBox["d", "_"]\))/(1 - \[Lambda]);(*假设
  15. \!\(\*OverscriptBox["FA", "\[RightVector]"]\):F
  16. \!\(\*OverscriptBox["D", "\[RightVector]"]\)=\[Lambda]*)

  17. k[a_, b_] := (a - b)/(
  18. \!\(\*OverscriptBox["a", "_"]\) -
  19. \!\(\*OverscriptBox["b", "_"]\));
  20. \!\(\*OverscriptBox["k", "_"]\)[a_, b_] := 1/k[a, b];(*复斜率定义*)

  21. \!\(\*OverscriptBox["Jd", "_"]\)[k1_, a1_, k2_, a2_] := -((a1 - k1
  22. \!\(\*OverscriptBox["a1", "_"]\) - (a2 - k2
  23. \!\(\*OverscriptBox["a2", "_"]\)))/(k1 - k2));
  24. (*复斜率等于k1,过点A1与复斜率等于k2,过点A2的直线交点*)
  25. Jd[k1_, a1_, k2_, a2_] := -((k2 (a1 - k1
  26. \!\(\*OverscriptBox["a1", "_"]\)) - k1 (a2 - k2
  27. \!\(\*OverscriptBox["a2", "_"]\)))/(k1 - k2));
  28. FourPoint[a_, b_, c_, d_] := ((
  29. \!\(\*OverscriptBox["c", "_"]\) d - c
  30. \!\(\*OverscriptBox["d", "_"]\)) (a - b) - (
  31. \!\(\*OverscriptBox["a", "_"]\) b - a
  32. \!\(\*OverscriptBox["b", "_"]\)) (c - d))/((a - b) (
  33. \!\(\*OverscriptBox["c", "_"]\) -
  34. \!\(\*OverscriptBox["d", "_"]\)) - (
  35. \!\(\*OverscriptBox["a", "_"]\) -
  36. \!\(\*OverscriptBox["b", "_"]\)) (c - d));
  37. (*过两点A和B、C和D的交点*)

  38. \!\(\*OverscriptBox["FourPoint", "_"]\)[a_, b_, c_, d_] := -(((c
  39. \!\(\*OverscriptBox["d", "_"]\) -
  40. \!\(\*OverscriptBox["c", "_"]\) d) (
  41. \!\(\*OverscriptBox["a", "_"]\) -
  42. \!\(\*OverscriptBox["b", "_"]\)) - ( a
  43. \!\(\*OverscriptBox["b", "_"]\) -
  44. \!\(\*OverscriptBox["a", "_"]\) b) (
  45. \!\(\*OverscriptBox["c", "_"]\) -
  46. \!\(\*OverscriptBox["d", "_"]\)))/((a - b) (
  47. \!\(\*OverscriptBox["c", "_"]\) -
  48. \!\(\*OverscriptBox["d", "_"]\)) - (
  49. \!\(\*OverscriptBox["a", "_"]\) -
  50. \!\(\*OverscriptBox["b", "_"]\)) (c - d)));
  51. XiangjiaoxuanLianxin[o1_, a_, o2_, b_] := 1/(2 (
  52. \!\(\*OverscriptBox["o2", "_"]\) -
  53. \!\(\*OverscriptBox["o1", "_"]\))) (a
  54. \!\(\*OverscriptBox["a", "_"]\) - b
  55. \!\(\*OverscriptBox["b", "_"]\) +
  56. \!\(\*OverscriptBox["b", "_"]\) o2 + b
  57. \!\(\*OverscriptBox["o2", "_"]\) -
  58. \!\(\*OverscriptBox["a", "_"]\) o1 - a
  59. \!\(\*OverscriptBox["o1", "_"]\) +
  60. \!\(\*OverscriptBox["o2", "_"]\) o1 - o2
  61. \!\(\*OverscriptBox["o1", "_"]\));(*圆 (O1,A)与圆 (O2,B)连心线与公共弦的交点*)

  62. \!\(\*OverscriptBox["XiangjiaoxuanLianxin", "_"]\)[o1_, a_, o2_, b_] :=
  63.    1/(2 (o2 - o1)) (a
  64. \!\(\*OverscriptBox["a", "_"]\) - b
  65. \!\(\*OverscriptBox["b", "_"]\) +
  66. \!\(\*OverscriptBox["b", "_"]\) o2 + b
  67. \!\(\*OverscriptBox["o2", "_"]\) -
  68. \!\(\*OverscriptBox["a", "_"]\) o1 - a
  69. \!\(\*OverscriptBox["o1", "_"]\) + o2
  70. \!\(\*OverscriptBox["o1", "_"]\) -
  71. \!\(\*OverscriptBox["o2", "_"]\) o1);
  72. Chuizu[a_, b_, p_] := (
  73. \!\(\*OverscriptBox["a", "_"]\) b - a
  74. \!\(\*OverscriptBox["b", "_"]\) + p (
  75. \!\(\*OverscriptBox["a", "_"]\) -
  76. \!\(\*OverscriptBox["b", "_"]\)) +
  77. \!\(\*OverscriptBox["p", "_"]\) (a - b))/(2 (
  78. \!\(\*OverscriptBox["a", "_"]\) -
  79. \!\(\*OverscriptBox["b", "_"]\)));(*=(1/2)[p+(
  80. \!\(\*OverscriptBox["a", "_"]\)b-a
  81. \!\(\*OverscriptBox["b", "_"]\)+
  82. \!\(\*OverscriptBox["p", "_"]\)(a-b))/(
  83. \!\(\*OverscriptBox["a", "_"]\)-
  84. \!\(\*OverscriptBox["b", "_"]\))]P到直线AB的垂足*)

  85. \!\(\*OverscriptBox["Chuizu", "_"]\)[a_, b_, p_] := (a
  86. \!\(\*OverscriptBox["b", "_"]\) -
  87. \!\(\*OverscriptBox["a", "_"]\) b +
  88. \!\(\*OverscriptBox["p", "_"]\) (a - b) + p (
  89. \!\(\*OverscriptBox["a", "_"]\) -
  90. \!\(\*OverscriptBox["b", "_"]\)))/(2 (a - b));
  91. (*Duichendian[a_,b_,p_]:=(
  92. \!\(\*OverscriptBox["a", "_"]\)b-a
  93. \!\(\*OverscriptBox["b", "_"]\)+
  94. \!\(\*OverscriptBox["p", "_"]\)(a-b))/(
  95. \!\(\*OverscriptBox["a", "_"]\)-
  96. \!\(\*OverscriptBox["b", "_"]\));P关于直线AB的对称点

  97. \!\(\*OverscriptBox["Duichendian", "_"]\)[a_,b_,p_]:=(
  98. \!\(\*OverscriptBox["b", "_"]\)-
  99. \!\(\*OverscriptBox["a", "_"]\)b+
  100. \!\(\*OverscriptBox["p", "_"]\)(a-b))/(a-b);*)
  101. Wx[a_, b_, c_] := (a (-b + c)
  102. \!\(\*OverscriptBox["a", "_"]\) + b (a - c)
  103. \!\(\*OverscriptBox["b", "_"]\) + (-a + b) c
  104. \!\(\*OverscriptBox["c", "_"]\))/((-b + c)
  105. \!\(\*OverscriptBox["a", "_"]\) + (a - c)
  106. \!\(\*OverscriptBox["b", "_"]\) + (-a + b)
  107. \!\(\*OverscriptBox["c", "_"]\));
  108. \!\(\*OverscriptBox["Wx", "_"]\)[a_, b_, c_] := ((b - c)
  109. \!\(\*OverscriptBox["b", "_"]\)
  110. \!\(\*OverscriptBox["c", "_"]\) +
  111. \!\(\*OverscriptBox["a", "_"]\) ((a - b)
  112. \!\(\*OverscriptBox["b", "_"]\) + (-a + c)
  113. \!\(\*OverscriptBox["c", "_"]\)))/((-b + c)
  114. \!\(\*OverscriptBox["a", "_"]\) + (a - c)
  115. \!\(\*OverscriptBox["b", "_"]\) + (-a + b)
  116. \!\(\*OverscriptBox["c", "_"]\));

  117. e = Chuizu[i, b, a];
  118. \!\(\*OverscriptBox["e", "_"]\) =
  119. \!\(\*OverscriptBox["Chuizu", "_"]\)[i, b, a];
  120. j = Jd[k[e, f], e, -p n, d];
  121. \!\(\*OverscriptBox["j", "_"]\) =
  122. \!\(\*OverscriptBox["Jd", "_"]\)[k[e, f], e, -p n, d];
  123. o = Wx[d, e, f];
  124. \!\(\*OverscriptBox[
  125. StyleBox["o",
  126. FontSize->14], "_"]\) =
  127. \!\(\*OverscriptBox["Wx", "_"]\)[d, e, f]; k = p  n (
  128. \!\(\*OverscriptBox["d", "_"]\) -
  129. \!\(\*OverscriptBox["o", "_"]\)) + o;
  130. \!\(\*OverscriptBox["k", "_"]\) = (d - o)/(p n) +
  131. \!\(\*OverscriptBox["o", "_"]\); q = Wx[j, k, f];
  132. \!\(\*OverscriptBox[
  133. StyleBox["q",
  134. FontSize->24], "_"]\) =
  135. \!\(\*OverscriptBox["Wx", "_"]\)[j, k, f];(*(d-o)/p n*)
  136. t = XiangjiaoxuanLianxin[q, f, i, m];
  137. \!\(\*OverscriptBox["t", "_"]\) =
  138. \!\(\*OverscriptBox["XiangjiaoxuanLianxin", "_"]\)[q, f, i, m];
  139. Simplify[{d,
  140. \!\(\*OverscriptBox["d", "_"]\), e,
  141. \!\(\*OverscriptBox["e", "_"]\), f,
  142. \!\(\*OverscriptBox["f", "_"]\), 1, j,
  143. \!\(\*OverscriptBox["j", "_"]\), o,
  144. \!\(\*OverscriptBox["o", "_"]\), k,
  145. \!\(\*OverscriptBox["k", "_"]\), 2, q,
  146. \!\(\*OverscriptBox["q", "_"]\), 3, t,
  147. \!\(\*OverscriptBox["t", "_"]\), , t  
  148. \!\(\*OverscriptBox["t", "_"]\)}]
  149. Factor[{d,
  150. \!\(\*OverscriptBox["d", "_"]\), e,
  151. \!\(\*OverscriptBox["e", "_"]\), f,
  152. \!\(\*OverscriptBox["f", "_"]\), 1, j,
  153. \!\(\*OverscriptBox["j", "_"]\), o,
  154. \!\(\*OverscriptBox["o", "_"]\), k,
  155. \!\(\*OverscriptBox["k", "_"]\), 2, q,
  156. \!\(\*OverscriptBox["q", "_"]\), 3, t,
  157. \!\(\*OverscriptBox["t", "_"]\), , t  
  158. \!\(\*OverscriptBox["t", "_"]\)}]



复制代码

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2021-11-24 12:35:14 | 显示全部楼层
有高版本了,还在搞这低版本有意义?

点评

注册机的问题那是你的水平问题,12.0我都破解了。  发表于 2021-11-24 23:06
10.3注册机不行  发表于 2021-11-24 19:46
我试了高版本的,问题也一样。  发表于 2021-11-24 18:26
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2021-11-24 19:03:27 | 显示全部楼层
问题出在程序最前面缺少了一条清除所有变量的指令。加上这条指令就没有这个毛病了。

点评

谢谢老朋友  发表于 5 天前
以前没有遇到过是因为,不是每个程序都必须在前面有这条指令。但是程序开头就写上这个指令是个好习惯。  发表于 2021-11-25 08:11
谢谢,确实如此,但是以前没遇过  发表于 2021-11-24 20:07
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2021-12-7 19:10 , Processed in 0.054571 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表