積分変数をベクトルとして与える際の重積分を行う際の関数とIntegral2の扱い方
28 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Mutsumi Yoshino
le 7 Juil 2021
Commenté : Mutsumi Yoshino
le 7 Juil 2021
のように与えた場合の,x1, x2についての積分になります.
fun = @(x, y) [x y] * [1 2; 3 4] * [x; y]
q = integral2(fun, 0, 1, 0, 1) %積分範囲はa=c=0, b=d=1として記述
を行うと,以下のようなエラーになります.
エラー: *
内部行列の次元は一致しなければなりません。
エラー: LiveEditorEvaluationHelperESectionEval>@(x1,x2)[x1,x2]*[1,2;3,4]*[x1;x2]
エラー: integral2Calc>integral2t/tensor (line 228)
Z = FUN(X,Y); NFE = NFE + 1;
エラー: integral2Calc>integral2t (line 55)
[Qsub,esub] = tensor(thetaL,thetaR,phiB,phiT);
エラー: integral2Calc (line 9)
[q,errbnd] = integral2t(fun,xmin,xmax,ymin,ymax,optionstruct);
エラー: integral2 (line 106)
Q = integral2Calc(fun,xmin,xmax,yminfun,ymaxfun,opstruct);
式を展開し,
fun = @(x1, x2) x1.^2 + 4 .*x2 .^2 + 5 .* x1 .* x2
q = integral2(fun, 0, 1, 0, 1)
>>
ans =
2.916666666666940
のようにすれば問題なく積分が可能なのですが,より複雑な式の積分を行いたいので,どのように関数を定義してあげればベクトルのまま積分関数(integralなど)に入力することが可能か教えていただきたいです.
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 数値積分と微分 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!