From 61050207958db3f8911b1b589e147d2d0ae40041 Mon Sep 17 00:00:00 2001 From: Nils Olsson Date: Mon, 2 Aug 2021 01:15:49 -0700 Subject: [PATCH] Update furnace2.myps --- myps/test-scripts/factory/furnace/furnace2.myps | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/myps/test-scripts/factory/furnace/furnace2.myps b/myps/test-scripts/factory/furnace/furnace2.myps index b95b626..f2d3001 100644 --- a/myps/test-scripts/factory/furnace/furnace2.myps +++ b/myps/test-scripts/factory/furnace/furnace2.myps @@ -106,7 +106,7 @@ loop: eCp = nC0 - NC # H moles of input (nHI) - nHI = nI - nCI # nHI = nI-nCI + nHI = nI - nCI # H end goal (NH) and initial error (eHp) nH0 = fH * tankH.TotalMoles @@ -120,16 +120,16 @@ loop: yield() # F output rate - nF = furnace.TotalMoles # nF - eF = nF - NF # eF = nF-NF + nF = furnace.TotalMoles + eF = nF - NF EF = eF > ERRORF rF = KPF*(eF * vF / nF) + KDF*(eF - eFp)/dt #rF = max(0, min(rFmax, rF)) # optional bound on rate furnace.SettingOutput = rF # C input rate - nC = fC * tankC.TotalMoles # nC - eC = nC - NC # eC = nC-NC + nC = fC * tankC.TotalMoles + eC = nC - NC EC = eC > ERRORC rC = KPC*(eC * vC / nC) + KDC*(eC - eCp)/dt #rC = max(0, min(100, rC)) # optional bound on rate @@ -137,8 +137,8 @@ loop: pumpC.On = EC # H input rate - nH = fH * tankH.TotalMoles # nH - eH = nH - NH # eH = nH-NH + nH = fH * tankH.TotalMoles + eH = nH - NH EH = eH > ERRORH rH = KPH*(eH * vH / nH) + KDH*(eH - eHp)/dt #rH = max(0, min(100, rH)) # optional bound on rate @@ -147,7 +147,7 @@ loop: # Write progress to housing and store errors # (TODO: This isn't exactly accurate...) - eTotal = eF + eC + eH # eTotal = eF+eC+eH + eTotal = eF + eC + eH db.Setting = 1 - (eTotal / eTotal0) eFp = eF eCp = eC