0

i have some initial state $psi[x,t]$. I perform some operation on it and store the value in another state $pi1[x,t]$. Now on the next step i have to use $psi1[x,t]$ as initial state and perform the functions again and store in $psi2[x,t]$, Please anybody help me how to use loops for this.

sam
  • 1
  • 2

1 Answers1

1

I think you might be looking for Nest or NestList as noted by Kuba.

NestList[someOperation, psi[x,t], 2]

gives

 {psi[x, t], someOperation[psi[x, t]], someOperation[someOperation[psi[x, t]]]}
pjc42
  • 733
  • 3
  • 13
  • i am looking for $operation[operation[operation[psi(x,t)]]]$, where $psi(x,t)$ is some initial function then i store the value of $operation[psi(x,t)]$ into $psi1(x,t)$. Later I have to use $psi1(x,t)$ as initial state and perform same operation as $operation[psi1(x,t)]$. I have to do it n times. – sam Apr 17 '14 at 16:19
  • yes you are right. I am looking for something this. Thank you very much – sam Apr 21 '14 at 16:50