使用matlab中的solve函数求解符号方程组的问题

我在matlab中输入如下:>>symsxyxpypxiyimin;>>f1='(x-xp)^2+(y-yp)^2=min^2';>>f2='(x-xi)^2+(y-yi... 我在matlab中输入如下:
>> syms x y xp yp xi yi min;
>> f1='(x-xp)^2+(y-yp)^2=min^2';
>> f2='(x-xi)^2+(y-yi)^2=3*min^2';
>> [x,y]=solve(f1,f2)
求解的结果是x =
xp+(-yp^2+min^2-y^2+2*y*yp)^(1/2)
xp+(-yp^2+min^2-y^2+2*y*yp)^(1/2)
xp-(-yp^2+min^2-y^2+2*y*yp)^(1/2)
xp-(-yp^2+min^2-y^2+2*y*yp)^(1/2)
y=
xp+(-yp^2+min^2-y^2+2*y*yp)^(1/2)+(2*y*yi-yi^2+3*min^2-y^2)^(1/2)
xp+(-yp^2+min^2-y^2+2*y*yp)^(1/2)-(2*y*yi-yi^2+3*min^2-y^2)^(1/2)
xp-(-yp^2+min^2-y^2+2*y*yp)^(1/2)+(2*y*yi-yi^2+3*min^2-y^2)^(1/2)
xp-(-yp^2+min^2-y^2+2*y*yp)^(1/2)-(2*y*yi-yi^2+3*min^2-y^2)^(1/2)
x和y应该只有两组解,怎么出来四组了呢?更大问题是x,y的表达式中还含有x,y本身,请问各位这是怎么回事啊?谢谢
展开
zzzbin872
2012-04-02 · TA获得超过3066个赞
知道小有建树答主
回答量:525
采纳率:83%
帮助的人:256万
展开全部
不知你的什么版本,我是2011a就告诉我no explicit solution即无解析解。没有出现你这种情况。

这个方程组就是求两圆交点,顶多有两组解,你仔细看解出来的x第一个和x第二个是一模一样的。后两个也是一样的。我以前用低版本的matlab(7.0.1),似乎得到过你这样的解,但是现在用新版本的做就没有这样的问题。

no explicit solution的话,需要求数值解了(matlab说没解析解,不等于你就算不出来了,它经常会告诉你没解析解的,不要吃惊)。其实你这里手算很好算的,何必让电脑去帮你做。matlab符号解方程的能力非常有限,只能够解很简单的有解析解的方程,它的优势在于数值运算,就是你给出除了x,y以外其他变量的数值然后让它解。
书宬
2012-04-02 · TA获得超过7851个赞
知道大有可为答主
回答量:2125
采纳率:75%
帮助的人:3327万
展开全部
>> syms x y xp yp xi yi min
f1=(x-xp)^2+(y-yp)^2-min^2;
f2=(x-xi)^2+(y-yi)^2-3*min^2;
D=solve(f1,f2,x,y)

D =

x: [2x1 sym]
y: [2x1 sym]

>> D.x

ans =

1/2*(-(2*min^2*yp-yp^2*yi+xi^2*yi-2*xi*xp*yp-2*xi*xp*yi+yp^3+xp^2*yi-yp*yi^2+xp^2*yp-2*min^2*yi+yp*xi^2+yi^3+(48*xi^2*xp^2*min^2+4*xp^4*yi*yp+4*xp^2*yi^3*yp+2*xi*xp*yi^4+8*xi*xp^3*yi^2+8*xi*xp^3*yp^2+2*xi*xp*yp^4-12*xi^2*xp^2*yp^2+4*xi^4*yi*yp+8*xi^2*yi^2*min^2+4*xi^2*yi^3*yp-12*xi^2*yi^2*xp^2+8*xi^3*yi^2*xp+4*yp^3*yi*xi^2+4*yp^3*yi*xp^2-6*yp^2*yi^2*xp^2-6*yp^2*yi^2*xi^2+8*min^2*yp^2*xi^2+8*min^2*yp^2*xp^2+8*xi*xp*min^4-32*xi^3*xp*min^2-32*xi*xp^3*min^2+8*xp^2*yi^2*min^2+12*yp^2*yi^2*xi*xp-8*yp^3*yi*xi*xp-16*min^2*yp*xp^2*yi-16*min^2*yp^2*xi*xp-16*min^2*yp*xi^2*yi-16*xi*xp^3*yp*yi-yp^4*xi^2-2*xp^4*yi^2-xp^2*yi^4+24*xi^2*yi*xp^2*yp-16*xi^3*yi*xp*yp-xp^6-xi^6-2*xi^4*yi^2-xi^2*yi^4-8*xi*xp*yp*yi^3-yp^4*xp^2-16*xi*xp*yi^2*min^2+8*xi^3*xp*yp^2+32*min^2*yp*xi*xp*yi+6*xi^5*xp-4*xi^2*min^4+8*xi^4*min^2-4*xp^2*min^4+8*xp^4*min^2+6*xi*xp^5+20*xi^3*xp^3-15*xi^2*xp^4-15*xi^4*xp^2-2*xp^4*yp^2-2*yp^2*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yp^2*xp^2+8*xi*xp*min^4-32*xi^3*xp*min^2-32*xi*xp^3*min^2+8*xp^2*yi^2*min^2+12*yp^2*yi^2*xi*xp-8*yp^3*yi*xi*xp-16*min^2*yp*xp^2*yi-16*min^2*yp^2*xi*xp-16*min^2*yp*xi^2*yi-16*xi*xp^3*yp*yi-yp^4*xi^2-2*xp^4*yi^2-xp^2*yi^4+24*xi^2*yi*xp^2*yp-16*xi^3*yi*xp*yp-xp^6-xi^6-2*xi^4*yi^2-xi^2*yi^4-8*xi*xp*yp*yi^3-yp^4*xp^2-16*xi*xp*yi^2*min^2+8*xi^3*xp*yp^2+32*min^2*yp*xi*xp*yi+6*xi^5*xp-4*xi^2*min^4+8*xi^4*min^2-4*xp^2*min^4+8*xp^4*min^2+6*xi*xp^5+20*xi^3*xp^3-15*xi^2*xp^4-15*xi^4*xp^2-2*xp^4*yp^2-2*yp^2*xi^4)^(1/2))/(-2*xi*xp-2*yp*yi+yp^2+yi^2+xp^2+xi^2)

>>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式