how can I use summation and index for the series

조회 수: 1 (최근 30일)
work wolf
work wolf 2022년 5월 24일
댓글: Torsten 2022년 5월 25일
how can I use summation and index for the following series by using matlab
Edit:
the pervious Equation solution for
My trying to write the following code, but i don't know if it is right ot no
u0=0;
alpha=0.5;%[0.1 0.3 0.5 0.6 0.66 0.9 1]; matrix
a=0; b=1;n=100;
h=(b-a)/n;
t=a:h:b;
f=@(t,u) (-u.^4) + ( gamma(2*alpha+1)./gamma(alpha+1) ).*(t.^alpha) - ( 2./gamma(3-alpha) ).*(t.^(2-alpha)) + (t.^(2*alpha)-t.^2).^4;
exact=@(t) t.^(2*alpha)-t.^2;
%-----a'ks---------------------------------------
a_kth=@(k) (k+1).^(1-alpha)-(k).^(1-alpha);
u_p=zeros(1,n); z_p=zeros(1,n); u=zeros(1,n);
s=0;
for i=1
u_p(i)=a_kth(i-1)*u0; %s=s+q^keval(subs(fun,xq^k));
z_p(i)=gamma(2-alpha)*( h.^alpha ) * f(t(i),u_p(i));
u(i)=u_p(i)+gamma(2-alpha)*( h.^alpha ) * f(t(i),u_p(i)+z_p(i));
end
%--------------------------------------
for i=2:n
for k=1:i-1
s=s+(a_kth(i-1-k)-a_kth(i-k))*u(k);
u_p(i)=a_kth(i-1)*u0+s; %s=s+q^keval(subs(fun,xq^k));
z_p(i)=gamma(2-alpha)*( h.^alpha ) * f(t(i),u_p(i));
u(i)=u_p(i)+gamma(2-alpha)*( h.^alpha ) * f(t(i),u_p(i)+z_p(i));
end
end
u1=[ u0 u];
plot(t,u1)
exact1=exact(t);
error=exact1-u1;
  댓글 수: 17
work wolf
work wolf 2022년 5월 25일
@Torsten How is that?
Torsten
Torsten 2022년 5월 25일
A link where the solution scheme for your equation is derived and explained.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by