• Remix
  • Share
  • New Entry

on 9 Oct 2024
  • 10
  • 94
  • 0
  • 0
  • 741
Cite your audio source here (if applicable): https://pixabay.com/sound-effects/atmosphere-sound-effect-239969/
drawframe(1);
Write your drawframe function below
function drawframe(i)
% Parameters for the Rossler attractor
a = 0.3;
b = 0.2;
c = 9.7;
% Define the Rossler system of equations
rossler = @(t, y) [-y(2) - y(3);y(1) + a * y(2);b + y(3) * (y(1) - c)];
% Initial conditions
y0 = [1; 1; 1];
% Time span for the simulation
tspan = [0 1000];
% Solve the differential equations using ode45
[t, sol] = ode45(rossler, tspan, y0);
% color = [0.0, 1.0, 1.0;1.0, 0.0, 1.0;1.0, 1.0, 0.0;1.0, 0.647, 0.0;0.196, 0.804, 0.196];
color = repmat({'#FAFAFA' '#F5F5F5' '#EEEEEE' '#7D7C7D' '#4A4A4A' '#5B5B5B' '#747475'},1,4);
numColors = size(color,2);
% Create a figure for the animation
persistent fig h
if isempty(fig) || ~isvalid(fig)
fig = figure('Color', 'k');
plot3(sol(:,1), sol(:,2), sol(:,3), 'w', 'LineWidth', 0.1);
hold on;
for idx = 1:numColors
% h(idx) = plot3(sol(1,1), sol(1,2), sol(1,3), 'k', 'LineWidth', 3,'Color',color(idx,:));
h(idx) = plot3(sol(1,1), sol(1,2), sol(1,3), 'k', 'LineWidth', 1,'Color',color{idx});
end
title('Rossler Attractor');
axis off;
view(-10, 20);
end
j = mod(i*8+(1:100)'+200*(1:numColors),length(t))+1;
for idx = 1:numColors
set(h(idx), 'XData', sol(j(:,idx),1), 'YData', sol(j(:,idx),2), 'ZData', sol(j(:,idx),3));
drawnow;
end
end
Movie
Audio
Remix Tree