Triplequad function with symbolic variables
2 ビュー (過去 30 日間)
古いコメントを表示
Hi Dear Matlab users
My problem is I wrote a function just below.
function out = ahmet(r,s,zeta)
syms z1
out=2*r.^2*s.^4*zeta*z1;
end
Then I called this function to be used for
k=triplequad('ahmet',-1,1,-1,1,-1,1)
It gives me errors telling that ''Inputs must be floats, namely single or double.''
If I omit z1 variable which is symbolic then it evaluates the quadrature but I want z1 stay and not calculated in the equation. Is it possible for quadrature ?
It is possible for int() command using symbolic variables. But I have to bring together both quadrature and symbolic variables ?
Thank you
0 件のコメント
回答 (1 件)
Walter Roberson
2013 年 3 月 2 日
syms r s zeta
k = int( int( int( ahmet(r, s, zeta), r, -1, 1), s, -1, 1), zeta, -1, 1);
Note that the result (if it can be analytically found) will likely have z1 as a free variable.
Caution: if you replace the limits of integration for zeta with "a" and "b", the integral works out as (4/15)*z1*(b^2-a^2) . And when abs(a) = abs(b) as is the case for -1 to +1, the solution is going to be identically 0 for all values of z1.
参考
カテゴリ
Help Center および File Exchange で Number Theory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!