spb/traite-evaluation-qc
Public
1#!/usr/bin/env python32"""Figure ch05 — gradients du modèle monocentrique simulé (PARAMÈTRES PÉDAGOGIQUES DÉCLARÉS dans ch05_rente.PARAMS).3Panneau gauche : courbes d'enchère linéaires de trois usages et leur enveloppe (Alonso) ; panneau droit : prix du4logement, rente foncière et densité relative du modèle de Muth–Mills, avec l'approximation exponentielle.5Sortie : assets/figures/ch05/ch05-fig-gradient-monocentrique.pdf"""6import sys, pathlib7ROOT = pathlib.Path(__file__).resolve().parents[3]8sys.path.insert(0, str(ROOT / "analysis/python")); sys.path.insert(0, str(ROOT / "analysis/python/cases"))9import numpy as np10import matplotlib.pyplot as plt11from traite.style import setup, palette, savefig, LARGEUR12import ch05_rente as c51314def main():15 setup()16 P = c5.PARAMS17 fig, (a1, a2) = plt.subplots(1, 2, figsize=(LARGEUR, 3.1), gridspec_kw={"wspace": 0.32})18 # --- Alonso19 d = np.linspace(0, 36, 400)20 env, courbes = c5.enveloppe_alonso(d)21 for k, (nom, y) in enumerate(courbes.items()):22 a1.plot(d, np.clip(y, 0, None), color=palette.cat[k], lw=1.1, alpha=0.85, label=nom)23 a1.plot(d, env, color=palette.ink, lw=2.0, label="Enveloppe (rente de marché)")24 a1.axhline(P["ra"], color=palette.ink2, lw=0.8, ls=":")25 a1.text(0.5, P["ra"] + 4, "rente agricole", fontsize=7, color=palette.ink2)26 (R1, t1), (R2, t2), (R3, t3) = c5.ALONSO.values()27 for x in (c5.frontiere_usages(R1, t1, R2, t2), c5.frontiere_usages(R2, t2, R3, t3), (R3 - P["ra"]) / t3):28 a1.axvline(x, color=palette.grid, lw=0.8, ls="--")29 a1.set_ylim(0, 140); a1.set_xlim(0, 36)30 a1.set_xlabel("Distance au centre (km)"); a1.set_ylabel("Rente foncière ($/m² de terrain/an)")31 a1.set_title("A. Courbes d'enchère et enveloppe", loc="left", fontsize=8.5)32 a1.legend(fontsize=6.8, loc="upper right")33 # --- Muth–Mills34 dbar = c5.frontiere_urbaine(P)35 d2 = np.linspace(0, dbar, 400)36 a2.plot(d2, c5.prix_logement(d2) / P["p0"], color=palette.cat[0], lw=1.8, label="Prix du logement $p(d)/p_0$")37 a2.plot(d2, c5.prix_exponentiel(d2) / P["p0"], color=palette.cat[0], lw=1.0, ls="--", label="Approximation exponentielle")38 a2.plot(d2, c5.rente_fonciere(d2) / P["r0"], color=palette.cat[1], lw=1.8, label="Rente foncière $r(d)/r_0$")39 a2.plot(d2, c5.densite(d2), color=palette.cat[2], lw=1.8, label="Densité $D(d)/D_0$")40 a2.axvline(dbar, color=palette.ink2, lw=0.8, ls=":")41 a2.text(dbar - 0.6, 0.47, f"frontière\nurbaine\n{dbar:.1f} km", fontsize=7, color=palette.ink2, ha="right")42 a2.set_xlim(0, dbar + 1); a2.set_ylim(0, 1.05)43 a2.set_xlabel("Distance au centre (km)"); a2.set_ylabel("Niveau relatif au centre (= 1)")44 a2.set_title("B. Gradients du modèle de Muth–Mills", loc="left", fontsize=8.5)45 a2.legend(fontsize=6.8, loc="upper right")46 out = savefig(fig, "ch05/ch05-fig-gradient-monocentrique.pdf"); print("OK", out)4748if __name__ == "__main__":49 main()50