Hi, I hope you can help me in this problem :
Compute the sum term solution : which . I don't need
alpha = 0.6;
p = 0;
S = 0;
p = p+1;
S = S+qnp*(U1-U2);
U = 0.5*(U2+S);
U1 = U2;
U2 = U;
The problem is
- when n=2 then p=1, qnp=, and S = S+qnp*(U1-U2)=0+()*(U1-U2)= ()*(U1-U2)
It's Correct , then overwrite U1=U2 (i write it u2) and U2=U ( i write it u3)
- When n=3 then p=2, qnp=, and S = S+qnp*(U1-U2) = ()*(U1-U2) + ()*(u2-u3).
It's not Correct because S = ()*(U1-U2) +()*(u2-u3) .
- When n=4, then p=3 and the sum term is exactly : S = S+qnp*(U1-U2) = +qnp*(u3-u4)
which u3 and u4 has overwrited.
So, How can i compute the sum correctly ?