Write in Microsoft Visual Studio 2017. Use Basic/Beginner C++ Skills. Rectifiers
ID: 3745651 • Letter: W
Question
Write in Microsoft Visual Studio 2017. Use Basic/Beginner C++ Skills.
Rectifiers (tube or solid state) are used to convert AC current to DC current. In the core there are two concentric cylinders (cathode and anode). The inner is called cathode (radius r) and the outer is called anode (radius r2) The cathode is a heater with small amount of thorium coating its surface. When voltage is applied to the heater electrons become excited and travel to anode. Cathode Anode Rectifier Tube Write a CC program to calculate the approximate time for electrons to travel from cathode to anode of a rectifier tube. This time can be calculated from the following expression g 3 10 42 216 where time -time for electron to travel from cathode to anode in seconds h of the electron 1.60206e-19 coulombs) m-mass of the electron 9.1083e-31 kilograms) v= accelerating voltage in volts r-radius of the inner tube (cathode) in meter r2-radus of the outer tube (anode) in meter :-natural logarithm of r2 T1 ( Z-in (r2/r1) ) Define q and mas constants after the preprocessor directives of the program. The program should read the values of v, ri, and r from the keyboard. The program should then calculate z and time and print the values of v, r2, and time to the screen. Test the program for v- 10volts, r-2mm and r- 4mm.Explanation / Answer
ScreenShot
-------------------------------------------------------------------
Program
#include "stdafx.h"
//Header files for I/O
#include<iostream>
#include<string>
using namespace std;
//Constant declaration
const double q=1.60206e-19;
const double m=9.1083e-31;
//Function prototype
double calculateTime(double, double, double);
int main()
{
//Variables for input
double v, r1, r2;
//Prompting for v,r1,r2
cout << "Enter the accelerating volatage in volts: ";
cin >> v;
cout << "Enter the radius of the inner tube(Cathode) in meter: ";
cin >> r1;
cout << "Enter the radius of the outer tube(Anode) in meter: ";
cin >> r2;
//Call function to calculate time
double t=calculateTime(v,r1,r2);
//Display result
cout << "Accelerating Voltage = " << v << "v" << endl;
cout << "Cathode Radius = " << r1 << "m"<< endl;
cout << "Anode Radius = " << r2 << "m" << endl;
cout << "Approximate time for electrons travel from cathode to anode of a rectifier tube= " << t << endl;
return 0;
}
double calculateTime(double v, double r1, double r2) {
double z = log(r1 / r2);
return (z*r1*(sqrt((2 * m) / (q*v)))*(1 + (z / 3) + (pow(z, 2 / 10) + (pow(z, 3) / 42) + (pow(z, 4) / 216))));
}
----------------------------------------------------
Output
Enter the accelerating volatage in volts: 10
Enter the radius of the inner tube(Cathode) in meter: 2
Enter the radius of the outer tube(Anode) in meter: 4
Accelerating Voltage = 10v
Cathode Radius = 2m
Anode Radius = 4m
Approximate time for electrons travel from cathode to anode of a rectifier tube= -2.60482e-06
Press any key to continue . . .
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.