找回密码
 欢迎注册
查看: 18759|回复: 6

[讨论] 复数方程组求解

[复制链接]
发表于 2011-1-17 17:53:56 | 显示全部楼层 |阅读模式

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

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

×
(2+5i)*x1-x2^(2-3i)-exp(-x1)=0 -(x1^3)+x1*x2-exp(-x2)=0 这个方程组有几组解?大家试试看。 理论上如能证明有几组解并给出解更好。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-18 09:15:42 | 显示全部楼层
1# forcal 把x1=a+b i , x2= c+d i代进去,令方程左边的实部虚部分别为0,应该会得到一个很复杂的关于a,b,c,d的四组方程。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-18 09:25:26 | 显示全部楼层
本帖最后由 wayne 于 2011-1-18 09:28 编辑 方程: 截图00.png 这个解起来很费劲,我用了搜索算法, 在初始值为(1+i,1+i) 处搜到一解: {0.8791277181294163+ 0.5643186120318102 i, 0.6678887520894088+ 0.5502019010891991 i} 回代到方程,误差: {-2.44249*10^-15 - 8.88178*10^-16 I, 3.33067*10^-16 - 1.11022*10^-16 I}
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-18 09:55:12 | 显示全部楼层
3# wayne 其实FindRoot函数可以直接在复域搜索。
  1. m = 10; tmp = {#[[-1]], {x1, x2}} /. FindRoot[{(2 + 5 I)*x1 - x2^(2 - 3 I) - E^-x1 == 0, -(x1^3) + x1*x2 - E^-x2 == 0}, {{x1, #[[1]]}, {x2, #[[2]]}},WorkingPrecision -> 10] & /@ Flatten[Table[{i, j, {i, j}}, {i, 1, m, 1}, {j, 1, m, 1}], 1];
  2. DeleteDuplicates[tmp, #1[[-1]] == #2[[-1]] &]
复制代码
运行结果:
{{1, 1}, {0.3504034061 - 0.2581172046 I, 0.9031492305 + 0.2062068702 I}}, {{1, 3}, {0.008663773124 + 0.05927370163 I, 2.009821712 - 0.9744617637 I}}, {{1, 6}, {0.08343862612 - 0.1745973157 I, 0.3407059687 - 3.686653995 I}}, {{1, 10}, {-0.02866006054 - 0.01195892185 I, 1.330587482 - 8.406178015 I}}, {{2, 1}, {0.8791277181 + 0.5643186120 I, 0.6678887521 + 0.5502019011 I}}, {{2, 3}, {2.188498719 - 0.2547470127 I, 4.725985876 - 1.111240047 I}}, {{7, 8}, {2.188498721 - 0.2547470139 I, 4.725985877 - 1.111240047 I}}, {{9, 2}, {0.1575094450 - 0.006233406303 I, -0.5428160524 - 10.90400468 I}}, {{10, 2}, {0.3678174170 - 0.2447841800 I, -1.987462609 - 16.56633274 I}}, {{10, 10}, {2.188498720 - 0.2547470114 I, 4.725985876 - 1.111240046 I}}
即在初始值 {1,1} 处搜到解{0.3504034061 - 0.2581172046 I, 0.9031492305 + 0.2062068702 I} 在初始值{1, 3}处,,搜到解 {0.008663773124 + 0.05927370163 I, 2.009821712 - 0.9744617637 I}}, 。。。。。。。。。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-1-18 09:59:15 | 显示全部楼层
回代入原方程,误差应该都是10^-9,因为,FindRoot函数加了参数 WorkingPrecision -> 10
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2011-1-18 21:40:10 | 显示全部楼层
4# wayne 谢谢wayne!这个题目是我做测试用的。 一个复数对应2个实数。目前,Forcal中虽然没有专门求解复数方程(组)的函数,但可以借助实数算法来求解。 Forcal代码:
  1. !using["fcopt"];
  2. c: cf(x1,x2,y1,y2)=
  3. {
  4. y1=(2+5i)*x1-x2^(2-3i)-exp(-x1),
  5. y2=-(x1^3)+x1*x2-exp(-x2)
  6. };
  7. cc(x11,x12,x21,x22,y11,y12,y21,y22)= cf(x11,x12,x21,x22,&y11,&y12,&y21,&y22);
  8. solve[HFor("cc")];
复制代码
结果(多次运行以上代码求解,只求得不重复的8组,每组最后一个是误差): 0.350403406122754 -0.2581172046401702 0.9031492305415151 0.2062068702236727 3.500829247998799e-014 8.343862612128539e-002 -0.1745973157301181 0.3407059687466865 -3.686653995029365 1.014802625489917e-011 -2.866006054280364e-002 -1.195892184488039e-002 1.330587481557424 -8.406178015373364 1.344455731312484e-011 0.3248221986204087 -0.8164562030925229 8.588879599246295e-002 0.2894415311777754 3.570823474245571e-011 8.663773118603429e-003 5.927370162144334e-002 2.009821712522968 -0.9744617637719372 1.073856633613092e-010 0.1575094449966286 -6.233406303049387e-003 -0.5428160523568441 -10.90400468060007 1.542485713397894e-013 0.5108186106709388 0.8884343740105763 -3.912183017503166e-002 1.868542038988761e-002 4.891644231048831e-012 -1.000140126356298 4.481460412883024e-005 -2.935625999646882e-002 4.580361872777336e-003 1.741254712865244e-012
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2011-1-21 12:01:18 | 显示全部楼层
做了些改进,一次运行可以得到好多解:
  1. !using["fcopt"];
  2. c: cf(x1,x2,y1,y2)=
  3. {
  4. y1=(2+5i)*x1-x2^(2-3i)-exp(-x1),
  5. y2=-(x1^3)+x1*x2-exp(-x2)
  6. };
  7. cc(x11,x12,x21,x22,y11,y12,y21,y22)= cf(x11,x12,x21,x22,&y11,&y12,&y21,&y22);
  8. solve[HFor("cc"), optmode,20, optnum,50];
复制代码
-2.866006054064824e-002 -1.195892184644717e-002 1.330587481554971 -8.406178015402372 1.387778780781446e-017 0.3504034061227618 -0.2581172046401729 0.9031492305415105 0.2062068702236714 8.239479992065644e-017 8.343862612043082e-002 -0.1745973157291573 0.3407059687267944 -3.686653995031711 8.441528768080324e-017 8.663773124256998e-003 5.927370162532636e-002 2.009821712467028 -0.9744617637089106 1.136475591006991e-016 0.1575094449966263 -6.233406303054617e-003 -0.542816052357006 -10.90400468060004 1.449824398427615e-016 -0.9761505525076732 -4.188916694990575e-002 0.2629061022575846 0.4632752572864877 2.491246524490876e-016 0.3248221986199319 -0.8164562030920612 8.588879599375437e-002 0.2894415311784372 6.206335383118183e-016 0.8791277181294162 0.5643186120318099 0.6678887520894088 0.550201901089199 9.494881815839865e-016 0.47014618662332 -0.8937212702340192 -4.723585513789652e-002 5.203782055471674e-002 1.095927945427294e-015 -1.000140126356298 4.481460412839825e-005 -2.935625999646691e-002 4.580361872773629e-003 1.123377289448176e-015 2.188498719161242 -0.2547470127039707 4.725985875577431 -1.11124004729153 2.581624953682977e-015 0.3678174168189278 -0.2447841798663009 -1.987462608771816 -16.56633273815325 2.771147860951347e-015 -3.100630176952709 2.638068390925504 -3.489490517227492 -11.15899472513772 3.32325934484418e-015 0.2558786570385518 -0.6418806813845877 -2.724268338853494 -22.26249891344482 5.063396036227354e-015 -3.182094240774668 2.397909424273116 4.378839918650099 -15.26012862676683 6.480357675110514e-015 4.389636735596266 -2.595162790502456 12.53404059038755 -22.78364452544313 1.045962689022551e-014 -0.1855606165010252 -0.9066700734311222 -3.269988236024981 -27.98503379114037 3.425307928687278e-014 -4.577492129524085 1.497860447450567 18.70984827565044 -13.71288882020663 5.398980978589953e-014 -1.835236239190097 -0.2216397976358111 -4.463914480755459 -45.506812423497 6.989371995498532e-014 -1.050561684005955 4.982406505106374 -5.651246722944038 -63.36881420162514 1.406218427278617e-013 1.566884355554632 7.172090182781056 -6.664540093352734 -75.59052814455785 1.620847438635219e-013 -1.727171118126964 4.214377383204703 -5.292154411000675 -57.15671861052886 3.582435616555151e-013 -4.701809680685463 8.371462009006109 -6.197202180092947 -108.2809217281837 6.113661814174522e-013 -4.326316270362867 8.241275824595316 -6.133583235451917 -95.78518911641478 7.228730233747309e-013 -1.566817874139723 -0.1557788051049782 2.383001997667142 0.5222697207582273 7.549066725264193e-013 -4.254760059866216 1.363576169231233 -5.884514800006796 -88.94659066197426 8.66210774405652e-013 -4.362272565208402 -5.423606002244553 -6.770621340004421 -77.89131870443127 1.192622222897801e-012 -0.9983326203909592 2.0940504155351e-003 -5.494800887396104e-002 0.1141467589227911 1.768576534963572e-012 5.992651989785254 7.920682084866131 -7.507315563783017 -87.42243657260113 2.243728961607912e-012 -2.293279865951555 3.711816705524627 -5.001887492667214 -50.9222811419904 4.068155529782339e-012 0.5108186106709394 0.8884343740105762 -3.912183017503151e-002 1.868542038988848e-002 5.117208628836099e-012 -10.74703863664621 -2.12744120661841 110.9728333699528 45.72738568944081 2.784335487859627e-011 15.94378727178433 3.683038675346984 -8.618271450579009 -110.9244505746418 3.871009121091419e-011 24.01842318877565 -11.78480705959316 -9.713111709243538 -140.1550343850872 4.784726745771434e-011 -0.7716632762395588 -0.8820328884402924 -3.72190779870413 -33.73826440634102 1.462791213478983e-010 -7.158566379742393 24.25182697486836 -9.503962747084117 -403.8746634747134 1.612877394494571e-010 -7.621902072717548 -12.77933109513089 -9.233904388329016 -486.5490266205195 1.624199237957987e-010 -13.95604358118798 -7.381685900472105 140.2818657067892 206.038260259259 1.146928700619367e-009 -1.331994639452288 -0.6132938375371181 -4.11016443662261 -39.56850420036292 1.289971799775969e-009 -13.03061961123774 -1.082449441953021 -7.751148451823107 50.3072382990715 2.203706533345664e-009 0.6041474952894912 0.8834204997480536 -2.907695678947905e-002 0.1865018285209554 4.754465847735357e-009 -6.621524515659299 78.90395561043127 -13.10810797741292 -209.1342996987204 7.218250467879421e-009 -7.398457271070837 -88.40476416754262 -13.46458524967493 -412.8173529204323 8.339347544578711e-009 23.70707956561144 -24.67192036096383 -10.45300436338892 -157.8093095132335 9.056414420001613e-009 -11.67315256514138 12.03254252804586 -10.93643068856971 -3632.450625269413 1.201281810603754e-008 -12.4131377270592 -37.12935232544167 -12.41396801330064 -5249.472624665639 2.947801366671841e-008 -10.8268170496289 54.74858079123759 -12.06365345994384 -2382.697837023535 3.019536485105659e-008 -11.96838180111634 169.563933677662 -15.39665884796502 -4223.936014319055 8.027895068013834e-008 -8.144550091894388 -646.7483187096254 -19.41607102115443 -130.338005261106 3.007516416700924e-007 49.
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

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

GMT+8, 2024-11-23 17:37 , Processed in 0.031802 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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