1个回答
2017-04-30
展开全部
MATLAB会把它作为嵌套的定积分来计算。
>> clear
>> syms t x y z X Y T%定义符号变量
>> I1=int(x*exp(-2*y)*exp(-3*z),z,0,t-x-y)%依次输入被积函数,积分变量,积分下限和积分上限
I1 =
-x*exp(-2*y)*((exp(-3*t)*exp(3*x + 3*y))/3 - 1/3)
>> I2=int(I1,y,0,t-x)%直接利用上一步积分结果
I2 =
(x*exp(-3*t)*(exp(t) - exp(x))^2*(exp(t) + 2*exp(x)))/6
>> I3=int(I2,x,0,t)
I3 =
exp(-3*t)/27 - exp(-2*t)/8 - (5*t)/36 + t^2/12 + 19/216
>> %下面从内到外求积分S
F_XT =
(T - X)^2
>> %外层积分,dF(X)=F'(X)dX,下面求导函数F'(t)在t=X处的取值
>> diff_F_X=subs(diff(I3,t,1),t,X)%这里diff表示对I3(即F)求一阶导数,subs表示对求导结果在t=X处赋值
diff_F_X =
X/6 + exp(-2*X)/4 - exp(-3*X)/9 - 5/36
>> %计算外层积分
>> I4=int(F_XT*diff_F_X,X,0,T)
I4 =
(2*exp(-3*T))/243 - exp(-2*T)/16 - (65*T)/648 + (19*T^2)/216 - (5*T^3)/108 + T^4/72 + 211/3888
>> simplify(I4)
ans =
(2*exp(-3*T))/243 - exp(-2*T)/16 - (65*T)/648 + (19*T^2)/216 - (5*T^3)/108 + T^4/72 + 211/3888
上面是分步计算的过程,组合起来,就是:
>> simplify(int(int(2*Y,Y,0,T-X)*subs(diff(int(int(int(x*exp(-2*y)*exp(-3*z),z,0,t-x-y),y,0,t-x),x,0,t),t,1),t,X),X,0,T))
ans =
(2*exp(-3*T))/243 - exp(-2*T)/16 - (65*T)/648 + (19*T^2)/216 - (5*T^3)/108 + T^4/72 + 211/3888
>> clear
>> syms t x y z X Y T%定义符号变量
>> I1=int(x*exp(-2*y)*exp(-3*z),z,0,t-x-y)%依次输入被积函数,积分变量,积分下限和积分上限
I1 =
-x*exp(-2*y)*((exp(-3*t)*exp(3*x + 3*y))/3 - 1/3)
>> I2=int(I1,y,0,t-x)%直接利用上一步积分结果
I2 =
(x*exp(-3*t)*(exp(t) - exp(x))^2*(exp(t) + 2*exp(x)))/6
>> I3=int(I2,x,0,t)
I3 =
exp(-3*t)/27 - exp(-2*t)/8 - (5*t)/36 + t^2/12 + 19/216
>> %下面从内到外求积分S
F_XT =
(T - X)^2
>> %外层积分,dF(X)=F'(X)dX,下面求导函数F'(t)在t=X处的取值
>> diff_F_X=subs(diff(I3,t,1),t,X)%这里diff表示对I3(即F)求一阶导数,subs表示对求导结果在t=X处赋值
diff_F_X =
X/6 + exp(-2*X)/4 - exp(-3*X)/9 - 5/36
>> %计算外层积分
>> I4=int(F_XT*diff_F_X,X,0,T)
I4 =
(2*exp(-3*T))/243 - exp(-2*T)/16 - (65*T)/648 + (19*T^2)/216 - (5*T^3)/108 + T^4/72 + 211/3888
>> simplify(I4)
ans =
(2*exp(-3*T))/243 - exp(-2*T)/16 - (65*T)/648 + (19*T^2)/216 - (5*T^3)/108 + T^4/72 + 211/3888
上面是分步计算的过程,组合起来,就是:
>> simplify(int(int(2*Y,Y,0,T-X)*subs(diff(int(int(int(x*exp(-2*y)*exp(-3*z),z,0,t-x-y),y,0,t-x),x,0,t),t,1),t,X),X,0,T))
ans =
(2*exp(-3*T))/243 - exp(-2*T)/16 - (65*T)/648 + (19*T^2)/216 - (5*T^3)/108 + T^4/72 + 211/3888
追问
非常感谢您!完美解答了我的问题!
还有一个小问题 就是当我解复杂式子的积分时,matlab总提示 "警告: 已达到函数计算的最大数目(2000)。结果将使全局误差测试失败。"
请问这个有好的解决方法嘛 感谢您
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询