Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 50 lines (34 sloc) 1.02 KB
% function omegout = coupleN0(omega,g,gext)
% function omegout = coupleN0(omega,g,gext)
% Similar to coupleN, but for global coupling with variable coupling coeffs
% includes a coupling matrix g(cloop,omloop)
function omegout = coupleN0(omega,g,gext)
[dum,N] = size(omega);
mnomega = 1.0;
options = odeset('AbsTol',1e-3);
y0 = omega;
tspan = [0 400];
[t,y] = ode45(@f5,tspan,y0);
[sy,dum] = size(y);
y1 = y(40,:);
tspan = [0 400];
[t,y] = ode45(@f5,tspan,y1);
for omloop = 1:N
[m(omloop),b(omloop)] = linfit(t,y(:,omloop));
w(omloop) = mnomega + m(omloop);
% disp(strcat('Freq',num2str(omloop),' = ',num2str(m(omloop))))
end
omegout = m;
function yd = f5(t,y)
for omloop = 1:N
temp = omega(omloop);
for cloop = 1:N
temp = temp + g(cloop,omloop)*sin(y(cloop)-y(omloop)) - gext*sin(y(omloop));
end
yp(omloop) = temp;
end
for omloop = 1:N
yd(omloop,1) = yp(omloop);
end
end % end f5
end % end vandpol