br0414 发表于 2010-3-5 00:47

matlab求导数为什么老出错

我想对下列函数求导数,但是球出来的导数虚数单位i就自动变为大写的I了,始终找不到原因,哪位能告诉我怎么解决啊,而且数值变成这种分数相处的形式,也不知道怎么解决

syms kxB
b6 =bessely(0, (49*(1925653029807063/140737488355328 - (803108098859253*i)/36028797018963968 - kxB^2)^(1/2))/2000)*besselj(1, (411*(1925653029807063/140737488355328 - (803108098859253*i)/36028797018963968 - kxB^2)^(1/2))/5000)*besselj(1, (49*(961261823162635/70368744177664 - kxB^2)^(1/2))/2000)
df=diff(b6)

>> diff(b6)

ans =

49/2000*kxB/(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2)*besselj(1, 49/2000*(961261823162635/70368744177664 - kxB^2)^(1/2))*bessely(1, 49/2000*(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2))*besselj(1, 411/5000*(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2)) + 49/2000*kxB/(961261823162635/70368744177664 - kxB^2)^(1/2)*bessely(0, 49/2000*(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2))*besselj(1, 411/5000*(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2))*(2000/49/(961261823162635/70368744177664 - kxB^2)^(1/2)*besselj(1, 49/2000*(961261823162635/70368744177664 - kxB^2)^(1/2)) - besselj(0, 49/2000*(961261823162635/70368744177664 - kxB^2)^(1/2))) + 411/5000*kxB/(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2)*besselj(1, 49/2000*(961261823162635/70368744177664 - kxB^2)^(1/2))*bessely(0, 49/2000*(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2))*(5000/411/(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2)*besselj(1, 411/5000*(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2)) - besselj(0, 411/5000*(1925653029807063/140737488355328 - kxB^2 - 803108098859253/36028797018963968*I)^(1/2)))

ChaChing 发表于 2010-3-5 08:12

刚试下, 我的版本是v5.3
?diff(b6)

ans =

49/2000*bessely(1,49/2000*(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2))/(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2)*kxB*besselj(1,411/5000*(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2))*besselj(1,49/2000*(961261823162635/70368744177664-kxB^2)^(1/2))-411/5000*bessely(0,49/2000*(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2))*(besselj(0,411/5000*(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2))-5000/411/(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2)*besselj(1,411/5000*(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2)))/(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2)*kxB*besselj(1,49/2000*(961261823162635/70368744177664-kxB^2)^(1/2))-49/2000*bessely(0,49/2000*(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2))*besselj(1,411/5000*(1925653029807063/140737488355328-803108098859253/36028797018963968*i-kxB^2)^(1/2))*(besselj(0,49/2000*(961261823162635/70368744177664-kxB^2)^(1/2))-2000/49/(961261823162635/70368744177664-kxB^2)^(1/2)*besselj(1,49/2000*(961261823162635/70368744177664-kxB^2)^(1/2)))/(961261823162635/70368744177664-kxB^2)^(1/2)*kxB

但是没能清楚之间的不同

br0414 发表于 2010-3-6 06:44

但我的结果虚数单位为什么始终是I,而不是小i,我并没有定义大I

ChaChing 发表于 2010-3-6 10:42

刚再试下, 家中版本是2009a, 的确是I!
不清楚新旧版本之间的不同及差异:@L , 同待高人路过!

[ 本帖最后由 ChaChing 于 2010-3-6 10:49 编辑 ]
页: [1]
查看完整版本: matlab求导数为什么老出错