LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
cache_rrm_meanfield.m
1% Parameters
2n = 7;
3m = [1,1,3];
4h = length(m);
5lambda = [49, 49, 49, 49, 7, 1, 1]/205;
6
7% Initial condition (randomly initialized probabilities)
8rng(23000, 'twister');
9x0 = rand(n, 1+ h);
10for i=1:n
11 x0(i,:) = zeros(1,1+h);
12 x0(i,1) = 1;
13end
14
15% Time span
16tspan = [0 10000];
17
18% Solve ODE
19[t, x] = ode23s(@(t, x) cache_rrm_meanfield_ode(t, x, lambda, m, n, h), tspan, x0);
20
21x=reshape(x(end,:),[n,1+h])
22missrate = lambda*x(:,1)
23missratio = (lambda*x(:,1))/sum(lambda)
24