Why isn't Omega Varying in the Duffing Equation Output?

  • Thread starter Thread starter adishpatel
  • Start date Start date
  • Tags Tags
    Output
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 2K views
adishpatel
Messages
22
Reaction score
0
Hi there,
I am trying to achieve a particular set of graphs based on duffing equation graphs which you can find here:
2ih2p3r.jpg


It shows a graph which is Amplitude (X(1)) vs. Omega graph. With the code that I have deduced and the formula used, I am able to see that X(1) is varying at every step, however the omega value isn't?

What might be wrong in there? I want it to vary as X changes at every step.

Code can be found at http://sysden.com/dufing.f

Here are the first 10 lines of my output:

1st column is omega, second is X(1), third is F(1) and fourth is F(2)


Code:
   2.0000000000000000        1.0203714984602674E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.0563376279129973E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.1078731279483987E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.1749503127865479E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.2575390789204062E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.3556069126132030E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.4691188981781366E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.5980377265090756E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.7423237040156399E-003   0.0000000000000000        0.0000000000000000     
   2.0000000000000000        1.9019347618415869E-003   0.0000000000000000        0.0000000000000000
 
Physics news on Phys.org
Why should omega change? You set it equal to 2 at the beginning of your program, and then don't change the value. By what magic would you expect it to be modified?

In the Duffing equation, ##x## is a function of ##t##, and ##\omega## is a parameter. The "amplitude" you are after is not defined. What does it mean? My guess is that you need to solve for ##x(t)## for a given ##\omega##, calculate something on that ##x(t)## to get the "amplitude", and repeat for different values of ##\omega##.

And by the way, there is not point in printing F(1) and F(2) in the main program, as you do not have access to those values, which are used internally by ODE2.