找回密码
 欢迎注册
查看: 11324|回复: 60

[求助] 用 mathematica 如何解这个复数方程

[复制链接]
发表于 2023-2-16 10:24:34 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 TSC999 于 2023-2-16 10:55 编辑

如何解下面这个含有复数的方程?未知数为 R 和 θ, R 为小于 1 的正实数,θ 为小于 90 度的正角度。

下面图片中的这个方程应该有唯一解 \(R=\frac{1}{4}(3+\sqrt{5}-\sqrt{6\sqrt{5}-2} )\),\(θ=36度\)。

图中的字符上面带横线者表示共轭复数。

如何解这个复数方程.png

按照图片中的解方程语句,由于没有限定 R 和 θ 的范围,也没有指出它们都是实数,所以程序给出的解答有许多个,其中只有一个是符合要求的。

我的问题是,如何把那个解方程的语句改一下,把对未知量的要求反映进去,使得解只有一个?

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-2-16 11:27:13 | 显示全部楼层
试试:

$Solve[{a==b,c==d,R<1,\theta<\pi/2},{R,\theta},PositiveReals]$

点评

试了下,不成功。还是给出了一大堆结果。  发表于 2023-2-16 13:48
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-2-16 13:41:00 | 显示全部楼层
\[Solve[\{ a ==  b, c  == d, 1  >  R  >  0, \frac{\pi }{2}  > \theta  >  0\}, \{R, \theta\} ]\]

点评

我整复杂了  发表于 2023-2-16 15:26
这样可以。  发表于 2023-2-16 14:29
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-2-16 14:26:34 | 显示全部楼层
本帖最后由 TSC999 于 2023-2-16 14:56 编辑

成功方案之一:

如何解这个复数方程成功方案之一.png

