hiddenGem

Starter Motor

Jun 17th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.22 KB | None | 0 0
  1. %% Starter Motor
  2. % Determines the electric charge passing through a motor, the current
  3. % density, and how far a charge travels while the motor is on.
  4.  
  5. % Inputs and Variables
  6. I = input('Electric current from battery in Amps\n');
  7. deltat = input('How long does the  motor run in seconds?\n');
  8. d = input('What is the diameter of the wire in meters?\n');
  9. n = input('What is the density of conduction for the wire?\n');
  10. if n == 0
  11.     disp('No given constant entered. Will not calculate distance traveled of a charge.');
  12. else
  13.     q = input('What is the charge traveling through the wire?\n');
  14. end
  15.  
  16. % Outputs and Equations
  17. Q = I * deltat;
  18. A = pi*(d^2)/4;
  19. j = I/A;
  20. fprintf('The amount of electric charge passes through the starter motor is %e C \n',Q);
  21. fprintf('The current density in the wire is %e A/m^2 \n', j);
  22. if n == 0
  23.     disp('Distance traveled of a charge will not be calculated.');
  24. else
  25.     deltax = (j*deltat)/(n*q);
  26.     fprintf('The distance traveled of the charge is %e m \n', deltax);
  27. end
  28.  
  29. %{
  30. Notice that there is no set constant. A given constant for the density of
  31.     conduction should be given to the user in the question.
  32. A common material for a wire is copper which the density of conduction is 8.50*10^28
  33. %}
Add Comment
Please, Sign In to add comment