1
0
forked from EHV/sejeteralo

modification rendu courbe bleue prix moyen

This commit is contained in:
nicoboy
2026-05-01 21:54:36 +02:00
parent 8b1dd9b170
commit b5d58911fb
+3 -3
View File
@@ -1032,7 +1032,7 @@ const avgPriceWithAboPath = computed(() => {
const pts: string[] = []
for (let i = 1; i < curve.curveVolumes.length; i++) {
const v = curve.curveVolumes[i]
if (v < 30) continue
if (v < 1) continue
// Approximate bill at volume v: we use trapezoidal integration of marginal price
// Simpler: bill ≈ average_marginal_price * v, and average_marginal_price ≈ curvePrice at v
// More accurate: use the integral formulas. But for display, we use:
@@ -1391,7 +1391,7 @@ const margPriceLine = computed(() => {
const pts: string[] = []
for (let i = 0; i < vols.length; i += 3) {
const v = vols[i]!
if (v > margVolMax.value) break
if (v < 15 || v > margVolMax.value) continue // ← changer break par continue, et ajouter v < 15
pts.push(`${margCx(v)},${margCyPrice(prices[i]!)}`)
}
return pts.join(' ')
@@ -1406,7 +1406,7 @@ const margAvgPriceWithAboLine = computed(() => {
const pts: string[] = []
for (let i = 0; i < vols.length; i += 3) {
const v = vols[i]!
if (v < 1 || v > margVolMax.value) continue
if (v < 15 || v > margVolMax.value) continue
const avgP = citizenAbo.value / v + p0lin
if (avgP <= margPriceMax.value * 1.5) {
pts.push(`${margCx(v)},${margCyPrice(avgP)}`)