Created
November 1, 2021 05:25
-
-
Save rakaar/1cd5a25a694a048dae3ff8e2ed95b7b0 to your computer and use it in GitHub Desktop.
ABC flow 2 D
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function abc | |
[x,y] = meshgrid(linspace(0,100), linspace(0,100)); | |
dx_dt = cos(x); | |
dy_dt = 1 + sin(x); | |
figure(1) | |
quiver(x,y, dx_dt, dy_dt, 1, 'color',[0 0 0]); | |
grid | |
figure(2) | |
[t,r] = ode23(@diffeqn_abc,[0 100],[50 50]); | |
plot(r(:,1), r(:,2)); | |
grid | |
figure(3) | |
[t,r] = ode23(@diffeqn_abc,[0 100],[1 1]); | |
plot(t, r(:,1)); | |
grid | |
figure(4) | |
[t,r] = ode23(@diffeqn_abc,[0 100],[1 1]); | |
plot(t, r(:,2)); | |
grid | |
end | |
function result = diffeqn_abc(t,r) | |
% r(1) = x, r(2) = y | |
result = zeros(2,1); | |
result(1) = cos(r(2)); | |
result(2) = 1 + sin(r(1)); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment