SHARE
TWEET

Untitled

a guest Feb 27th, 2020 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ecFR(N,I)
  2. %Ionescu Mihai
  3. %Grupa 1341
  4. %Pentru
  5. N=2, I=25
  6.  
  7. a=0;
  8. b=pi;
  9. alpha=2;
  10. h=(b-a)/I;
  11.  
  12.     function f=f(x)
  13.         f=sin(alpha*x)+(pi*x/10*alpha)*(cos(alpha*x)-1);
  14.     end
  15.     function k=k(x,y)
  16.         k=x*y/50;
  17.     end
  18.         for i=1:I+1
  19.             x(i)=(i-1)*h;
  20.         end
  21.        
  22.        
  23.         for i=1:I+1
  24.             U(1,i)=f(x(i));
  25.         end
  26.         plot(x,U(1,:))
  27.        
  28.         for n=1:N
  29.             for i=1:I+1
  30.                 for j=1:I+1
  31.                     val(j)=k(x(i),x(j))*U(n,j);
  32.                 end
  33.                 U(n+1,i)=trapz(x,val)+f(x(i));
  34.                
  35.                 plot(x,U(n+1,:))
  36.                
  37.             end
  38.         end
  39.        
  40.                  
  41.  
  42. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top