Advertisement
hiddenGem

Charge in a Parallel Plate Capacitor

Jun 9th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.87 KB | None | 0 0
  1. %% Charge in a Parallel Plate Capacitor
  2. % This code will determine the charge and additional charge of a
  3. % parallel plate capacitor. Notes and clarification are found at the
  4. % bottom.
  5.  
  6. % Constants
  7. E = 8.85*10^-12
  8.  
  9. % Inputs and Variables
  10. SA = input('What is the surface area in m^2?\n');
  11. d = input('What is the plate separation in meters?\n');
  12. V = input('Voltage from the battery?\n');
  13. % Optional variable for additional charge
  14. Er = input('What is the relative permittivity?\n');
  15.  
  16. % Equations and Outputs
  17. C = E*SA/d;
  18. q = C*V;
  19. qAdd = q*(Er-1);
  20. fprintf('The charge stored is %e and the addition charge is %e', q, qAdd);
  21.  
  22. %{
  23. The relative permittivity is an additional variable that is not needed to
  24. calculate the charge stored.
  25. Plugging in a 1 will result in additional charge to be 0 and plugging in a
  26. 2 will result in the same answer for additional charge.
  27. %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement