problems with for loop
Posted: Tue Mar 08, 2016 11:21 am
Hello,
Would you look through my code, please. the program is not working from this line "equation equ!j.ls u{!j-1} c u!j(-1)". How can I solve this part "u{!j-1}?
Thanks in advance.
Miga.B
Would you look through my code, please. the program is not working from this line "equation equ!j.ls u{!j-1} c u!j(-1)". How can I solve this part "u{!j-1}?
Code: Select all
create u 54
series y0=nrnd
series a0=nrnd
equation eqy0.ls y0 c a0
eqy0.makeresids u0
for !j=1 to 10
equation equ!j.ls u{!j-1} c u!j(-1)
series y!j = y{!j-1} -y{!j-1}(-1)*equ!j.@coef(2)
series a!j = a{!j-1} -a{!j-1}(-1)*equ!j.@coef(2)
smpl @first @first
series y!j = y{!j-1}*(1-equ!j.@coef(2)^2)^0.5
series a!j = a{!j-1}*(1-equ!j.@coef(2)^2)^0.5
smpl @all
equation eqy!j.ls y!j c a!j
eqy!j.makeresids u!j
equation equ{!j+1}.ls u!j c u!j(-1)
if equ!j.@coef(2) - equ{!j-1}.@coef(2)<0.05 then
exitloop
endif
nextMiga.B