Guest User

Untitled

a guest
Feb 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. for(int i = 0;i<Nx;i++)
  2. {
  3. wx[i+1]=wx[i]+hx;//массив
  4. wht[0][i]=fn(T,i*hx);//i*hx
  5. }
  6.  
  7. public:static double fn(int T,double x)//Функция Хэвисайда - Начальное условие(Граничное условие) а начальное 0-1
  8. {
  9. if (x>=0)
  10. return T;
  11. else if(x<0)
  12. return 0;
  13. }
  14.  
  15. for(int j = 0;j<Nt;j++)
  16. {
  17. for(int i = 0;i<Nx;i++)
  18. {
  19. wht[j+1][i]=((wht[j+1][i]-wht[j][i])/ht)+a*((wht[j][i+1]-wht[j][i])/hx);
  20. wht[j+1][i]=-a*(ht*(wht[j][i+1] + wht[j][i])/hx) + (wht[j][i]); /
  21. }
  22. }
Add Comment
Please, Sign In to add comment