Question: I want to write nested loop in Maple 2015


I hope everyone is fine here. I want to write the following nested loop in my code

restart; TOL := 10^(-3); v[i] := 10^(-4); u[i] := 10^(-4);
if abs(v[i]-1)<=TOL then    if abs(u[i])<=TOL then break    else t[i+1]:=t[i]+alpha; else; fi; fi;

it is not working. If the first condition (v[i]-1)<=TOL is fulfilled, then we have to check the second condition, u[i]<=TOL. That’s why I don’t use “and” here. If both conditions are fulfilled, then stop the loop and if second the condition not fulfilled (but first fulfill) then t[j+1]=t[j]+alpha. 

I shall be waiting for your positive response.

Please Wait...