Quick Help

I've a lengthy program that calculates t_final and needs to do the following if statements that include an integral, I tried to attach a pic but i could not. Any clue. Note all parameters are defined in the code
1
2
3
4
5
6
7
8
9
                        double tc;
                        tc=dx*dx*ct*mio*phi/(16*_k1);
			if (t_final<tc)
			{
			Vp<<4*pai*h*t_final*_k1/(ct*mio)<<endl;
			else
			Vp<<4*pai*h*tc*_k1/(ct*mio)+ (integral of dv from 4*pai*h*tc*_k1/(ct*mio) to infinity) <<endl;
			return ;
			}
I can't tell what you want help with?
Is the following right ?

tc=dx[0]*dx[0]*ct*mio*phi/(16*_k1);
double finite_volume = dx[0]*dy[0]*dz[0]*nx*ny*nz;
if (t_final<=tc)
tmp=4*pai*h*t_final*_k1/(ct*mio);
else
tmp=4*pai*h*tc*_k1/(16*ct*mio)+ (finite_volume-16*pai*h*tc*_k1/(ct*mio));
Vp.push_back(tmp);
I have no idea, what formula are you trying to use? You can't just give us code and say "is this right?" because we have no idea what your conception of right and wrong is.
Topic archived. No new replies allowed.