## first time using matlab, how can i use solve to find the equilibrium solutions of the differential equation, y` = -( 3 - y ) y

Asked by Mike Randy

### Mike Randy (view profile)

on 9 Sep 2013

first time using matlab, how can i use solve to find the equilibrium solutions of the differential equation, y` = -( 3 - y ) y

## Products

No products are associated with this question.

### the cyclist (view profile)

Answer by the cyclist

### the cyclist (view profile)

on 9 Sep 2013

I would not use solve(). I would try ode45() to start.

```doc ode45
```

for details and examples.

### Roger Stafford (view profile)

Answer by Roger Stafford

### Roger Stafford (view profile)

on 9 Sep 2013

Why bother using matlab when elementary differential equations techniques will easily give the solution:

` y = 3/(1+k*exp(3*x))`

for arbitrary constant k and with x the independent variable.

Youssef Khmou

### Youssef Khmou (view profile)

on 10 Sep 2013

Roger, can you add some details about how you obtained the solution ( explaining the variables separation ) because i think it is :

` y=3/(1-k*exp(3*x))`
Roger Stafford

### Roger Stafford (view profile)

on 10 Sep 2013

The two forms are entirely equivalent. Your k is the negative of my k. k can be either positive or negative depending on initial conditions.

Youssef Khmou

on 10 Sep 2013

OK

### Youssef Khmou (view profile)

Answer by Youssef Khmou

### Youssef Khmou (view profile)

on 10 Sep 2013

Like @the cylist said, try ode23 or ode45, but you did not mention the initial condition :

``` function dy=Myfunction(t,y)
dy(1)=-(3-y(1)).*y(1);```

In the workspace ( initial condition k=0.01 with time [0,,,,10]) :

``` >>[t,y]=ode45('Myfunction',0,10,0.010);
>>plot(t,y)```

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