21.07.2013 Views

nr. 477 - 2011 - Institut for Natur, Systemer og Modeller (NSM)

nr. 477 - 2011 - Institut for Natur, Systemer og Modeller (NSM)

nr. 477 - 2011 - Institut for Natur, Systemer og Modeller (NSM)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

170 matlab Code<br />

%options = odeset(’RelTol’,1e-6,’AbsTol’,1e-6);<br />

[t,M] = ode15s(@modelT1DmareeG_full,tspan,M);<br />

figure<br />

plot(t,M)<br />

xlabel(’t’)<br />

ylabel(’M(t), Ma(t), Ba(t), Bn(t),C(t)’)<br />

legend(’M(t)’,’Ma(t)’,’Ba(t)’,’Bn(t)’,’C(t)’,2)<br />

C.3 The Function-File <strong>for</strong> Model C<br />

The following is the function-file that contains Model C.<br />

function Mdot = mareemodelfuld6C(t,M)<br />

Mdot = zeros(6,1);<br />

global A b c d e f1 f2 a k k_c l x2 x3 x4<br />

%defines parameter values<br />

A = 2*10^7/(1e9);<br />

a = 5*10^4;<br />

b = 0.09;<br />

c = 0.1;<br />

d = 0.5;<br />

e = 1*10^-8;<br />

f1 = 1*10^-5;<br />

f2 = 1*10^-5;<br />

h = 5*10^-9;<br />

k = 0.4;<br />

k_c = 1;<br />

l = 0.41;<br />

m = 25;<br />

r0 = 0.04;<br />

a0 = 0.022;<br />

t1 = (365*l<strong>og</strong>((r0-0.036)/0.036)-30*l<strong>og</strong>((r0-0.0007)/0.0007))/(l<strong>og</strong>((0.0007*(r0-0.036))...<br />

/(0.036*(r0-0.0007))))<br />

p1 = l<strong>og</strong>((r0-0.036)/0.036)/(30-t1)<br />

t2 = (365*l<strong>og</strong>((a0-0.018)/0.018)-30*l<strong>og</strong>((a0-0.001)/0.001))/(l<strong>og</strong>((0.001*(a0-0.018))...<br />

/(0.018*(a0-0.001))))<br />

p2 = l<strong>og</strong>((a0-0.018)/0.018)/(30-t2)<br />

x5 = 1*10^7;<br />

Mdot(1,1) = a + (b + k) * M(2,1) - c * M(1,1) - f1 * M(1,1) * M(3,1)...<br />

- e * M(1,1) * (M(1,1) + M(2,1));<br />

Mdot(2,1) = f1 * M(1) * M(3) - k * M(2) - e * M(2) * (M(1) + M(2));<br />

Mdot(3,1) = (a0*(1+exp(-p2*t2))/(1+exp(p2*(t-t2)))+0.001)*M(6)...<br />

+ (4*10^7 *exp(-((t-9)/3)^2)/(1e9))*M(6) + (A*M(5)/(k_c + M(5)))*M(6)...<br />

- f1 * M(3) * M(1) - f2 * M(2) * M(3) - d * M(3);<br />

Mdot(4,1) = d*M(3) - f1*M(1)*M(4) - f2*M(2)*M(4);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!