Salve a tutti, riscrivo qui perchè più di una volta, anche per domande relativamente stupide da parte mia, mi avete sempre aiutato molto. 
Questa apperentemente semplice funzione dovrebbe assegnare dei valori a un array bidimensionale. Il coefficiente per me importante è a_p perchè in una funzione che scriverò dopo sarà usato come denominatore, per cui è importante sia diverso da zero. Per verificare che valori mi assegna il codice ho posto a quel coefficente dei valori fissi ma per i=0 da j=1 tale valore risulta zero. Perchè?
Grazie mille
il codice è qui di seguito e può essere tranquillamente compilato
#include <stdio.h>
#include <math.h>
#include  <fstream>
#include <iostream>
using namespace std;
 double dt=1, delta=0.1, T_s=5;
 double T_i=8,x_1=0.5,y_1=0.4,y_2=0.7,x_3=1.1,y_3=0.8;
double rho_1=1500,cp_1=775,k_1=170,rho_2=1600,cp_2=770,k_2=140,rho_3=1900,cp_3=810,k_3=200,rho_4=2500,cp_4=930,k_4=140;
 double T_iso=23, Q=60, T_g=33, h_g=9;
const int Ny=80, Nx=110, Nt=10000;
const int Nx_1=50, Ny_1=40, Nx_2=60, Ny_2=70;
const double dx=x_3/(Nx-1), dy=y_3/(Ny-1);
void Coefficients (double k[Nx][Ny], double k_e[Nx][Ny],double k_w[Nx][Ny],double k_n[Nx][Ny],double k_s[Nx][Ny],
				  double rho[Nx][Ny],double cp[Nx][Ny],double est[Nx][Ny],double west[Nx][Ny],double north[Nx][Ny],
				  double south[Nx][Ny], double inf_vol[Nx][Ny], double a_e[Nx][Ny],double a_w[Nx][Ny],double a_n[Nx][Ny],double a_s[Nx][Ny],double b[Nx][Ny],double a_p[Nx][Ny],
				  double T_ant[200][200],double Tvar)
                  {
	
	double Q_unif;
	///internal nodes
    for (int i=1;i<Nx-1;i++){   
							for (int j=1;j<Ny-1;j++){												
													a_e[i][j]=est[i][j]*k_e[i][j]/dx;
													a_w[i][j]=west[i][j]*k_w[i][j]/dx;
													a_n[i][j]=north[i][j]*k_n[i][j]/dy;
													a_s[i][j]=south[i][j]*k_s[i][j]/dy;
													a_p[i][j]=5.;
													b[i][j]=24.;
                                                   							
							                    }
                          }
                int p; int z;      
   for ( z=0;z<Nx;z++){         //bottom
                            a_p[z][0]=73;
							a_e[z][0]=0;
							a_w[z][0]=0;
							a_n[z][0]=0;
							a_s[z][0]=0;
						                           
							b[z][0]=28;
                            
                            
	                  }
                      
	for (int j=1;j<Ny;j++){         //left
							
							a_e[0][j]=0.;
							a_w[0][j]=0.;
							a_n[0][j]=0.;
							a_s[0][j]=0.;
							a_p[0][j]=8.;
							b[0][j]=28.;
                    	}
	
	
	for (int j=1;j<Ny;j++){			//right
							a_e[Nx][j]=0.;
							a_w[Nx][j]=0.;
							a_n[Nx][j]=0.;
							a_s[Nx][j]=0.;
							a_p[Nx][j]=1.;
							b[Nx][j]=25.;
                    	}
	
	for (int i=1;i<Nx-1;i++){         //top
						
							a_e[i][Ny]=0.;
							a_w[i][Ny]=0.;
							a_n[i][Ny]=0.;
							a_s[i][Ny]=0.;
							a_p[i][Ny]=1.;
							b[i][Ny]=25.;
                            
							
										}
                                        
										
	for (int i=0;i<5;i++){
                        for (int j=0;j<5;j++){
                    			    
                    			
                                           // cout<<"valore di i "<<i<<" "<<endl;
                                          //  cout<<"valore di j "<<j<<" "<<endl;
 	                       				cout<<"ae:"<<a_e[i][j]<<" aw:"<<a_w[i][j]<<" an:"<<a_n[i][j]<<" as:"<<a_s[i][j]<<" ap:"<<a_p[i][j]<<" b:"<<b[i][j]<<endl;
 	                                   	}
	                   }
	
}
int main()
{
    double k[Nx][Ny],k_e[Nx][Ny],k_w[Nx][Ny],k_n[Nx][Ny],k_s[Nx][Ny],rho[Nx][Ny],cp[Nx][Ny];
	double x[Nx][Ny],y[Nx][Ny],inf_vol[Nx][Ny],est[Nx][Ny],west[Nx][Ny],north[Nx][Ny],south[Nx][Ny];
	double a_e[Nx][Ny],a_w[Nx][Ny],a_n[Nx][Ny],a_s[Nx][Ny],a_p[Nx][Ny],b[Nx][Ny];
	double T[Nx][Ny],T_cal[Nx][Ny],T_ant[200][200];
	double Tvar, t;
	int i,j;
	int l;
	
	for(l=0;l<5;l++)
	{
	Coefficients(k,k_e,k_w,k_n,k_s,rho,cp,est,west,north,south,inf_vol,a_e,a_w,a_n,a_s,b,a_p,T_ant,Tvar);
}
getchar();
getchar();
return 0;
}