Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdint>
- #include <iomanip>
- using namespace std;
- int main()
- {
- const double I_SAT = 7.55e-14;
- const double KTQ = 0.02585;
- double vol_max, vol_min, increament, vol_final,volt;
- int limit;
- cout << "Voltage (minimum): ";
- cin >> vol_min;
- cout << "Voltage (maximum): ";
- cin >> vol_max;
- cout << "Increament in voltage: ";
- cin >> increament;
- limit = (vol_max - vol_min) / increament;
- cout << "Voltage" << setw(10) << "I<A>"<<endl;
- for (int i = 0; i <= limit; i++)
- {
- volt = vol_min + i * increament;
- vol_final = I_SAT * (exp(volt/ KTQ) - 1);
- cout <<fixed<< setprecision(3) <<volt<<setw(15) <<scientific<< vol_final << endl;
- if (vol_final > 1)
- {
- double output = volt;
- cout << fixed <<"\nThe diode turn on voltage is " << output;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement