Question: Parallel in Loop

Hi,

I want to parallel the following code.it is good that part1 solved by one thread and part2 solved by other thread.

please help me.it must be noted that part1 and part 2 are independent "at each" iteration.

 

dtheta[m](x):= theta[m-1](x)+phi[m-1](x);
dphi[m](x):= theta[m-1](x)-2*phi[m-1](x);

for i from 2 by 1 to 10 do;

# part1

theta[i](x):=subs(m=i,dtheta[m](x)):
theta[i](x):=value(%):
eval(-theta[i](x),x=0);
theta[i](x)+theta[i-1](x)+value(%)*exp(-x):

#part 2

phi[i](x):=subs(m=i,dphi[m](x)):
phi[i](x):=value(%):
eval(-phi[i](x),x=0):
phi[i](x)+phi[i-1](x)+value(%)*exp(-x):

end do:

Please Wait...