- 积分
- 47
- 注册时间
- 2004-4-28
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2005-8-11 13:19:05
|
显示全部楼层
来自 浙江杭州
Re:[讨论]MATLAB里如何调用maple中的命令?
bainhome wrote:
那先不忙解除置顶了,这个问题我也很想参与一下:
那就还是回到楼主的这个问题上吧.有两个疑问:
1.上面的chinamaker的解释中有关readlib的初始化,我采用如下顺序:
>> maple('readlib(StruveL)')
ans =
proc (v::algebraic, x::algebraic) local s; option `Copyright (c) 1995 by Waterloo Maple Inc. All rights reserved.`; if nargs <> 2 then error "expecting 2 arguments, got %1", nargs elif type(v,'complex(float)') or type(x,'complex(float)') then s := evalf(('StruveL')(v,x)); if type(s,'complex(float)') then return s end if end if; if hastype([v, x],'Inf') then return ('StruveL')(v,x) elif type([x, v],{['NaN', 'complex(extended_numeric)'], ['complex(extended_numeric)', 'NaN']}) then NumericTools:-ThrowUndefined(v*x) elif type(v,'integer') then if type(x,'complex(numeric)') and csgn(x) = -1 or type(x,'`*`') and type(op(1,x),'complex(numeric)') and csgn(op(1,x)) < 0 then return -(-1)^v*StruveL(v,-x) elif type(x,'`+`') then try if sign(x) = -1 then return -(-1)^v*StruveL(v,-x) end if catch "unable to evaluate sign": NULL end try elif x = i or type(x,'`*`') and member(i,{op(x)}) then return i^(v+1)*StruveH(v,-i*x) end if end if; if x = 0 and type(v,'complex(numeric)') then if v = -1 then 2/pi elif -1 < Re(v) then 0 else if hastype([x, v],'nonreal') then NumericEvent('division_by_zero',Inf+Inf*i) else NumericEvent('real_to_complex',NumericEvent('division_by_zero',Inf+Inf*i)) end if end if elif type(v,'numeric') and v < 0 and frac(-v) = 1/2 then besseli(-v,x) else 'StruveL(v,x)' end if end proc
然后求解StruveL帮助的一道例题仍然不能求解:
>> r = maple('StruveL',1.5-i,2.6+3i)
r =
StruveL(3/2-i,13/5+3*i)
运行结果只是回到了原来的式子.
以下是用maple求解的,两相比较不知道问题出在何处?
2.mtaylor似乎并不需要做readlib的初始化,直接就可以运算,另外evalf也可以直接用,但其他一些命令就没这么好使了,不知道是何原因? 大概matlab中的maple版本低?不知了...没怎么用过~~~ |
|