%% Script for non-linear P-Q model



Q0 = 0;
V0 = 1;

y0 = [V0; Q0];

tspan = linspace(0,1,1000);

    % Set numerical accuracy options for ODE solver
options = odeset('RelTol', 1e-08, 'AbsTol', 1e-08, 'MaxStep', 0.01);

[t,N]=ode15s(@(t,y) PASM(t,y), tspan, y0, options);
for i =1:length(N)
[v(i),q(i),A(i),P(i)]=PASM1(t(i),N(i,:));
end

plot(t,P)