Published
Edited
Apr 15, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function s_prime(transmision_rate, infection_rate, recovery_rate, share_susceptible, share_exposed, share_infected, share_removed) {
const n = share_susceptible + share_exposed + share_infected + share_removed;
return -1 * transmision_rate * share_infected * share_susceptible / n;
}
Insert cell
function e_prime(transmision_rate, infection_rate, recovery_rate, share_susceptible, share_exposed, share_infected, share_removed) {
const n = share_susceptible + share_exposed + share_infected + share_removed;
return transmision_rate * share_infected * share_susceptible / n - infection_rate * share_exposed;
}
Insert cell
function i_prime(transmision_rate, infection_rate, recovery_rate, share_susceptible, share_exposed, share_infected, share_removed) {
const n = share_susceptible + share_exposed + share_infected + share_removed;
return infection_rate * share_exposed - recovery_rate * share_infected
}
Insert cell
function r_prime(transmision_rate, infection_rate, recovery_rate, share_susceptible, share_exposed, share_infected, share_removed) {
const n = share_susceptible + share_exposed + share_infected + share_removed;
return recovery_rate * share_infected
}
Insert cell
Insert cell
Insert cell
Insert cell
// Get the data into shape
plot_data = {
var results_trans = math.transpose(results)
var names = ['S', 'E', 'I', 'R']
var plot_data = {};
plot_data['series'] = []

for (var i = 0; i<names.length; ++i) {
plot_data['series'][i] = {};
plot_data['series'][i]['name'] = names[i]
plot_data['series'][i]['values'] = results_trans._data[i]
}
return plot_data;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more