Course Solutions Uncategorized (Solved) : Modify Code Question Include Include Int Main Void File Fileout Int Ix Iy Nt Double Newv 3 Q38038770 . . . .

(Solved) : Modify Code Question Include Include Int Main Void File Fileout Int Ix Iy Nt Double Newv 3 Q38038770 . . . .

 

Modify this code for question:

#include <stdio.h>

#include <math.h>

int main(void)

{

FILE * fileout;

int ix,iy,it,Nt;

double newV[31][21],V[31][21],x,dx,y,dy;

fileout=fopen(“buckbeak.dat”,”w”);

printf(“nEnter number of iterations “);

scanf(“%d”,&Nt);

dx=0.10;

dy=0.10;

  

for(iy=0; iy<21; iy=iy+1)

{

for(ix=0; ix<31; ix=ix+1)

{

V[ix][iy]=0.0;

}

}

iy=20;

for (ix=0;ix<31; ix=ix+1)

   {

   V[ix][iy]=8.0;

   }

for (it=0; it<Nt;it=it+1)

{

for(iy=1; iy<20;iy=iy+1)

{

for(ix=1;ix<30; ix=ix+1)

{

newV[ix][iy]=0.25*(V[ix+1][iy]+V[ix-1][iy]+V[ix][iy+1]+V[ix][iy-1]);

}

}

for (iy=1; iy<20; iy=iy+1)

{

for(ix=1; ix<30; ix=ix+1)

{

V[ix][iy]=newV[ix][iy];

}

}

  

}

for (iy=0;iy<21;iy=iy+1)

{

y=dy*iy;

for (ix=0;ix<31;ix=ix+1)

{

x=dx*ix;

fprintf(fileout,”n %8.4lf %8.4lf %8.4lf”,x,y,V[ix][iy]);

}

fprintf(fileout,”n”);

}

printf(“n V at box center %12.6lf”, V[15][10]);

fclose(fileout);

printf(“n”);

return 0;

}

*** Question: Modify your Laplace code above to do a finger gridof points inside the box: dx=dy=0.01.

***** please help!!! and only help if you know how to do it toyour best capability. please show all work and write neat and clearfor me to follow what you are saying. Please answer all questionsand explain the answers

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post