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

  • Thread starter Thread starter adishpatel
  • Start date Start date
  • Tags Tags
    Output
Click For Summary
SUMMARY

The discussion centers on the issue of omega remaining constant in the output of the Duffing equation simulation. The user has set omega to a fixed value of 2 at the start of their program and does not modify it thereafter, leading to the observed lack of variation. To achieve varying omega values, the user must implement a loop that recalculates omega for each step based on the corresponding amplitude derived from the function x(t). Additionally, the output of F(1) and F(2) is unnecessary as these values are not accessible in the main program.

PREREQUISITES
  • Understanding of the Duffing equation and its parameters
  • Familiarity with numerical methods for solving ordinary differential equations (ODEs)
  • Proficiency in programming, particularly in a language suitable for numerical simulations
  • Knowledge of amplitude calculations in dynamic systems
NEXT STEPS
  • Implement a loop in your code to vary omega based on the calculated amplitude from x(t)
  • Learn about numerical methods for solving ODEs, specifically focusing on the ODE2 algorithm
  • Research how to define and calculate amplitude in the context of the Duffing equation
  • Explore debugging techniques for numerical simulations to ensure accurate output
USEFUL FOR

Researchers, physicists, and engineers working with dynamic systems, particularly those interested in the Duffing equation and numerical simulations of nonlinear oscillators.

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
 
Technology 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.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
8K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 1 ·
Replies
1
Views
6K