Skip to content

Instantly share code, notes, and snippets.

@AKST
Last active October 1, 2025 04:06
Show Gist options
  • Select an option

  • Save AKST/43fcd830f791b8be8c1c622c01e9f111 to your computer and use it in GitHub Desktop.

Select an option

Save AKST/43fcd830f791b8be8c1c622c01e9f111 to your computer and use it in GitHub Desktop.
Continuous Solow Swan combined with continuous Romer endogenous growth model
const l = 0.05, z = 0.0001, d = 0.07, s = 0.15;
const L = 10000, a = 2/3;
const Ly = ((1-l) *L), La = (l * L);
const A0 = 100, K0 = 1000;
const A = (t: number) => A0 * Math.exp(z * La * t);
const K = (t: number) => {
const g = z * La;
const exDt = Math.exp(-a * d * t)
const k0e = (K0**a) * exDt;
const frac = (a*s*A0*(Ly**a))/((z * La) + (a * d));
const exp = Math.exp(z * La * t) - exDt;
return (k0e + (frac * exp)) ** (1/a);
}
const Y = (t: number) => {
return A(t) * (K(t) ** (1-a)) * (Ly ** a);
}
for (let i of [2, 5, 10, 17, 18, 100]) {
const tech = A(i).toFixed()
const kapt = K(i).toFixed();
const outp = Y(i).toFixed();
console.log(`\nt = ${i} A = ${tech} K = ${kapt} Y = ${outp}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment