SHARE
TWEET

Untitled

a guest Nov 19th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %K1
  2. figure(1);
  3. x=[1:0.1:10];
  4. y=[1:0.1:10];
  5. [X,Y]=meshgrid(x,y);
  6. K1= X.^3./(X.^3.-cos(Y)./3);
  7. surf(X,Y,K1);
  8. hold on,
  9.     xlabel('x');
  10.     ylabel('y');
  11.     zlabel('K(x,y)');
  12. title('K1(x,y)');
  13.  
  14. %K2
  15. figure(2);
  16. [X,Y]=meshgrid(x,y);
  17. K2= (cos(Y)./3)./(X.^3.+(cos(Y)./3));
  18.  
  19. surf(X,Y,K2);
  20. hold on,
  21.     xlabel('x');
  22.     ylabel('y');
  23.     zlabel('K(x,y)');
  24. title('K2(x,y)');
  25.  
  26. %K3
  27. figure(3);
  28. [X,Y]=meshgrid(x,y);
  29. K3= (cos(Y)./3)./(X.^3.+(cos(Y)./3));
  30. surf(X,Y,K3);
  31. hold on,
  32.     xlabel('x');
  33.     ylabel('y');
  34.     zlabel('K(x,y)');
  35. title('K3(x,y)');
  36.  
  37. %K4
  38. figure(4);
  39. [X,Y]=meshgrid(x,y);
  40. surf(X,Y,K4);
  41. hold on,
  42.     xlabel('x');
  43.     ylabel('y');
  44.     zlabel('K(x,y)');
  45. title('K4(x,y)');
  46.  
  47. %K5
  48. figure(5);
  49. [X,Y]=meshgrid(x,y);
  50. K5= (sin(Y)./2)./(Y-(sin(Y)./2));
  51. surf(X,Y,K5);
  52. hold on,
  53.     xlabel('x');
  54.     ylabel('y');
  55.     zlabel('K(x,y)');
  56. title('K5(x,y)');
  57.  
  58. %K6
  59. figure(6);
  60. [X,Y] = meshgrid(1:10,1:10);
  61. K6= 1*ones(length(Y),length(X));
  62. surf(X,Y,K6)
  63. hold on,
  64.     xlabel('x');
  65.     ylabel('y');
  66.     zlabel('K(x,y)');
  67. title('K6(x,y)');
  68.  
  69. %K7
  70. figure(7);
  71. [X,Y] = meshgrid(1:10,1:10);
  72. K7= -1*ones(length(Y),length(X));
  73. surf(X,Y,K7)
  74. hold on,
  75.     xlabel('x');
  76.     ylabel('y');
  77.     zlabel('K(x,y)');
  78. title('K7(x,y)');
  79.  
  80. %K8
  81. figure(8);
  82. [X,Y] = meshgrid(1:10,1:10);
  83. K8= 1*ones(length(Y),length(X));
  84. surf(X,Y,K8)
  85. hold on,
  86.     xlabel('x');
  87.     ylabel('y');
  88.     zlabel('K(x,y)');
  89. title('K8(x,y)');
  90.  
  91. %Tx
  92. figure(9);
  93. [X,Y]=meshgrid(x,y);
  94. Tx= 3.*X.^3./(X.^3.+cos(Y)./3);
  95. surf(X,Y,Tx);
  96. hold on,
  97.     xlabel('x');
  98.     ylabel('y');
  99.     zlabel('T(x,y)');
  100. title('Tx(x,y)');
  101.  
  102. %Ty
  103. figure(10);
  104. [X,Y]=meshgrid(x,y);
  105. Ty= (Y./(X.^3 + (cos(Y))./3) .* ((3.*X.^3 - 2).*cos(Y) - 6.*X.^3 + sin(Y).^2 - 2.*Y.*sin(Y)+ cos(Y).^2)./(6.*(Y - sin(Y)./2)));
  106. surf(X,Y,Ty);
  107. hold on,
  108.     xlabel('x');
  109.     ylabel('y');
  110.     zlabel('T(x,y)');
  111. title('Ty(x,y)');
  112.  
  113. %============================================ZADANIE 2============================================
  114.  
  115. rows=100;
  116. columns=100;
  117. matrix=zeros(100,100);
  118. eps = 10.^(-13);
  119.  
  120. for x = 1: 0.1: 10
  121.     for y = 1: 0.1: 10
  122.         matrix(x,y)= abs(Tx) + abs(Ty) + abs(K1) + abs(K2) + abs(K3) + abs(K4)+ abs(K5) + abs(K6)+ abs(K7)+ abs(K8);
  123.         %matrix(x,y)= abs(3.*x.^3./(x.^3 + ( cos(y)./3))) + abs(y./(x.^3 + (cos(y))./3) .* ((3.*x.^3 - 2).*cos(y) - 6.*x.^3 + sin(y).^2 - 2.*y.*sin(y)+ cos(y).^2)./(6.*(y - sin(y)./2))) + abs(x.^3./(x.^3 + ( cos(y)./3))) + 2.*abs((cos(y)./3)./(x.^3 + cos(y)./3)) + 2.*abs((sin(y)./2)./(y - sin(y)./2)) + abs(1)+ abs(- 1) + abs(1);
  124.         matrix(x,y)= matrix(x,y)*eps;
  125.     end
  126. end
  127.  
  128. disp(matrix)
  129. disp('max value:')
  130. disp(max(matrix(:)))
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