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:
dsolve

Subject: dsolve

From: Helmut

Date: 13 Jun, 2013 12:51:14

Message: 1 of 3

In Shampine et al. "Solving ODEs with MATLAB" (2003), p. 18, Exercise 1.1, an example from MATLAB (2000) "help dsolve" is cited:

>> Y = dsolve('(Dy)^2 + y^2 = 1', y(0) = 0')

with the correct solution

Y = [ sin(t) ]
      [ -sin(t) ]

Now, with Matlab 2012a student, for an identical input I get the solution

Y =
  cosh((pi*i)/2 + t*i)
  cosh((pi*i)/2 - t*i)
 
which seems to me to be wrong.

What should I do?
Helmut
 
  

Subject: dsolve

From: Alan_Weiss

Date: 13 Jun, 2013 13:10:20

Message: 2 of 3

On 6/13/2013 8:51 AM, Helmut wrote:
> In Shampine et al. "Solving ODEs with MATLAB" (2003), p. 18, Exercise
> 1.1, an example from MATLAB (2000) "help dsolve" is cited:
>
>>> Y = dsolve('(Dy)^2 + y^2 = 1', y(0) = 0')
>
> with the correct solution
>
> Y = [ sin(t) ]
> [ -sin(t) ]
>
> Now, with Matlab 2012a student, for an identical input I get the solution
>
> Y =
> cosh((pi*i)/2 + t*i)
> cosh((pi*i)/2 - t*i)
>
> which seems to me to be wrong.
>
> What should I do?
> Helmut
>
>

After getting this seemingly odd answer, try the following:

z = simplify(Y)

z =

  -sin(t)
   sin(t)

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: dsolve

From: Helmut

Date: 13 Jun, 2013 15:13:16

Message: 3 of 3

Alan_Weiss <aweiss@mathworks.com> wrote in message <kpcgbs$rl2$1@newscl01ah.mathworks.com>...
> On 6/13/2013 8:51 AM, Helmut wrote:
> > In Shampine et al. "Solving ODEs with MATLAB" (2003), p. 18, Exercise
> > 1.1, an example from MATLAB (2000) "help dsolve" is cited:
> >
> >>> Y = dsolve('(Dy)^2 + y^2 = 1', y(0) = 0')
> >
> > with the correct solution
> >
> > Y = [ sin(t) ]
> > [ -sin(t) ]
> >
> > Now, with Matlab 2012a student, for an identical input I get the solution
> >
> > Y =
> > cosh((pi*i)/2 + t*i)
> > cosh((pi*i)/2 - t*i)
> >
> > which seems to me to be wrong.
> >
> > What should I do?
> > Helmut
> >
> >
>
> After getting this seemingly odd answer, try the following:
>
> z = simplify(Y)
>
> z =
>
> -sin(t)
> sin(t)
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

Yes. Many thanks to you (and Euler)
Helmut

Tags for this Thread

No tags are associated with 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