Jump to content
Sign in to follow this  
ssofia

Duvida de implementaçao ODE equaçao de van der pol

Recommended Posts

ssofia

Ola a todos

Eu estou a tentar implementar uns scripts em matlab...e esta sempre a darM erro....e nao estou a perceber o que é, quer dizer é na equaçao mas nao estou a conseguir resolver....

Ou seja estou a implementar a a eq. Van der Pol para exportar 1 grafico com o comportamento da equaçoes - 4 equacoes ....

o A que representa a amplitude é um array com diferentes valores de amplitude medidos em 6 tempos para cada Oscilador.... o wt representa a frequencia natural que neste caso é 24h....

Espero que alguém me possa ajudar

Obrigado

___________________________________________________________________________________________

tspan=[0 100];
y0=[1 0 1 1];

global A1 A2 A3 wt

A1 = [0.000413401 , 0.0020457, 0.018875653, 0.008827253, 0.001098447, 0.00034614];
A2 = [0.005770291, 0.014026409, 0.01266695, 0.0032231, 0.000410485, 0.000287991];
A3 = [0.007822632, 0.005662967, 0.000258098, 0.000917877, 0.004825493, 0.007161058];

wt = 24;

[T,Y] = ode15s(@Month_3,[0 100],[1 0 1 1]);

plot(t,y(:,1),'-',t,y(:,2),'--',t,y(:,3),'.',t,y(:,4),'..')

title('Comportamento da Amplitude ao longo tempo');
xlabel('t');
ylabel('Amplitude');
legend('X','y(2)','Y','Z')

____________________________________________________________________________________________________

function dy = Month_3(t,y,A1,A2,A3,wt)


dy = zeros(4,1);  

dy(1) = y(2);

dy(2) = 0.03*(1 - y(1)^2)*y(2) - y(1) - A1 * sin(wt); % Comportamento Amplitude X

dy(3) = 0.03*(1 - y(3)^2)*y(2) - y(3) - A2 * sin(wt); % Comportamento Amplitude Y

dy(4) = 0.03*(1 - y(4)^2)*y(2) - y(4) - A3 * sin(wt); % Comportamento Amplitude Z

Edited by Rui Carlos
Formatação do código.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.