Advertisement
martaczaska

driver.m

May 10th, 2021
867
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.28 KB | None | 0 0
  1. % Lab 5.
  2. % Marta Trzaska 171632 SiSR
  3. clc;
  4.  
  5. %Dane
  6. E = 5; %[V]
  7. R = 50; %ohm
  8. L = 0.1; %[H]
  9. C = 1e-05; %[F]
  10. x_0 = [0;0];
  11.  
  12. t = 20e-03; %[ms]
  13. h_1 = 1e-06;
  14. h_2 = 1e-03;
  15.  
  16. %[u_C_h2, i_L_h2] = euler(x_0, t, h_2, C, L, E, R);
  17. %[u_C_h1, i_L_h1] = euler(x_0, t, h_1, C, L, E, R);
  18. [u_C_h2, i_L_h2] = euler(x_0, @funkcja, t, h_2, C, L, E, R);
  19. [u_C_h1, i_L_h1] = euler(x_0, @funkcja, t, h_1, C, L, E, R);
  20.  
  21. figure;
  22. plot([1:20001], u_C_h1);
  23. title('Wykres zależności u_{C} od czasu (dla h_{1}=0.001)');
  24. xlabel('t [ms]');
  25. ylabel('u_{C} [V]');
  26.  
  27. figure;
  28. plot([1:21], u_C_h2);
  29. title('Wykres zależności u_{C} od czasu (dla h_{2}=0.000001)');
  30. xlabel('t [ms]');
  31. ylabel('u_{C} [V]');
  32.  
  33. figure;
  34. plot([1:length(i_L_h1)], i_L_h1);
  35. title('Wykres zależności i_{L} od czasu (dla h_{1}=0.001)');
  36. xlabel('t [ms]');
  37. ylabel('i_{L} [mA]');
  38.  
  39. figure;
  40. plot([1:length(i_L_h2)], i_L_h2);
  41. title('Wykres zależności i_{L} od czasu (dla h_{2}=0.000001)');
  42. xlabel('t [ms]');
  43. ylabel('i_{L} [mA]');
  44.  
  45. figure;
  46. plot([1:length(u_C_h1)], i_L_h1);
  47. title('Wykres zależności i_{L} od u_{C} (dla h_{1}=0.001)');
  48. xlabel('u_{C} [V]');
  49. ylabel('i_{L} [mA]');
  50.  
  51. figure;
  52. plot([1:length(u_C_h2)], i_L_h2);
  53. title('Wykres zależności i_{L} od u_{C} (dla h_{2}=0.000001)');
  54. xlabel('u_{C} [V]');
  55. ylabel('i_{L} [mA]');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement