Hi,
I have a simple for
loop that involves printing multiple statements. This material is for teaching, so I want to keep it intuitive and straightforward. The code below works in VSCode and Jupyter, but I do not know how to make it work in Pluto. I looked carefully at issue #245, but have not found a helpful way to overcome my problem. Some help would be very much appreciated.
MWE:
a = 0.75
b = -2.0
c = 1.0
tol = 1e-12
maxiter = 500
Fₙ = 0.0
for i = 1 : maxiter
# Updating rule
Fₙnew = -(1/(b + Fₙ * c)) * a
# Stopping rule:
if abs(a + b * Fₙnew + c * Fₙnew^2) < tol
println("convergence after $i iterations")
println("final value for F is $Fₙ")
break
end
Fₙ = copy(Fₙnew)
if i == maxiter
println("No convergence after $i iterations")
end
end