Lkelly9 Week 7
From OpenWetWare
- Lauren M. Kelly
- Assignment Page
- Individual Journal Entry
- Shared Journal Page
Purpose
Workflow/Methods
- Created an updated version of my differential equations and attempted to run them in MATLAB
- Used the script below. Will make changes to the plot labels to better reflect my model
global q u1 u2 y K1 K2 V R q= 0; u1= 20; u2 = 30; y = 4; K1 = 3; K2 = 7; R = 0.76; V= 56; tt = 0:0.1:10; x0 = [1;2]; [t,x] = ode45('week7projectfunction',tt,x0); plot(t,x) xlabel('time') ylabel('abundance') title('Population and food source over time') legend('Population','Food')
- Used the function below.
- When I tried to run it, I kept getting an error that said "'week7projectfunction' requires more input arguments to run." It appears that there is a possible problem with the (t,x).
function dx = week7projectfunction(t,x) global q u1 u2 y K1 K2 V R dx = zeros(size(x)); dx(1) = (q*u1) - (q*x(1)) - x(3)*((x(1))/((x(1))+K1))*((x(2))/((x(2))+K2)); dx(2) = (q*u2) - (q*x(2)) - x(3)*((x(1))/((x(1))+K1))*((x(2))/((x(2))+K2)); dx(3) = (x(3))*R*((x(1))/((x(1))+K1))*((x(2))/((x(2))+K2))-(q*y); dx(4) = V(1-(V/y))*V; end