然后发现,把后面的 \(R\in\mathbb{R},θ\in\mathbb{R} \) 去掉也行(如 3# 楼那样),运行结果与上面的完全一样。

有趣的是,Solve 前面加上不同的化简指令,运行结果有不同。前面加上 Simplify 的能直接给出 R 的准确值,但 θ 具体是多少度还得算。

前面加上 FullSimplify 的能直接给出 θ 的准确值,但 R 具体是多少还得算。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-2-16 14:57:51 | 显示全部楼层
此问题源于解决下面这个小题:

求角度问题 1.png

点评

nyy
这图,感觉不是按照比例画的  发表于 2023-3-9 12:40
nyy
如果我算的结果是正确的话,那么你应该碰到的是野题!  发表于 2023-3-8 15:01
nyy
这题我居然没算出来,不知道如何算  发表于 2023-3-8 13:20
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-2-16 17:22:43 | 显示全部楼层
这个直接计算各个角度的关系就可以出来了

点评

nyy
具体思路如何?难道真的有简单思路?  发表于 2023-3-9 08:59
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-3-8 12:33:48 | 显示全部楼层
你这个b上面带一横的,表示共轭复数吗?怎么搞出来的?
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-3-8 12:35:48 | 显示全部楼层
TSC999 发表于 2023-2-16 14:57
此问题源于解决下面这个小题:

具体说说怎么搞的?我很好奇用复数解这个几何题
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-3-8 12:37:30 | 显示全部楼层
TSC999 发表于 2023-2-16 14:26
成功方案之一:

你搞代码,至少也要搞个文本代码粘贴上来,方便别人复制粘贴修改代码呀,这样别人才能方便给你解决问题,你只图自己爽,真敢拿别人都当雷锋呀
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-3-8 14:15:38 | 显示全部楼层
本帖最后由 nyy 于 2023-3-8 14:59 编辑

假设B点为原点,然后BD=1  BC=c,A点(xa,ya),E点(xe,ye)

结果太复杂了,以致于我都怀疑软件算错了

  1. Clear["Global`*"];
  2. k1=ya/xa
  3. k2=ye/xe
  4. k3=(ye-0)/(xe-c)
  5. k4=(ye-0)/(xe-1)
  6. k5=(ya-0)/(xa-1)
  7. k12=(k1-k2)/(1+k1*k2)//Simplify
  8. k31=(k3-k1)/(1+k3*k1)//Simplify
  9. k34=(k3-k4)/(1+k3*k4)//Simplify
  10. ans=Solve[{
  11.     (k2+k5//Simplify//Together//Numerator)==0,
  12.     xe^2+ye^2==1^2,
  13.     Det[{{xa,ya,1},{xe,ye,1},{c,0,1}}]==0,
  14.     (xa-1)^2+(ya-0)^2==c^2,
  15.     (k12-(k31+k34)/(1+k31*k34)//Simplify//Together//Numerator)==0
  16. },{xa,ya,xe,ye,c}]
  17. Grid[ans,Alignment->Left](*列表显示*)
  18. Grid[Chop@N[ans,10],Alignment->Left](*数值化*)
  19. aaa=Select[ans,((ya>0&&ye>0&&c>1)/.#)&](*过滤出符合要求的解*)
  20. bbb=N[{xa,ya,xe,ye,c}/.aaa,1000](*高精度数值解*)
  21. ccc=RootApproximant[bbb[[1]]](*由数值解得到精确解*)
  22. kk=ArcTan[(k5-k4)/(1+k5*k4)//Simplify]/.Thread[{xa,ya,xe,ye,c}->ccc](*求解角度*)
  23. N[kk*180/Pi,20](*角度数值化*)
复制代码


{xa, ya, xe, ye, c}的求解结果
\[\begin{array}{lllll}
\text{ya}\to 0 & \text{xe}\to -1.000000000 & \text{ye}\to 0 & c\to 1.000000000-1.000000000 \text{xa} & \text{} \\
\text{ya}\to 0 & \text{xe}\to -1.000000000 & \text{ye}\to 0 & c\to \text{xa}-1.000000000 & \text{} \\
\text{ya}\to 0 & \text{xe}\to 1.000000000 & \text{ye}\to 0 & c\to 1.000000000-1.000000000 \text{xa} & \text{} \\
\text{ya}\to 0 & \text{xe}\to 1.000000000 & \text{ye}\to 0 & c\to \text{xa}-1.000000000 & \text{} \\
\text{xa}\to -0.6437833574 & \text{ya}\to 1.2277748914 i & \text{xe}\to -1.503954438 & \text{ye}\to -1.1233338555 i & c\to -1.092974173 \\
\text{xa}\to -0.6437833574 & \text{ya}\to -1.2277748914 i & \text{xe}\to -1.503954438 & \text{ye}\to 1.1233338555 i & c\to -1.092974173 \\
\text{xa}\to -0.1245434774 & \text{ya}\to -1.307234098 & \text{xe}\to 0.6521466567 & \text{ye}\to -0.7580928295 & c\to 1.724372065 \\
\text{xa}\to -0.1245434774 & \text{ya}\to 1.307234098 & \text{xe}\to 0.6521466567 & \text{ye}\to 0.7580928295 & c\to 1.724372065 \\
\text{xa}\to 0.6249857009 & \text{ya}\to -0.3225603103 & \text{xe}\to 0.7581372089 & \text{ye}\to -0.6520950640 & c\to 0.4946522802 \\
\text{xa}\to 0.6249857009 & \text{ya}\to 0.3225603103 & \text{xe}\to 0.7581372089 & \text{ye}\to 0.6520950640 & c\to 0.4946522802 \\
\text{xa}\to -2.222079491 & \text{ya}\to \text{0$\grave{ }\grave{ }$9.99449050306908}-1.432268679 i & \text{xe}\to 1.116357394 & \text{ye}\to -0.4962396904 i & c\to 2.886243697 \\
\text{xa}\to -2.222079491 & \text{ya}\to \text{0$\grave{ }\grave{ }$9.99449050306908}+1.432268679 i & \text{xe}\to 1.116357394 & \text{ye}\to 0.4962396904 i & c\to 2.886243697 \\
\text{xa}\to 0.6827103125+0.3085443424 i & \text{ya}\to -0.1490064367-0.6318572726 i & \text{xe}\to -0.5113434107-0.5153368985 i & \text{ye}\to -1.0339508462+0.2548613682 i & c\to -0.0061469351+0.6095944102 i \\
\text{xa}\to 0.6827103125+0.3085443424 i & \text{ya}\to 0.1490064367+0.6318572726 i & \text{xe}\to -0.5113434107-0.5153368985 i & \text{ye}\to 1.0339508462-0.2548613682 i & c\to -0.0061469351+0.6095944102 i \\
\text{xa}\to 0.6827103125-0.3085443424 i & \text{ya}\to -0.1490064367+0.6318572726 i & \text{xe}\to -0.5113434107+0.5153368985 i & \text{ye}\to -1.0339508462-0.2548613682 i & c\to -0.0061469351-0.6095944102 i \\
\text{xa}\to 0.6827103125-0.3085443424 i & \text{ya}\to 0.1490064367-0.6318572726 i & \text{xe}\to -0.5113434107+0.5153368985 i & \text{ye}\to 1.0339508462+0.2548613682 i & c\to -0.0061469351-0.6095944102 i \\
\text{xa}\to 0.3750406053 & \text{ya}\to -0.3626035553 i & \text{xe}\to 1.227789852 & \text{ye}\to -0.7123678261 i & c\to -0.5090116960 \\
\text{xa}\to 0.3750406053 & \text{ya}\to 0.3626035553 i & \text{xe}\to 1.227789852 & \text{ye}\to 0.7123678261 i & c\to -0.5090116960 \\
\text{xa}\to 0.4354345754 & \text{ya}\to -0.5436242977 i & \text{xe}\to 3.706015184 & \text{ye}\to \text{0$\grave{ }\grave{ }$9.598023221251676}-3.568549921 i & c\to -0.1523375908 \\
\text{xa}\to 0.4354345754 & \text{ya}\to 0.5436242977 i & \text{xe}\to 3.706015184 & \text{ye}\to \text{0$\grave{ }\grave{ }$9.598023221251676}+3.568549921 i & c\to -0.1523375908 \\
\text{xa}\to 1.276460322+1.619165134 i & \text{ya}\to -2.582760707-0.642457623 i & \text{xe}\to -0.3875786820-0.5746386463 i & \text{ye}\to -1.1048211165+0.2015871039 i & c\to -2.159715006-0.975568172 i \\
\text{xa}\to 1.276460322+1.619165134 i & \text{ya}\to 2.582760707+0.642457623 i & \text{xe}\to -0.3875786820-0.5746386463 i & \text{ye}\to 1.1048211165-0.2015871039 i & c\to -2.159715006-0.975568172 i \\
\text{xa}\to 1.276460322-1.619165134 i & \text{ya}\to -2.582760707+0.642457623 i & \text{xe}\to -0.3875786820+0.5746386463 i & \text{ye}\to -1.1048211165-0.2015871039 i & c\to -2.159715006+0.975568172 i \\
\text{xa}\to 1.276460322-1.619165134 i & \text{ya}\to 2.582760707-0.642457623 i & \text{xe}\to -0.3875786820+0.5746386463 i & \text{ye}\to 1.1048211165+0.2015871039 i & c\to -2.159715006+0.975568172 i \\
\text{xa}\to 2.318302088-0.545260630 i & \text{ya}\to 0.9070832412+0.3423400646 i & \text{xe}\to 0.9206761645-0.1966227118 i & \text{ye}\to -0.5478901358-0.3304053721 i & c\to 1.490389650-0.273946677 i \\
\text{xa}\to 2.318302088-0.545260630 i & \text{ya}\to -0.9070832412-0.3423400646 i & \text{xe}\to 0.9206761645-0.1966227118 i & \text{ye}\to 0.5478901358+0.3304053721 i & c\to 1.490389650-0.273946677 i \\
\text{xa}\to 2.318302088+0.545260630 i & \text{ya}\to 0.9070832412-0.3423400646 i & \text{xe}\to 0.9206761645+0.1966227118 i & \text{ye}\to -0.5478901358+0.3304053721 i & c\to 1.490389650+0.273946677 i \\
\text{xa}\to 2.318302088+0.545260630 i & \text{ya}\to -0.9070832412+0.3423400646 i & \text{xe}\to 0.9206761645+0.1966227118 i & \text{ye}\to 0.5478901358-0.3304053721 i & c\to 1.490389650+0.273946677 i \\
\end{array}\]

过滤后的实数解是

\[
\left\{\text{Root}\left[16 \text{$\#$1}^6+16 \text{$\#$1}^5-44 \text{$\#$1}^4+8 \text{$\#$1}^3+18 \text{$\#$1}^2-6 \text{$\#$1}-1\&,3\right],\text{Root}\left[256 \text{$\#$1}^{12}+640 \text{$\#$1}^{10}-432 \text{$\#$1}^8-1808 \text{$\#$1}^6-964 \text{$\#$1}^4-120 \text{$\#$1}^2+25\&,4\right],\text{Root}\left[16 \text{$\#$1}^6-36 \text{$\#$1}^4+4 \text{$\#$1}^3+14 \text{$\#$1}^2+8 \text{$\#$1}-7\&,2\right],\text{Root}\left[256 \text{$\#$1}^{12}-384 \text{$\#$1}^{10}-176 \text{$\#$1}^8+672 \text{$\#$1}^6-324 \text{$\#$1}^4-20 \text{$\#$1}^2+25\&,4\right],\text{Root}\left[\text{$\#$1}^6-4 \text{$\#$1}^5+2 \text{$\#$1}^4+4 \text{$\#$1}^3-2 \text{$\#$1}^2+2 \text{$\#$1}-1\&,3\right]\right\}
\]

数值是
{{-0.12454347736752104668226943368410646576893697445578998763685296313\
1478470526901758087458918083874930723841735121129885045486180190450498\
6344425809060239411466683957153837105457021754760466965280579035808309\
6447001009637537140742839833107611333748807500611738845464971900399318\
3361363450461064384895031585260478061410025625931992519324677695580663\
7707985456637921076013831123856055293404690870500317296635961995713445\
5388094030750119432332887088673439981995710349160595926835946018645317\
7364154857535697786231687922989828177607327201434912966476587002117546\
3386192854631309135851119134438854477295725559453690476047353948607450\
9621026223910475819914476064727733520731903895458699254167864951056547\
7404659919334450029010612549239955141096001276073713070323583873630832\
7911075337777367204691898378626893737782468099518912808149870653169134\
3318041030696666975764085793577641602679516238397345706484621909937577\
5984003670208867059191852013360108006668431971695805791400990627878529\
9013765985122032480384946,
  1.307234098288511982064843751141010676154221839520067876246259243889\
1725084335537235358824871232883358844473534889988749059618237108402405\
7298736779164048827044749257599756943454620083617349875727365555906240\
3983401320278549867733247053787353267233078693421886477149578663585864\
7630183728811153563576402075073366374810626162278390462387167075333547\
5272805141002115122490644741911839025301442110795095307434832114279457\
8362788970302755792381783305277628012874591925272587241859188999392049\
9121222175223854998667947672894505217175217907935093422653840103731547\
2339695265296170993615754162537296189601153281749353725624375941781881\
6284807148832127988700179538226282947625415332766109631042512278213196\
6317572622952609231260420339316010631325273635369992817270146710621185\
9965911406136402674507711763498398873425583899401136439458950871170676\
9403771320121980392715891240063141885106077406850440210395466036569766\
2430812725921516052298907172129223075207164315906721023416631111126408\
02432322662293553977385,
  0.652146656674440888612733890484775262551792908670185744385420781692\
8253479580214557858979570090908793507803545188210611631481971761315768\
3301813453268372251301903490134127566711111806744628018287157389152063\
4938912861423551974489279245016281457755818248065148844241358099288935\
4914992447051629723905627714604928338751606793367253120488501241225319\
4231050646176417672566892890262709773035513461274692780380281707230009\
6046615672080997293221629771748002140216691388424048842767511452879598\
3450405826728275403627202712923471403042673590821648599193863608961778\
8802126578029194566589063566895103716766702482619229726475103229137969\
5515589924913131915196856249340340439611033923501830619308707194051882\
5875613521772637398826194784550352614992895237790523863819378122131079\
6928312810132079775931093970673923543696122433347375534214987412360331\
6148830387968621338094607118810022197322523502601483599310393144631037\
9263565753278163278472393824792819492821720549675081506067004859720084\
792401641234186351084959,
  0.758092829532339610024736334744398896603188337962224992195365204543\
5742237455213601213828313054034725438411725259379729128328268174520981\
2340741350142783812648692359193927011429505592794805045873607808422810\
9190315635009499162881687121637920151582016877672830586708302917134672\
5493251313561603444454662261999726905755545043554824218446275091519538\
9545495114757144624442078390850505090372757060809006801820891351012465\
8395815828533930585808280670849474735227013566013283785183411521602664\
0991829930410422218776261097586788942008916718985395951430762157571300\
3663465710990261660296489708654997872531491876111250338992921642668762\
8388396156243070114738301326008701587002367094955019936440036180977468\
7568569576401265408352970013160014871501032291790818855263276927579531\
7380453847944568650217736840798072492864849518654432126049622468595909\
5207885051027641665961024281225241046101519135447443998915004410344067\
2352421216964488741349916909876351837640788247610417655720949125442335\
350432622848635495329762,
  1.724372065482973232540745579660605792508291048611025759243916618944\
3813159092110817611601134822407047990082203939070451338268721253804438\
2173160150783247559541096612542130179209070388602057298310763377856757\
5382240977713738497745651621969731826679709258452298102925876217159228\
2333682381108424460712580319106859516684413880656003311668707670646942\
0643360284048096886526557471735369700978349150928419260220366978459348\
6494451947597868948831278132529459078215298095759769709567402284942808\
2964348339118136221810717008823008465162846191896698303101311455350794\
7336110466569075821148151043103292239218158826335428910805786446497436\
8811319081402816052658545224462410970900771190235624065038938611104847\
3122578227625305820999418172103344415809822517751364057302825167489713\
0594966982838315714131649564983345884929923715001542669484330397814108\
5766826096953935227970275223062623941515455759690837383345851213493399\
3483621850150036350854593396865313227248658272694923293175414845905204\
36330568654846340178175}}

角度制下,角度是16.0554701914892082273516860238320808680523181840926309291928955429144\
8963253048398521257269801773902666049236931102028229558138524671704687\
5693579105168287688298600025754865687963900511111153717545027

这个角度的正切值等于多少呢?
  1. ddd=((k5-k4)/(1+k5*k4)//Simplify)/.Thread[{xa,ya,xe,ye,c}->ccc](*求解角度*)
  2. eee=RootApproximant@N[ddd,1000]
  3. fff=N[ArcTan[eee]*180/Pi,200]
复制代码


\[\text{Root}\left[100 \text{$\#$1}^{12}+732 \text{$\#$1}^{10}+1849 \text{$\#$1}^8+1692 \text{$\#$1}^6+66 \text{$\#$1}^4-320 \text{$\#$1}^2+25\&,3\right]\]
正切值是这个十二次方程的根,这个根数值化等于
0.28779341759425754768781644747617745958280089267228083213957593000990\
22874353219001890453021436749148
转化成反正切,并且转化成角度,数值化等于
16.0554701914892082273516860238320808680523181840926309291928955429144\
8963253048398521257269801773902666049236931102028229558138524671704687\
5693579105168287688298600025754865687963900511111153717545027

点评

nyy
这个回答是错误的,可以忽略  发表于 2023-3-9 14:59
nyy
(k12-(k31+k34)/(1+k31*k34)第15行的这个代码错误,分母应该减号  发表于 2023-3-9 08:53
nyy
如果有人感兴趣,我可以把这段代码的注释再详细一些,否则就结束了  发表于 2023-3-8 14:46
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

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

GMT+8, 2024-11-21 20:55 , Processed in 0.035178 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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