3重積分をとくには

5 views (last 30 days)
持田
持田 on 29 Apr 2021
Commented: 持田 on 6 May 2021
3重積分を数値的に解くことはできますか? 例えば2次関数を3重積分することを考えます。内側の2つの積分は0からx(変数)、外側の積分はaからbなど定数となります。 初歩的な質問ですが、よろしくお願いいたします。

Accepted Answer

Hernia Baby
Hernia Baby on 29 Apr 2021
前提
文章を読むに
 3重積分(3変数の積分)というより、
 3回積分したいのかなと思いましたので
 その前提で書きます。
ソリューション
シンボリック値で計算します。
今回はx*sin(x)を内側2つ[0,x]で積分し、外側を[a,b]で積分します。
syms x a b
f = x*sin(x);
f1 = int(f,0,x);
f2 = int(f1,0,x);
f3 = int(f2,a,b)
f3 =
2*b - 2*a + 3*sin(a) - 3*sin(b) - a*cos(a) + b*cos(b)
----------------------------------------------------------------
数値に変換
ちなみにa=1,b=3にして数字にしたいよって場合は以下の通り。
f3_1 = int(f2,1,3);
y = double(f3_1)
y =
2.5908
----------------------------------------------------------------
参考
本計算はSimbolic Math Toolboxを使用しています。
積分の参考は↓
  3 Comments
Hernia Baby
Hernia Baby on 30 Apr 2021
Edited: Hernia Baby on 30 Apr 2021
f2の不一致について
不定積分は  -2cosx-xsinx+C ですが、今回 [0 x]の定積分 です
[-2cosx][0tox] = -2cosx+2 ←この2が入ります
ですので、2倍角の公式を用いて
f2 = -2cosx - xsinx +2 = 2(1-cosx) - xsinx = 4sin(x/2)^2 - xsinx
となります。
----------------------------
簡単な式の確認をしたい場合は外部リンクになりますが
Wolfram alphaがお勧めです
変数が入る積分について
integral関数のことをおっしゃっていると思います。
こちらは数値積分法を使っており、範囲指定が変数(シンボリック)の場合難しいと考えます。
----------------------------
外部リンクですが数値積分は以下のようなイメージです
持田
持田 on 6 May 2021
ありがとうございました。

Sign in to comment.

More Answers (0)

Categories

Find more on 数値積分と微分方程式 in Help Center and File Exchange

Tags

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!