problem Derivative in C++

I have a project for school and the teacher gave us an old book, in which is the program needed is: Elliptic equations. Finite difference method.I tried to write the code in c++ from that old language. I expect it to be with errors. The problem is that I am a begginer and I tried to look on the internet but I can't find a method in c++ that I understand.

I don't know how to write the functions.
Example: u-ecuation solution
d^2u/dx^2+d^2u/dy^2=4;
u(0,y)=y^2;
u(1,y)=1+y^2;
u(x,0)=x^2;
u(x,1)=x^2+1;
h=k=1/4;

It would be a great help if someone can tell me what is missing.

 ``1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950`` `````` Put the code you need help with here. #include #include #include #include using namespace std; //functions? int main(){ float U[100][100],F[100],x; int i,j,m,n,a,k; ifstream f("Text.txt"); f>>n; for(i=1;i<=n;i++) for(j=1;j<=i;j++) f>>U[i][j]; for(i=1;i<=n;i++) f>>F[i]; for(j=1;j<=n;j++){ U[1][j]=0; U[j][1]=0; U[n][j]=0; m=n-1; for(k=1;k<=n;k++){ a=m; x=(k-1)/a; F[k]=x*(1-x)/2; } for(i=2;i<=m;i++){ U[i][2]=(F[i-1]+F[i+1])/2; } for(j=2;j<=m;j++){ for(i=2;i<=m;i++){ U[i][j+1]=U[i-1][j]+U[i+1][j]-U[i][j-1]; } } } for(i=1;i<=n;i++,cout<<" "){ for(j=1;j<=n;j++){ cout<
Topic archived. No new replies allowed.