Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168699
Image: ubuntu2004

Sage Tool 1

This tool is designed for use with Activity 1 in Section 6.2.

Note that we use KK rather than kk for the proportionality constant.  The lower case kk is used as a counting index here.

We define KK, MM, and P0P_0 below.

K=0.00009 M=1000 P_0=10

We assign nn and Δ\Delta (in place of Δt\Delta t) and define the iteration procedure.

n=40 Delta=120/n var('k') t(k)=k*Delta def P(k): list=[P_0] for i in range(1,k+1): list.append(list[i-1]+K*list[i-1]*(M-list[i-1])*Delta) return list P(3)
[10, 12.6730000000000, 16.0513466691700, 20.3156459227746]

We carry out the iteration and assign its values to tt and PP.

solution=[(t(k),P(n)[k]) for k in range(n)]
line(solution)

Now we plot the solution.