matlab解方程,数值解或解析解

利用Solve函数求解,应该是一个相对简单的函数,为什么就出错了?其中n0n2Phi都是已知的,就只有n1是未知的,按理说应该能解出来啊。... 利用Solve函

数求解,应该是一个相对简单的函数,为什么就出错了?其中n0 n2 Phi 都是已知的,就只有n1是未知的,按理说应该能解出来啊。
展开
 我来答
噜噜晗寶
2014-12-21 · TA获得超过462个赞
知道小有建树答主
回答量:295
采纳率:87%
帮助的人:86万
展开全部
用solve()函数可以求得解析解。使用方法配裂如下:
syms n0 n2 n1 R Phi

solve(R-((n0-n2)^2*(cos(Phi/2))^2+(n0*n2/n1-n1)^2*(sin(Phi/2))^2)/((n0+n2)^2*(cos(Phi/2))^2+(n0*n2/n1+n1)^2*(sin(Phi/2))^2),'n1')
ans =
1/(-2*tan(1/2*Phi)^2+2*R*tan(1/2*Phi)^2)*tan(1/2*Phi)*(-(-2+2*R)*(R*n0^2+R*n2^2+2*R*tan(1/2*Phi)^2*n0*n2+2*R*n0*n2-n0^2+2*n0*n2-n2^2+2*tan(1/唯春2*Phi)^2*n0*n2-(6*n0^2*n2^2+6*R^2*n0^2*n2^2+8*tan(1/2*Phi)^2*n0^2*n2^2+16*R*tan(1/2*Phi)^2*n0^2*n2^2+R^2*n0^4-2*R*n0^4+R^2*n2^4-2*R*n2^4-4*n0^3*n2-4*n0*n2^3+4*R^2*n0^3*tan(1/2*Phi)^2*n2+4*R^2*n2^3*tan(1/2*Phi)^2*n0+8*R^2*tan(1/2*Phi)^2*n0^2*n2^2+16*R*tan(1/2*Phi)^4*n0^2*n2^2+4*R^2*n0^3*n2+4*R*n0^2*n2^2+4*R^2*n2^3*n0-4*n0^3*tan(1/2*Phi)^2*n2-4*n2^3*tan(1/2*Phi)^2*n0+n0^4+n2^4)^(1/2)))^(1/2)
-1/(-2*tan(1/2*Phi)^2+2*R*tan(1/2*Phi)^2)*tan(1/2*Phi)*(-(-2+2*R)*(R*n0^2+R*n2^2+2*R*tan(1/2*Phi)^2*n0*n2+2*R*n0*n2-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2*n0*n2+2*R*n0*n2-n0^2+2*n0*n2-n2^2+2*tan(1/2*Phi)^2*n0*n2+(6*n0^2*n2^2+6*R^2*n0^2*n2^2+8*tan(1/2*Phi)^2*n0^2*n2^2+16*R*tan(1/2*Phi)^2*n0^2*n2^2+R^2*n0^4-2*R*n0^4+R^2*n2^4-2*R*n2^4-4*n0^3*n2-4*n0*n2^3+4*R^2*n0^3*tan(1/2*Phi)^2*n2+4*R^2*n2^3*tan(1/2*Phi)^2*n0+8*R^2*tan(1/2*Phi)^2*n0^2*n2^2+16*R*tan(1/2*Phi)^4*n0^2*n2^2+4*R^2*n0^3*n2+4*R*n0^2*n2^2+4*R^2*n2^3*n0-4*n0^3*tan(1/2*Phi)^2*n2-4*n2^3*tan(1/2*Phi)^2*n0+n0^4+n2^4)^(1/2)))^(1/2)
追问
若果说Phi 也是n的函数,比如说Phi=2*pi*d1*n1/lamda, 其中lamda d1 pi=3.14,也能求n1吗?
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式