Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global alfa;
- global beta;
- global gamma;
- global miu;
- global h;
- alfa = 3.3;
- beta = 1.5;
- gamma = 1.3;
- miu = 0.05;
- h = 4;
- maxx = 5;
- maxy = 5;
- [x,y] = meshgrid(linspace(0,maxx,20), linspace(0,maxy,20));
- dx = (alfa./(1+y**h))-(miu*x);
- dy = (beta*x)-(gamma*y);
- opt = odeset('RelTol', 1e-9', 'AbsTol', 1e-9);
- maxT = 1000;
- v0 = 0.7;
- p0 = 0.1;
- sol1 = ode45(@bialko,[0,maxT],[v0;p0], opt);
- p1 = 0.15;
- sol2 = ode45(@bialko,[0,maxT],[v0;p1], opt);
- p2 = 0.2;
- sol3 = ode45(@bialko,[0,maxT],[v0;p2], opt);
- figure(1);
- clf;
- quiver(x,y,dx,dy, 'AutoScale', 'on');
- hold on;
- plot(sol1.y(1,:), sol1.y(2,:),'r', sol2.y(1,:), sol2.y(2,:),'m', sol3.y(1,:), sol3.y(2,:),'k', 'LineWidth', 2);
- xlim([0,maxx]);
- ylim([0,maxy]);
- str_title = 'parametry: alfa: %d beta: %d gamma: %d miu: %d h: %d \nv0: %d p0: %d p1: %d p2: %d';
- str = sprintf(str_title, alfa, beta, gamma, miu, h, v0, p0, p1, p2);
- title(str);
- legend("pole wektorowe", "trzecia", "druga", "pierwsza")
- hold off
- print figure3.pdf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement