[Scilab-users] help a newbie out?

Ryan M. Castle picubed at outlook.com
Sat Jan 4 22:19:38 CET 2014


Hello. I am new to scilab. I need to create a simple plot of the solution to the logistic equation and have been frustrated by scilab. The plot should be decaying, approaching 20 with an initial population of 300. Here is what I have (in .sce file):

clc
clear
p = 300;
m = 20;
k = .1;
t = [0:.01:5];

y = (m*p)/[p + (m - p)*exp(-k*m*t)];

plot(t, y, 'LineWidth',3)
xlabel('t'),ylabel('y');


If I define just  t=0 then I get correct result of 300. If I have t=5 I get (close to) 20. All good.

But when I plot t=0:.01:5; I get a plot that is 1) increasing not decreasing and 2) the initial and limiting values are all wrong, just a fraction of correct values.

What am I missing? Such a simple plot...
 
Thank you. 		 	   		  


More information about the users mailing list