How can I compute numerical integration from a multivariate function ( f(t,C) ) where C'=[c_1,c_2,...,c_m] with respect to " t "

1 回表示 (過去 30 日間)
Siavash Kardar Tehran
Siavash Kardar Tehran 2013 年 10 月 16 日
コメント済み: Yannick 2013 年 10 月 17 日
I want to find the numerical integration from a multivariate function ( f(t,C) ) where C'=[c_1,c_2,...,c_m] with respect to " t ",
what command is the most accurate and efficient Matlab command for doing this?
for example this is my function:
f(t,c_1,c_2,c_3,c_4) =
(t^2 + 1)*((5040315906112595*t^(3/5)*(156*c_1 - 156*3^(1/2)*c_2 + 156*5^(1/2)*c_3 - 156*7^(1/2)*c_4 + 195*3^(1/2)*c_2*t - 585*5^(1/2)*c_3*t + 1170*7^(1/2)*c_4*t + 450*5^(1/2)*c_3*t^2 - 2250*7^(1/2)*c_4*t^2 + 1250*7^(1/2)*c_4*t^3))/702561541869797376 + 1)^2 + (sin(t)*(c_1 - (exp(t)*((5040315906112595*t^(3/5)*(156*c_1 - 156*3^(1/2)*c_2 + 156*5^(1/2)*c_3 - 156*7^(1/2)*c_4 + 195*3^(1/2)*c_2*t - 585*5^(1/2)*c_3*t + 1170*7^(1/2)*c_4*t + 450*5^(1/2)*c_3*t^2 - 2250*7^(1/2)*c_4*t^2 + 1250*7^(1/2)*c_4*t^3))/702561541869797376 + 1))/2 + 3^(1/2)*c_2*(2*t - 1) + 5^(1/2)*c_3*(6*t^2 - 6*t + 1) + 7^(1/2)*c_4*(20*t^3 - 30*t^2 + 12*t - 1))^2)/cos(t)^2
note that the command " int ( f,t,0,1 ) " didn't work and it's said: Warning Explicit integral could not be found.
I'll be very appreciate if you help me with this.
Best regards,
Siavash.

回答 (1 件)

Yannick
Yannick 2013 年 10 月 16 日
編集済み: Yannick 2013 年 10 月 16 日
Hi - a few things:
  • INT is a Symbolic Math Toolbox command, so it will try to do the integration symbolically. In this case, since the function is quite complicated, it's having a hard time doing so.
  • Instead, you probably want to try INTEGRAL if you have a recent enough MATLAB version, or QUAD otherwise.
  • To handle the extra parameters, check out this doc page: Parameterizing Functions
Hope this helps!
  2 件のコメント
Siavash Kardar Tehran
Siavash Kardar Tehran 2013 年 10 月 17 日
Dear Yannick, I've tried the "integral" command but it didn't work out or maybe I couldn't use it correctly, my matlab version is R2013a, so please give me more specific answer, If you can just copy my function to your command window and then try to integrate the function in the way you think it might work then if it worked then tell me the exact commands and how I must use them, Thank you very much, regards, Siavash.
Yannick
Yannick 2013 年 10 月 17 日
Hi Siavash,
Could you show your code here, as well as how you execute it and what result/warning/error you get? Then I can help figure out with you why it isn't working as expected.
Yannick

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by