Skip to content

Commit

Permalink
vanderpol not in Octave, so hand written out with mu=1
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrzensk committed Aug 8, 2024
1 parent 01b7bc9 commit 25a2358
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples_MATLAB/van_der_pol.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

addpath('../mole_MATLAB')

% OCTAVE does not have VanDerPol equation, so here it is with Mu=1
vdpl = @(t,y) [y(2); (1 - y(1)^2) * y(2) - y(1)];

% func tspan dt y0
[t, y] = rk4(@vdp1, [0 20], .1, [2 0]);
[t, y] = rk4(vdpl, [0 20], .1, [2 0]);

plot(t, y(1, :), '-o', t, y(2, :), '-*')
title('Solution of van der Pol''s Equation');
Expand Down

0 comments on commit 25a2358

Please sign in to comment.