Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7858759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:35:26+00:00 2026-06-02T21:35:26+00:00

I have a question about NDSolve function in Mathematica. I have an oscillator defined

  • 0

I have a question about NDSolve function in Mathematica.
I have an oscillator defined by these two equations:

x' = v
v' = -x - u*v^3

where u is some constant.

How to create an NDSolve that resolves this? I tried following code (it has to depend on time) but it doesnt work:

eq1 = x'[t] == v;
eq2 = v' == -x[t] - u*v^3;
eq3 = x[0] == 2;

(initial displacement is 2m).

s = NDSolve[{eq1, eq2, eq3}, x, {t, 0, 30}]

Thank you very much…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:35:27+00:00Added an answer on June 2, 2026 at 9:35 pm

    You need to observe that the first equation once differentiated with respect to t can be used to substitute for v[t]. But then the second equation becomes a ODE of second order and requires to be supplied with another extra initial condition. We will give

    v[0]==x'[0]==some number
    

    Then after solving this ODE for x you can recover v[t]==x'[t]
    I give you the solution in term of a Manipulate so that geometrically the situation becomes clear to you.

    (* First equation *)
    v[t] = x'[t];
    (* 
       Differentiate this equation once and substitute 
       for v[t] in the second equation
    *)
    Manipulate[
    With[{u = Constant, der = derval}, 
         res = NDSolve[{x''[t] == -x[t] - u*x'[t]^3, x[0.] == 2,x'[0.] == der},
         x, {t, 0., 30.}] // First; 
         Plot[Evaluate[{x[t], v[t]} /. res], {t, 0, 30}, PlotRange -> All,
         Frame -> True,Axes -> None, ImageSize -> 600]
       ],
    {{Constant, 0.,TraditionalForm@(u)}, 0.,3, .1},
    {{derval, -3., TraditionalForm@(v[0] == x'[0])}, -3, 3, .1}
    ]
    

    enter image description here

    Hope this helps you but next time before you ask you need to brush up the theory first as you can see the question you asked concerns very basic and elementary Mathematics not Mathematica programming. Good luck!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question about how to set up the relations between two models
I have question about database optimizing, indexing. I have table that called projects and
i have question about two different Bundle object in below methods : onSaveInstanceState(Bundle outState);
I have a question about how to present some structured data using HTML. I
Have a question about typedef in C. I have defined struct: typedef struct Node
i have a question about fopen() and base64 comunication. The scenario is that: i
I have question about global variable in Objective-C. I have two .m files :
I'm learning asp.net. I have question about example buttons I can use two types
Have a question about full text search. I have a query that works, but
I have a question about local classes in Java (classes that declares in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.