clear x
dt = 0.1;
tmax = 2;
time_steps = tmax/dt;

% Initial conditions
x(1) = 0.1;


for ii = 1:time_steps
    x(ii+1) = x(ii) + (3*(x(ii))^2 - 2*x(ii))*dt;
end
plot(x)


%% Second example

clear x y
dt = 0.1;
tmax = 10;
time_steps = tmax/dt;

% Initial conditions
x(1) = 1;
y(1) = 0;

for ii = 1:time_steps
    x(ii+1) = x(ii) + y(ii)*dt;
    y(ii+1) = y(ii) + (-x(ii))*dt;
end
plot(x,y)
axis equal






