miname

15 Reputation

2 Badges

11 years, 123 days

MaplePrimes Activity


These are answers submitted by miname

> restart;
> restart; with(stats); with(plots); with(RandomTools); with(RandomTools[MersenneTwister]);
> T[0] := 99;
> n := 3;
> bb := [seq(Generate(float(range = -1 .. 1, digits = 2)), i = 1 .. n+1)];
> b := [seq(Generate(float(range = -1 .. 1, digits = 2)), i = 1 .. n+1)];
> u := [seq(GenerateFloat(digits = 2), i = 1 .. n+1)];
> x[0] := 0;
> f := proc (x) options operator, arrow; 111+2*x^2+4*x end proc;
> for k to 22 do T[k] := .8*T[k-1]; for i to n do f(x[i-1]); f[i-1]; y[i] := x[i-1]+b[i]; f(y[i]); if f(y[i]) < f(x[i-1]) then x[i] := y[i]; s := s+1 elif u[i] <= exp(-(f(y[i])-f(x[i-1]))/T[k-1]) then x[i] := y[i] else x[i] := x[i-1] end if; x[i] end do end do

I have got an error and can't detect what is my mistake.

thanks for helping.

 

Page 1 of 1