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

Subject: ode

From: Frank

Date: 13 Dec, 2011 18:12:08

Message: 1 of 3

How to solve this equation in matlab
dy/dx=yx^2-y
y(0)=1
from x=0 to x=2
plot

Subject: ode

From: Roger Stafford

Date: 13 Dec, 2011 18:31:09

Message: 2 of 3

"Frank" wrote in message <jc84ho$6k2$1@newscl01ah.mathworks.com>...
> How to solve this equation in matlab
> dy/dx=yx^2-y
> y(0)=1
> from x=0 to x=2
> plot
- - - - - - - - -
  This is a very elementary problem in differential equations:

 x = linspace(0,2);
 y = exp(1/3*x.^3-x);
 plot(x,y)

Roger Stafford

Subject: ode

From: Nasser M. Abbasi

Date: 13 Dec, 2011 22:12:58

Message: 3 of 3

On 12/13/2011 12:12 PM, Frank wrote:
> How to solve this equation in matlab
> dy/dx=yx^2-y
> y(0)=1
> from x=0 to x=2
> plot

----------------
sol=dsolve('Dy = y*x^2 -y', 'y(0) = 1','x')
ezplot(sol,[0,2])
--------------------

exp((x*(x^2 - 3))/3)


--Nasser

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