Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Diff Solution for D2(y) = 20*sin(y) - 200

Subject: Diff Solution for D2(y) = 20*sin(y) - 200

From: amadeo constantine

Date: 23 Nov, 2010 16:18:04

Message: 1 of 4

Hi Matlabers,

I have problem on second order differential equation.
D2(y) = 20*sin(y) - 200

where D2(y) is second order diff of Y where Dy = dy/dt
I try to use this:
Q = dsolve('D2y = -20*sin(y) - 200, 'y(0) = 0','Dy(0) = 0','t')
but it doesn't work because of sin(y).

Please give enlightment, Thanks.

Amadeo

Subject: Diff Solution for D2(y)

From: Nasser M. Abbasi

Date: 23 Nov, 2010 16:39:01

Message: 2 of 4

On Nov 23, 8:18 am, "amadeo constantine" <amadeoconstant...@gmail.com>
wrote:
> Hi Matlabers,
>
> I have problem on second order differential equation.
> D2(y) = 20*sin(y) - 200
>
> where D2(y) is second order diff of Y where Dy = dy/dt
> I try to use this:
> Q = dsolve('D2y = -20*sin(y) - 200, 'y(0) = 0','Dy(0) = 0','t')
> but it doesn't work because of sin(y).
>
> Please give enlightment, Thanks.
>
> Amadeo

this is non-linear DE (see the sin(y) term). Use your favorite
numerical solver on it. These are hard to do analytically.

--Nasser

Subject: Diff Solution for D2(y) = 20*sin(y) - 200

From: Walter Roberson

Date: 23 Nov, 2010 20:28:24

Message: 3 of 4

On 10-11-23 10:18 AM, amadeo constantine wrote:

> I have problem on second order differential equation.
> D2(y) = 20*sin(y) - 200
>
> where D2(y) is second order diff of Y where Dy = dy/dt I try to use this:
> Q = dsolve('D2y = -20*sin(y) - 200, 'y(0) = 0','Dy(0) = 0','t')
> but it doesn't work because of sin(y).

y(t) = RootOf( int(+/- 1/2/(10*cos(A)-100*A-10)^(1/2),A = 0 to Z) + t)

That is, y(t) is the value Z such that t plus a certain integral from 0 to Z,
becomes 0. The positive and negative of the integral are both solutions. The
integral itself is independent of y and of t.

The Maple command that I used for this was,

dsolve({diff(y(t),t,t) = -20*sin(y(t)) - 200, y(0) = 0,D(y)(0) = 0}) ;

Notice the change from sin(y) to sin(y(t)).

The term (10*cos(A)-100*A-10)^(1/2) is imaginary for all positive A, so only
negative A (and thus only negative Z) need be considered if you are looking
for real solutions.

Subject: Diff Solution for D2(y) = 20*sin(y) - 200

From: Roger Stafford

Date: 23 Nov, 2010 21:20:05

Message: 4 of 4

"amadeo constantine" <amadeoconstantine@gmail.com> wrote in message <icgpfs$r41$1@fred.mathworks.com>...
> Hi Matlabers,
>
> I have problem on second order differential equation.
> D2(y) = 20*sin(y) - 200
>
> where D2(y) is second order diff of Y where Dy = dy/dt
> I try to use this:
> Q = dsolve('D2y = -20*sin(y) - 200, 'y(0) = 0','Dy(0) = 0','t')
> but it doesn't work because of sin(y).
>
> Please give enlightment, Thanks.
>
> Amadeo
- - - - - - - - - -
  There are some tricks you can play with this differential equation. Call v = dy/dt. Then

 d^2y/dt^2 = dv/dt = dv/dy*dy/dt = dv/dy*v = 1/2*d(v^2)/dy = 20*sin(y)-200

 v^2 = int(40*sin(y)-400,'y') = -40*cos(y)-400*y+C

The initial conditions imply that C = 40, giving

 v^2 = 40*(1-cos(y))-400*y = 80*sin(y/2)^2-400*y

It is clear that with increasing t the quantity y must become negative and therefore v = dy/dt must initially become negative. Hence

 v = dy/dt = -sqrt(80*sin(y/2)^2-400*y) for t >= 0

 dt/dy = -1/sqrt(80*sin(y/2)^2-400*y)

 t = int(-1/sqrt(80*sin(yy/2)^2-400*yy),'yy',0,y) =
     int(1/sqrt(80*sin(yy/2)^2-400*yy),'yy',y,0)

where yy is the dummy integration variable for y, and where the y lower limit of integration is negative.

  Thus the elapsed t can be obtained as a function of y provided this integral can be evaluated. It has a square root type singularity at y = 0, but the integral would nevertheless be finite. An appropriate change of variable could avoid the singularity. I don't know an explicit form for this integral but presumably it can be evaluated numerically for various values of y (with perhaps the aforementioned change of variable.)

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us