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
The discussion focuses on issues related to generating graphs based on the Duffing equation, specifically the relationship between amplitude (X(1)) and omega (ω). The user reports that while X(1) varies with each step, ω remains constant at the initial value of 2, leading to confusion about the expected output. The response clarifies that ω is set as a constant parameter in the program and does not change unless explicitly modified in the code. It emphasizes that in the context of the Duffing equation, X is a function of time, while ω is a parameter that should be varied across different simulations to observe changes in amplitude. Additionally, it points out that printing values of F(1) and F(2) is unnecessary since they are not accessible in the main program. The discussion highlights the need for a clearer understanding of how to manipulate parameters to achieve the desired graph outputs.
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.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 7 ·
Replies
7
Views
8K
  • · Replies 8 ·
Replies
8
Views
3K
  • · 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
1K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 1 ·
Replies
1
Views
6K