hrefspace

 找回密码
 立即注册
搜索
热搜: PHP PS 程序设计
查看: 507|回复: 9

用 mathematica 如何解这个复数方程

[复制链接]

948

主题

1162

帖子

3655

积分

超级版主

Rank: 8Rank: 8

积分
3655

论坛头条论坛元老谋士数据帝优秀版主超级版主见习版主论坛版主

发表于 2023-10-3 08:25:29 | 显示全部楼层 |阅读模式
如何解下面这个含有复数的方程?未知数为 R 和 θ, R 为小于 1 的正实数,θ 为小于 90 度的正角度。

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

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



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

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

本帖子中包含更多资源

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

x
世界上最遥远的距离,不是生与死的距离,而是我站在你面前,你却不知道我爱你
回复

使用道具 举报

0

主题

184

帖子

15

积分

新手上路

Rank: 1

积分
15
发表于 2023-10-3 08:25:51 | 显示全部楼层
试试:

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

使用道具 举报

1

主题

188

帖子

5

积分

新手上路

Rank: 1

积分
5
发表于 2023-10-3 08:26:06 | 显示全部楼层
\[Solve[\{ a ==  b, c  == d, 1  >  R  >  0, \frac{\pi }{2}  > \theta  >  0\}, \{R, \theta\} ]\]
回复

使用道具 举报

275

主题

454

帖子

1014

积分

大司空

Rank: 5Rank: 5

积分
1014
发表于 2023-10-3 08:26:51 | 显示全部楼层
成功方案之一:



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

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

前面加上 FullSimplify 的能直接给出 θ 的准确值,但 R 具体是多少还得算。

本帖子中包含更多资源

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

x
回复

使用道具 举报

0

主题

190

帖子

2

积分

新手上路

Rank: 1

积分
2
发表于 2023-10-3 08:27:43 | 显示全部楼层
此问题源于解决下面这个小题:

本帖子中包含更多资源

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

x
回复

使用道具 举报

0

主题

171

帖子

17

积分

新手上路

Rank: 1

积分
17
发表于 2023-10-3 08:28:13 | 显示全部楼层
这个直接计算各个角度的关系就可以出来了
回复

使用道具 举报

0

主题

202

帖子

2

积分

新手上路

Rank: 1

积分
2
发表于 2023-10-3 08:28:55 | 显示全部楼层
你这个b上面带一横的,表示共轭复数吗?怎么搞出来的?
回复

使用道具 举报

0

主题

192

帖子

2

积分

新手上路

Rank: 1

积分
2
发表于 2023-10-3 08:29:29 | 显示全部楼层
具体说说怎么搞的?我很好奇用复数解这个几何题
回复

使用道具 举报

0

主题

199

帖子

66

积分

关内侯

Rank: 2

积分
66
发表于 2023-10-3 08:30:21 | 显示全部楼层
你搞代码,至少也要搞个文本代码粘贴上来,方便别人复制粘贴修改代码呀,这样别人才能方便给你解决问题,你只图自己爽,真敢拿别人都当雷锋呀
回复

使用道具 举报

0

主题

205

帖子

49

积分

新手上路

Rank: 1

积分
49
发表于 2023-10-3 08:31:18 | 显示全部楼层
假设B点为原点,然后BD=1  BC=c,A点(xa,ya),E点(xe,ye)

结果太复杂了,以致于我都怀疑软件算错了
  1. Clear["Global`*"];k1=ya/xak2=ye/xek3=(ye-0)/(xe-c)k4=(ye-0)/(xe-1)k5=(ya-0)/(xa-1)k12=(k1-k2)/(1+k1*k2)//Simplifyk31=(k3-k1)/(1+k3*k1)//Simplifyk34=(k3-k4)/(1+k3*k4)//Simplifyans=Solve[{    (k2+k5//Simplify//Together//Numerator)==0,    xe^2+ye^2==1^2,    Det[{{xa,ya,1},{xe,ye,1},{c,0,1}}]==0,    (xa-1)^2+(ya-0)^2==c^2,    (k12-(k31+k34)/(1+k31*k34)//Simplify//Together//Numerator)==0},{xa,ya,xe,ye,c}]Grid[ans,Alignment->Left](*列表显示*)Grid[Chop@N[ans,10],Alignment->Left](*数值化*)aaa=Select[ans,((ya>0&&ye>0&&c>1)/.#)&](*过滤出符合要求的解*)bbb=N[{xa,ya,xe,ye,c}/.aaa,1000](*高精度数值解*)ccc=RootApproximant[bbb[[1]]](*由数值解得到精确解*)kk=ArcTan[(k5-k4)/(1+k5*k4)//Simplify]/.Thread[{xa,ya,xe,ye,c}->ccc](*求解角度*)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](*求解角度*)eee=RootApproximant@N[ddd,1000]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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|hrefspace

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

Powered by hrefspace X3.4 Licensed

Copyright © 2022, hrefspace.

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