Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(int i = 0;i<Nx;i++)
- {
- wx[i+1]=wx[i]+hx;//массив
- wht[0][i]=fn(T,i*hx);//i*hx
- }
- public:static double fn(int T,double x)//Функция Хэвисайда - Начальное условие(Граничное условие) а начальное 0-1
- {
- if (x>=0)
- return T;
- else if(x<0)
- return 0;
- }
- for(int j = 0;j<Nt;j++)
- {
- for(int i = 0;i<Nx;i++)
- {
- wht[j+1][i]=((wht[j+1][i]-wht[j][i])/ht)+a*((wht[j][i+1]-wht[j][i])/hx);
- wht[j+1][i]=-a*(ht*(wht[j][i+1] + wht[j][i])/hx) + (wht[j][i]); /
- }
- }
Add Comment
Please, Sign In to add comment