Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <cmath>
  4. #include <algorithm>
  5. using namespace std;
  6.  
  7. double func(double U)
  8. {
  9.     return 0;
  10. }
  11.  
  12. int main()
  13. {
  14.     FILE* f1 = fopen("input.txt", "r");
  15.     FILE* f2 = fopen("output.txt", "w");
  16.     double Uv = 0.0;
  17.     double Uvih = 0.0;
  18.     double dt = 1.0;
  19.     double c = 1E-6;
  20.     double Io = 1E-13;
  21.     double R = 1E3;
  22.     double q = 1.6 * 1E-19;
  23.     double T = 298;
  24.     int t;
  25.     double k = 1.38 * 1E-23;
  26.     double con = k * T / q;
  27.     for (t = 1; t <= 10000; t+=1)
  28.     {
  29.         Uv = t*1.0;
  30.         Uvih = ((Uv - Uvih)/R - Io * (exp(Uvih/con) - 1))/c + Uvih;
  31.         fprintf(f2, "%d %f\n", t, Uvih);
  32.     }
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement