MATH3242 - FW03

Assignment 4

Question 8

> ode1:=diff(y(x),x)=y(x)*(3-y(x));

ode1 := diff(y(x),x) = y(x)*(3-y(x))

> xarray:=array([evalf(i/4)$i=1..16]);

xarray := vector([.2500000000, .5000000000, .750000...
xarray := vector([.2500000000, .5000000000, .750000...
xarray := vector([.2500000000, .5000000000, .750000...

> dsolve({ode1,y(0)=1},y(x),numeric,value=xarray);

matrix([[vector([x, y(x)])], [matrix([[.2500000000,...

> dsolve({ode1,y(0)=2},y(x),numeric,value=xarray);

matrix([[vector([x, y(x)])], [matrix([[.2500000000,...

> dsolve({ode1,y(0)=3},y(x),numeric,value=xarray);

matrix([[vector([x, y(x)])], [matrix([[.2500000000,...

> dsolve({ode1,y(0)=4},y(x),numeric,value=xarray);

matrix([[vector([x, y(x)])], [matrix([[.2500000000,...

> dsolve({ode1,y(0)=5},y(x),numeric,value=xarray);

matrix([[vector([x, y(x)])], [matrix([[.2500000000,...

Note that if the initial condition is less than 3 the solution increases monotonically towards 3.

If the initial condition is 3, the solution remains at this value for all x.

If the initial condition is greater than 3 the solution decreases monotonically towards 3.

Question 9(a)

> ode2:=diff(y(x),x,x)-diff(y(x),x)/x+2*x*y(x)=sin(x);

ode2 := diff(y(x),`$`(x,2))-diff(y(x),x)/x+2*x*y(x)...

> xarray2:=array([evalf(1+i/10)$i=1..10]);

xarray2 := vector([1.100000000, 1.200000000, 1.3000...
xarray2 := vector([1.100000000, 1.200000000, 1.3000...

> dsolve({ode2,y(1)=2,D(y)(1)=-1},y(x),numeric,value=xarray2);

matrix([[vector([x, y(x), diff(y(x),x)])], [matrix(...

Question 9(b)

> ode3:=diff(y(x),x,x)+cos(x)*diff(y(x),x)+x*sin(x)*y(x) = cot(x);

ode3 := diff(y(x),`$`(x,2))+cos(x)*diff(y(x),x)+x*s...

> xarray3:=array([evalf(1+i/10)$i=1..20]);

xarray3 := vector([1.100000000, 1.200000000, 1.3000...
xarray3 := vector([1.100000000, 1.200000000, 1.3000...
xarray3 := vector([1.100000000, 1.200000000, 1.3000...

> dsolve({ode3,y(1)=0.5,D(y)(1)=1.2},y(x),numeric,value=xarray3);

matrix([[vector([x, y(x), diff(y(x),x)])], [matrix(...

>