Solving a Second Order Nonlinear Differential Equation with Matlab

  • MATLAB
  • Thread starter dmg_80
  • Start date
In summary: It's hard for you to try to do this problem on your own because you don't have enough time to study the documentation and you don't understand English very well? It sounds like the advice I gave you would be very valuable if you would only take it.
  • #1
dmg_80
5
0
someone helps me please!

Hello all,

This is the first time I've 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...
thanks
 
Physics news on Phys.org
  • #2
If you wanted to know how to solve that equation, I could tell you. Unfortunately, I know nothing about using Matlab.
 
  • #3
HallsofIvy said:
If you wanted to know how to solve that equation, I could tell you. Unfortunately, I know nothing about using Matlab.

Thank you...but i have to solve this problem only using matlab...
 
  • #4
Hey

First you need to transform your problem to a system of (two) first order differential equations by the substitution
[tex]x_{1}=x[/tex]
and
[tex]x_{2}=x'[/tex]

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)
xprim=[x_2;f(x)]​

When try to use the function ode45 or some other solver to solve problem.
and use plot to plot the result
 
  • #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:
 
  • #6
dmg_80 said:
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:

Let me give you some invaluable advice: read the Matlab documentation. It's superb, and explains in detail how to approach such basic problems.
 
  • #7
shoehorn said:
Let me give you some invaluable advice: read the Matlab documentation. It's superb, and explains in detail how to approach such basic problems.

Thank you for your "invaluable advice"...:rolleyes:
 
  • #8
dmg_80 said:
Thank you for your "invaluable advice"...:rolleyes:

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.
 
  • #9
shoehorn said:
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.


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

FAQ: Solving a Second Order Nonlinear Differential Equation with Matlab

Who can help me?

There are many people who may be able to help you depending on your specific needs. You could reach out to a friend, family member, teacher, therapist, or even a support hotline for assistance.

How can someone help me?

Someone can help you by listening to your concerns, offering advice or guidance, providing emotional support, or even assisting with practical tasks. The type of help you need will determine how someone can best support you.

Is it okay to ask for help?

Yes, it is absolutely okay to ask for help. In fact, reaching out for support is a sign of strength and self-awareness. It takes courage to acknowledge when we need assistance, and it is important to remember that we all need help at times.

What should I do if no one is willing to help me?

If you are struggling to find someone who is willing to help you, try reaching out to a professional or a support group. There are also many online resources and helplines available that can offer assistance and support.

How can I help myself?

There are many ways you can help yourself, such as practicing self-care, seeking therapy or counseling, setting boundaries, and finding healthy coping mechanisms. It is also important to reach out for support when needed and to not be too hard on yourself. Remember that self-help is a journey and it is okay to ask for help along the way.

Similar threads

Replies
1
Views
2K
Replies
1
Views
2K
Replies
3
Views
4K
Replies
10
Views
2K
Replies
8
Views
2K
Replies
2
Views
3K
Replies
5
Views
2K
Back
Top