Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Someone helps me please

  1. May 26, 2008 #1
    someone helps me please!!

    Hello all,

    This is the first time Ive stumbled across this site, but it appears to be extremely helpful. I am an elettronic engineering grad student, and in my research, I have run across the following 2nd order non linear differential equation. It is of the form:

    x'' + x = sinwt + s(x)

    where s(x) = abs(5*x+1)-abs(5*x-1) (saturation)
    and t=(0 2000)
    and w=[0:0.001:2.^0.5] (it's a variable )

    My questions are :
    1) How can I write and solve this problem using Matlab ?
    2) How can I plot this differential equation as a function of w ?
    after the plot, How can I find the max Local (Relative) Maxima and put these results in another graph always considering them as a function of w ?

    I hope there's someone who helps me...
  2. jcsd
  3. May 27, 2008 #2


    User Avatar
    Science Advisor

    If you wanted to know how to solve that equation, I could tell you. Unfortunately, I know nothing about using Matlab.
  4. May 28, 2008 #3
    Thank you....but i have to solve this problem only using matlab...
  5. May 28, 2008 #4

    First you need to transform your problem to a system of (two) first order differential equations by the substitution

    You will then get a problem of the type
    [tex]x'_{1}=x_{2}, x'_{2}=f(x) [/tex]

    After that create a m-file containing

    function xprim=xprim(t,x)

    When try to use the function ode45 or some other solver to solve problem.
    and use plot to plot the result
  6. Jun 18, 2008 #5
    I have another problem :
    I have to find, after solving that differential equation,a vector based only with the maximum values of its results...After that i have to plot this vector as a fuction of w...how can i do that ? :confused:
  7. Jun 18, 2008 #6
    Let me give you some invaluable advice: read the Matlab documentation. It's superb, and explains in detail how to approach such basic problems.
  8. Jun 18, 2008 #7
    Thank you for your "invaluable advice"...:uhh:
  9. Jun 18, 2008 #8
    You're enrolled in an electronic engineering graduate programme but are incapable of using the detailed examples given by typing 'doc ode45'? Sounds like the advice I gave you really would be invaluable if only you'd take it.

    Ninety-five percent of the time, a question about Matlab is answered in the Matlab documentation. For instance, precisely all of your questions are answered, with examples, in the documentation. Use it. It'll give you a better answer than anyone here can.
  10. Jun 18, 2008 #9

    it's hard for me twice : first of all i haven't time to study all the Matlab documentation and second i'm an italian girl that not understand english very well..i'm trying to do it by myself...trying to traslate all i read...so please don't kidding me ...
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook