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

  • Thread starter Thread starter adishpatel
  • Start date Start date
  • Tags Tags
    Output
AI Thread 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
What percentage of programmers have learned to touch type? Have you? Do you think it's important, not just for programming, but for more-than-casual computer users generally? ChatGPT didn't have much on it ("Research indicates that less than 20% of people can touch type fluently, with many relying on the hunt-and-peck method for typing ."). 'Hunt-and-peck method' made me smile. It added, "For programmers, touch typing is a valuable skill that can enhance speed, accuracy, and focus. While...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Back
Top