Advertisement
DavidGB

Untitled

Dec 20th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. double MEuler(){
  2. double Cp = 0;
  3. for (int time = 0; time < (ultima_toma_min + toma_min); time ++){
  4. if (time % h == 0){
  5. cout << "Hora " << time / 60.0 << " - ";
  6. cout << setprecision(7) << "Cp: " << Cp << "\n";
  7. }
  8. Cp = nextY(h, Cp, time);
  9. }
  10.  
  11. return Cp;
  12. }
  13.  
  14. int Dt(int minutes){
  15. int result;
  16. if (minutes % (toma_min) == 0 && minutes > 0 && minutes <= 24 * 4 * 60)
  17. result = 250;
  18. else
  19. result = 0;
  20.  
  21. //cout << "hora " << hours << ":" << "Dt= " << result << endl;
  22.  
  23. return result;
  24. }
  25.  
  26. double nextY(double h, double y, double minutes){
  27. //cout << "dy = " << (Dt(hours) - Ke*y) / Vap << endl;
  28. return (y + (Dt(minutes) - Ke*y) / Vap);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement