{
  "information": {
    "Title": "HUM_Branch_Economics_Marginal_Cost_Marginal_Revenue_MCMR_Graph",
    "Author": [
      "Christabelle"
    ],
    "AuthorLogo": [
      ""
    ],
    "Password": "unused",
    "Keywords": "",
    "Abstract": "",
    "Copyright": "",
    "Level": "",
    "Language": "",
    "Logo": [
      "./MOs/logo4.png"
    ],
    "RunAlways": "true",
    "ModelTab": "",
    "ModelTabTitle": "",
    "ModelName": "",
    "FixedNavigationBar": "false",
    "CSSFile": "",
    "DetectedFiles": [
      "./MOs/logo4.png"
    ],
    "AuxiliaryFiles": [
      "./MOs/",
      "./MOs/Market_Dynamics.mp3"
    ],
    "HTMLHead": "<script \nasync=\"true\" src=\"https://www.googletagmanager.com/gtag/js?id=G-S9EWRY1CPJ\"></script>\n<script>\n  window.dataLayer = window.dataLayer || [];\n  function gtag(){dataLayer.push(arguments);}\n  gtag('js', new Date());\n\n  gtag('config', 'G-S9EWRY1CPJ');\n</script>",
    "SaveInXMLFormat": "false",
    "IncludeSource": "true",
    "UseIndexHtml": "false",
    "IncludeLibrary": "true",
    "UglifyJS": "false",
    "PreviewFullModel": "false",
    "UseInterpreter": "true",
    "UseDeltaForODE": "false"
  },
  "description": {
    "pages": []
  },
  "model": {
    "variables": {
      "pages": [
        {
          "Name": "Cost variables",
          "Active": "true",
          "Internal": "false",
          "Type": "undefined",
          "PageComment": "",
          "Variables": [
            {
              "Name": "mc",
              "Value": "27",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "fc",
              "Value": "50",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mcOG",
              "Value": "27",
              "Type": "",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "fcOG",
              "Value": "50",
              "Type": "",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "Demand variables",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "ped",
              "Value": "-1",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "Cd",
              "Value": "40",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "pedOG",
              "Value": "-1",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "CdOG",
              "Value": "40",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "Equilibrium variables",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "xEq",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "pEq",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "acEq",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "profitMargin",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "profit",
              "Value": "",
              "Type": "int",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "profitText",
              "Value": "",
              "Type": "String",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "profitDescription",
              "Value": "\"Supernormal\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "Equilibrium variables II",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "xEqOG",
              "Value": "13.649",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "pEqOG",
              "Value": "26.351",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "acEqOG",
              "Value": "20.922",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "profitMarginOG",
              "Value": "5.309",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "int",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "profitTextOG",
              "Value": "\"$74\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "profitDescriptionOG",
              "Value": "\"Supernormal\"",
              "Type": "String",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "Control variables",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "x",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "viewControl",
              "Value": "[true,false,false]",
              "Type": "boolean",
              "Dimension": "[3]",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "RCViewFlag",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "ROnlyViewFlag",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "COnlyViewFlag",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "showARMR",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "showACMC",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "showAVCAFC",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "showOG",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "plotEqX",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "plotEqXOG",
              "Value": "0",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "Control variables II",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "superProfit",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "subProfit",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "showOGARMR",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "showOGACMC",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "showOGAVCAFC",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "showOGProfit",
              "Value": "true",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "ForPositioningLabels",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "arX",
              "Value": "42",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "arY",
              "Value": "3",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mrX",
              "Value": "21",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mrY",
              "Value": "3",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mcX",
              "Value": "22",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mcY",
              "Value": "40",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "acX",
              "Value": "33",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "acY",
              "Value": "40",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "ForPositioningLabelsII",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "avcX",
              "Value": "37",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "avcY",
              "Value": "40",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "afcX",
              "Value": "35",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "afcY",
              "Value": "3",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "ForPositioningLabelsIII",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "arXOG",
              "Value": "42",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "arYOG",
              "Value": "3",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mrXOG",
              "Value": "21",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mrYOG",
              "Value": "3",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mcXOG",
              "Value": "22",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "mcYOG",
              "Value": "40",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "acXOG",
              "Value": "33",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "acYOG",
              "Value": "40",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "ForPositioningLabelsIV",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "avcXOG",
              "Value": "37",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "avcYOG",
              "Value": "40",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "afcXOG",
              "Value": "35",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "afcYOG",
              "Value": "3",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        },
        {
          "Name": "ForDisablingControls",
          "Active": "true",
          "Internal": "false",
          "Type": "VARIABLE_EDITOR",
          "PageComment": "",
          "Variables": [
            {
              "Name": "vcLowerLimit",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "vcUpperLimit",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "fcLowerLimit",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "fcUpperLimit",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "arLowerLimit",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "arUpperLimit",
              "Value": "false",
              "Type": "boolean",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            },
            {
              "Name": "",
              "Value": "",
              "Type": "double",
              "Dimension": "",
              "Comment": "",
              "Domain": ""
            }
          ]
        }
      ]
    },
    "initialization": {
      "pages": [
        {
          "Name": "InstructionsAtInitialisation",
          "Active": "true",
          "Internal": "false",
          "Type": "undefined",
          "Comment": "",
          "Code": "//_tools.showOkDialog(\"<p style='font-size:30px; color:black'> <center><br/>Some instructions</p>\");\n// _tools.showOkDialog(\"<html><head><style>body {    font-family: Helvetica, Arial, sans-serif;}</style></head><body><h2>Instructions</h2><p>The interface of this simulation contains three panels:</p><ol>    <li>Left Panel: Displays the profit level</li>    <li>Middle Panel: Shows the set of revenue and cost curves</li>    <li>Right Panel: Control panel for adjusting parameters and view</li></ol><h3>Graph Panel (Middle)</h3><ul>    <li>Each revenue/cost curve is colour-coded and labelled</li>  <li>Colour legend is located below the panel</li>  <li>Labels can be repositioned by clicking on and dragging them</li>    <li>Profit is visualised by rectangles: Blue for supernormal; Orange for subnormal</li></ul><h3>Control Panel (Right)</h3><p>Adjust cost and revenue parameters and viewing options using buttons and sliders. Hover over each control to view its specific function.</p></body></html>\");\n// document.getElementById(\".myBoxPanelOk\").style.width = \"500px\";\n// document.getElementById(\".myBoxPanelOk\").style.left = \"40%\"; //to fix aspect ratio\n"
        }
      ]
    },
    "evolution": {
      "information": {
        "FPS": "20",
        "SPD": "1",
        "RealTimeVariable": "",
        "Autoplay": "true"
      },
      "pages": []
    },
    "fixed_relations": {
      "pages": [
        {
          "Name": "FixRel Page 1",
          "Active": "true",
          "Internal": "false",
          "Type": "undefined",
          "Comment": "",
          "Code": "// FixRel Page 1\n\n//Add P and AC labels?\n//Remove AC to only see P & Q\n\n//xEq\nxEq = findIntersectionX(mcFn, mrFn, mc, ped, Cd);\n\n//AC at equilibrium\nacEq = 0.001*(xEq+30)*xEq*(xEq-30) + mc + fc/xEq;\n\n//P at equilibrium\npEq = ped*(xEq - Cd);\n\n//profit margin and profit at equilibrium\nprofitMargin = pEq - acEq;\nprofitMarginOG = Math.abs(pEqOG - acEqOG);\nprofit = (Math.round((profitMargin)*xEq) >= -1 && Math.round((profitMargin)*xEq) <= 1) ? 0: Math.round((profitMargin)*xEq);\nprofitText = (profit >= 0) ? \"$\" + String(profit): \"-$\" + String(-profit);\nprofitDescription = (profit > 0) ? \"Supernormal\": (profit == 0) ? \"Normal\":(profit < 0) ? \"Subnormal\": \"No equilibrium\" ;\n\n//To create toggle for view radio buttons\nRCViewFlag = viewControl[0];\nROnlyViewFlag = viewControl[1];\nCOnlyViewFlag = viewControl[2];\n\n//To control views\nshowARMR = (RCViewFlag || ROnlyViewFlag) ? true: false;\nshowACMC = (RCViewFlag || COnlyViewFlag) ? true: false;\n\n//To dynamically decide whether to plot towards x-axis from P or AC\nplotEqX = Math.max(acEq, pEq);\nplotEqXOG = Math.max(acEqOG, pEqOG);\n\n//To dynamically show profit boxes with different colours\nsuperProfit = (profit > 0 && RCViewFlag) ? true : false;\nsubProfit = (profit < 0 && RCViewFlag) ? true : false;\n\n//To update whether to show OGs\nshowOGARMR = (showOG && showARMR)? true: false;\nshowOGACMC = (showOG && showACMC)? true: false;\nshowOGAVCAFC = (showOG && showAVCAFC)? true: false;\nshowOGProfit = (RCViewFlag && showOG)? true: false;\n\n//To disable buttons\nvcLowerLimit = (mc <= 9) ? true: false;\nvcUpperLimit = (mc >= 57) ? true: false;\nfcLowerLimit = (fc <= 0) ? true: false;\nfcUpperLimit = (fc >= 640) ? true: false;\narLowerLimit = (Cd <= 5) ? true: false;\narUpperLimit = (Cd >= 80) ? true: false;\n\n//To make sure labels don't leave the page\n// mcX2 = (mcX > 50) ? 50: (mcX < 0) ? 0 : mcX;\n// mcY2 = (mcY > 50) ? 50: (mcY < 0) ? 0 : mcY;\n"
        }
      ]
    },
    "custom": {
      "pages": [
        {
          "Name": "Functions for controls",
          "Active": "true",
          "Internal": "false",
          "Type": "undefined",
          "Comment": "",
          "Code": "// Custom Page 1\n\n//Decrease VC\nfunction decreaseVC() {\n    mc -= 3;\n    if (mcY >= 3) { //code to create \"sticky labels\"\n        mcY -=3;\n    }\n    if (avcY >= 3) {\n        avcY -= 3;\n    }\n    if (acY >= 3) {\n        acY -=3;\n    }\n}\n//Increase VC\nfunction increaseVC() {\n    mc += 3;\n    if (mcY <= 47) {\n        mcY +=3;\n    }\n    if (avcY <= 47) {\n        avcY += 3;\n    }\n    if (acY <= 47) {\n        acY +=3;\n    }\n}\n//Reset VC\nfunction resetVC() {\n    mc = mcOG;\n    mcX = mcXOG;\n    mcY = mcYOG;\n    avcX = avcXOG;\n    avcY = avcYOG;\n    acX = acXOG;\n    acY = acYOG;\n}\n\n//Decrease FC\nfunction decreaseFC() {\n    fc -= 10;\n    if (afcY >= 10/afcX) {\n        afcY -= (10/afcX);\n    }\n    if (acY >= 10/afcX) {\n        acY -= (10/afcX);\n    }\n}\n//Increase FC\nfunction increaseFC() {\n    fc += 10;\n    if (afcY <= 50 - (10/afcX)) {\n        afcY += (10/afcX);\n    }\n    if (acY <= 50 - (10/afcX)) {\n        acY += (10/afcX);\n    }\n}\n//Reset FC\nfunction resetFC() {\n    fc = fcOG;\n    afcX = afcXOG;\n    afcY = afcYOG;\n    acX = acXOG;\n    acY = acYOG;\n}\n\n//Decrease D\nfunction decreaseDemand() {\n    Cd -= 5;\n    if (arX >= 5) {\n        arX -= 5;\n    }\n    if (mrX >= 2.5) {\n        mrX -= 2.5;\n    }\n}\n//Increase D\nfunction increaseDemand() {\n    Cd += 5;\n    if (arX <= 45) {\n        arX += 5;\n    }\n    if (mrX <= 47.5) {\n        mrX += 2.5;\n    }\n}\n//Reset D\nfunction resetDemand() {\n    Cd = CdOG;\n    arX = arXOG;\n    arY = arYOG;\n    mrX = mrXOG;\n    mrY = mrYOG;\n}\n//Reset PED\nfunction resetPED() {\n    ped = pedOG;\n}\n\n//Reset All\nfunction resestAll(){\n    mcOG = 27;\n    fcOG = 50;\n    pedOG = -1;\n    CdOG = 40;\n    xEqOG = 13.649;\n    pEqOG = 26.351;\n    acEqOG = 20.922;\n    profitTextOG = \"$74\";\n    profitDescriptionOF = \"Supernormal\";\n    viewControl = [true,false,false];\n    RCViewFlag = true;\n    ROnlyViewFlag = false;\n    COnlyViewFlag = false;\n    showARMR = true;\n    showACMC = true;\n    showAVCAFC = false;\n    showOG = true;\n    showOGARMR = true;\n    showOGACMC = true;\n    showOGAVCAFC = false;\n    showOGProfit = true;\n    arXOG = 42;\n    arYOG = 3;\n    mrXOG = 21;\n    mrYOG = 3;\n    mcXOG = 22;\n    mcYOG = 40;\n    acXOG = 33;\n    acYOG = 40;\n    avcXOG = 37;\n    avcYOG = 40;\n    afcXOG = 35;\n    afcYOG = 3;\n    resetVC();\n    resetFC();\n    resetDemand();\n    resetPED()\n    \n}"
        },
        {
          "Name": "Solvers",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "// Solver for equilibrium X\n///Define MC and MR functions\nfunction mcFn(x,mc) { return 0.004*x*(x*x - 450) + mc}\nfunction mrFn(x,ped,Cd) {return 2*ped*(x - 0.5*Cd)}\n\n//Function to use numerical analysis to return the intersection of MC and MR\nfunction findIntersectionX(curve1, curve2, mc, ped, Cd) {\n  for (let x = 3.5; x <= 50; x += 0.001) {\n    let y1 = curve1(x,mc);\n    let y2 = curve2(x,ped,Cd);\n    if (Math.abs(y1 - y2) < 0.01) {  // Tolerance for floating-point comparison\n      return x;\n    }\n  }\n  return 0;  // No intersection found\n}\n\n\n// Solver for profit\nfunction findProfitMargin(mc,fc,ped,Cd) {\n    let xEq2 = findIntersectionX(mcFn, mrFn, mc, ped, Cd);\n    let acEq2 = 0.001*(xEq2+30)*xEq2*(xEq2-30) + mc + fc/xEq2;\n    let pEq2 = ped*(xEq2 - Cd);\n    return pEq2 - acEq2;\n}\n"
        },
        {
          "Name": "Set profit functions",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "// Set profit functions\n\n//Set to Normal\nfunction findNormalCd(mc,fc,ped,Cd){\n    let tempCd = Cd;\n    //get the current profit\n    let currentProfit = findProfitMargin(mc,fc,ped,Cd); //findProfitMargin function is defined on \"Solvers\" page\n    if (currentProfit > 0.1){\n        while (!(currentProfit > 0 && currentProfit < 0.1)) {\n            tempCd -= 0.1;\n            currentProfit = findProfitMargin(mc,fc,ped,tempCd);\n        }\n        return tempCd;\n    } else if (currentProfit < -0.1){\n        while (!(currentProfit > 0 && currentProfit < 0.1)) {\n            tempCd += 0.1;\n            currentProfit = findProfitMargin(mc,fc,ped,tempCd);\n        }\n        return tempCd;\n    } else {\n        return tempCd;\n    }\n}\n\nfunction setToNormal(){\n    resetVC();\n    resetFC();\n    resetPED();\n    let tempCd = findNormalCd(mc,fc,ped,Cd);\n    let offset = tempCd - Cd;\n    arX += offset;\n    mrX += offset/2;\n    Cd = tempCd;\n    viewCR();\n    \n    //Shift OG curves and labels\n    xEqOG = findIntersectionX(mcFn, mrFn, mc, ped, tempCd);\n    pEqOG = ped*(xEqOG - tempCd);\n    acEqOG = 0.001*(xEqOG+30)*xEqOG*(xEqOG-30) + mc + fc/xEqOG;\n    CdOG = Cd;\n    pedOG = ped;\n    mcOG = mc;\n    fcOG = fc;\n    arXOG = arX;\n    arYOG = arY;\n    mrXOG = mrX;\n    mrYOG = mrY;\n    acXOG = acX;\n    acYOG = acY;\n    mcXOG = mcX;\n    mcYOG = mcY;\n    avcXOG = avcX;\n    avcYOG = avcY;\n    afcXOG = afcX;\n    afcYOG = afcY;\n    profitMarginOG = Math.abs(pEqOG - acEqOG);\n    let profitOG = Math.round((pEqOG - acEqOG)*xEqOG);\n    profitTextOG = (profitOG >= 0) ? \"$\" + String(profitOG): \"-$\" + String(-profitOG);\n    profitDescriptionOG = (profitOG > 0) ? \"Supernormal\": (profitOG == 0) ? \"Normal\":(profitOG < 0) ? \"Subnormal\": \"No equilibrium\" ;\n}\n\nfunction setToSuper(){\n    setToNormal();\n    increaseDemand();\n    //Shift OG curves and labels\n    xEqOG = findIntersectionX(mcFn, mrFn, mc, ped, Cd);\n    pEqOG = ped*(xEqOG - Cd);\n    acEqOG = 0.001*(xEqOG+30)*xEqOG*(xEqOG-30) + mc + fc/xEqOG;\n    CdOG = Cd;\n    pedOG = ped;\n    mcOG = mc;\n    fcOG = fc;\n    arXOG = arX;\n    arYOG = arY;\n    mrXOG = mrX;\n    mrYOG = mrY;\n    acXOG = acX;\n    acYOG = acY;\n    mcXOG = mcX;\n    mcYOG = mcY;\n    avcXOG = avcX;\n    avcYOG = avcY;\n    afcXOG = afcX;\n    afcYOG = afcY;\n    profitMarginOG = Math.abs(pEqOG - acEqOG);\n    let profitOG = Math.round((pEqOG - acEqOG)*xEqOG);\n    profitTextOG = (profitOG >= 0) ? \"$\" + String(profitOG): \"-$\" + String(-profitOG);\n    profitDescriptionOG = (profitOG > 0) ? \"Supernormal\": (profitOG == 0) ? \"Normal\":(profitOG < 0) ? \"Subnormal\": \"No equilibrium\" ;\n}\n\nfunction setToSub(){\n    setToNormal();\n    decreaseDemand();\n    //Shift OG curves and labels\n    xEqOG = findIntersectionX(mcFn, mrFn, mc, ped, Cd);\n    pEqOG = ped*(xEqOG - Cd);\n    acEqOG = 0.001*(xEqOG+30)*xEqOG*(xEqOG-30) + mc + fc/xEqOG;\n    CdOG = Cd;\n    pedOG = ped;\n    mcOG = mc;\n    fcOG = fc;\n    arXOG = arX;\n    arYOG = arY;\n    mrXOG = mrX;\n    mrYOG = mrY;\n    acXOG = acX;\n    acYOG = acY;\n    mcXOG = mcX;\n    mcYOG = mcY;\n    avcXOG = avcX;\n    avcYOG = avcY;\n    afcXOG = afcX;\n    afcYOG = afcY;\n    profitMarginOG = Math.abs(pEqOG - acEqOG);\n    let profitOG = Math.round((pEqOG - acEqOG)*xEqOG);\n    profitTextOG = (profitOG >= 0) ? \"$\" + String(profitOG): \"-$\" + String(-profitOG);\n    profitDescriptionOG = (profitOG > 0) ? \"Supernormal\": (profitOG == 0) ? \"Normal\":(profitOG < 0) ? \"Subnormal\": \"No equilibrium\" ;\n}\n"
        },
        {
          "Name": "Set profit functions II",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "// Set profit functions II\n\nfunction setCurrentAsOG() {\n    xEqOG = xEq;\n    pEqOG = pEq;\n    acEqOG = acEq;\n    CdOG = Cd;\n    pedOG = ped;\n    mcOG = mc;\n    fcOG = fc;\n    arXOG = arX;\n    arYOG = arY;\n    mrXOG = mrX;\n    mrYOG = mrY;\n    acXOG = acX;\n    acYOG = acY;\n    mcXOG = mcX;\n    mcYOG = mcY;\n    avcXOG = avcX;\n    avcYOG = avcY;\n    afcXOG = afcX;\n    afcYOG = afcY;\n    profitTextOG = profitText;\n    profitDescriptionOG = profitDescription;\n}"
        },
        {
          "Name": "ViewControls",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "// ViewControls\nfunction viewCR() {\n    viewControl = [true,false,false];\n    showAVCAFC = false;\n}\n\nfunction viewROnly() {\n    viewControl = [false,true,false];\n    showAVCAFC = false;\n}\n\nfunction viewCOnly() {\n    viewControl = [false,false,true];\n    showAVCAFC = false;\n}"
        },
        {
          "Name": "ShowInstructions",
          "Active": "true",
          "Internal": "false",
          "Type": "CODE_EDITOR",
          "Comment": "",
          "Code": "// ShowInstructions\nfunction showInstructions(){\n //   _tools.showOkDialog(\"<html><head><style>body {    font-family: Helvetica, Arial, sans-serif;}</style></head><body><h2>Instructions</h2><p>The interface of this simulation contains three panels:</p><ol>    <li>Left Panel: Displays the profit level</li>    <li>Middle Panel: Shows the set of revenue and cost curves</li>    <li>Right Panel: Control panel for adjusting parameters and view</li></ol><h3>Graph Panel (Middle)</h3><ul>    <li>Each revenue/cost curve is colour-coded and labelled</li>  <li>Colour legend is located below the panel</li>  <li>Labels can be repositioned by clicking on and dragging them</li>    <li>Profit is visualised by rectangles: Blue for supernormal; Orange for subnormal</li></ul><h3>Control Panel (Right)</h3><p>Adjust cost and revenue parameters and viewing options using buttons and sliders. Hover over each control to view its specific function.</p></body></html>\");\n   _tools.showOkDialog(\"<div style=' font-family: Helvetica, Arial, sans-serif'><h2>Instructions</h2><p>The interface of this simulation contains three panels:</p><ol>    <li>Left Panel: Displays the profit level</li>    <li>Middle Panel: Shows the set of revenue and cost curves</li>    <li>Right Panel: Control panel for adjusting parameters and view</li></ol><h3>Graph Panel (Middle)</h3><ul>    <li>Each revenue/cost curve is colour-coded and labelled</li>  <li>Colour legend is located below the panel</li>  <li>Labels can be repositioned by clicking on and dragging them</li>    <li>Profit is visualised by rectangles: Blue for supernormal; Orange for subnormal</li></ul><h3>Control Panel (Right)</h3><p>Adjust cost and revenue parameters and viewing options using buttons and sliders. Hover over each control to view its specific function.</p></div>\"); document.getElementById(\".myBoxPanelOk\").style.width = \"500px\";\n    document.getElementById(\".myBoxPanelOk\").style.left = \"40%\"; //to fix aspect ratio\n}"
        }
      ]
    },
    "elements": {
      "list": []
    }
  },
  "view": {
    "Tree": [
      {
        "Name": "wrappedPanel",
        "Type": "WrappedPanel",
        "Expanded": "true",
        "Properties": [
          {
            "name": "Display",
            "value": "\"inline-flex\""
          }
        ],
        "Children": [
          {
            "Name": "outputPanel",
            "Type": "Panel",
            "Expanded": "false",
            "Properties": [
              {
                "name": "Width",
                "value": "\"10%\""
              }
            ],
            "Children": [
              {
                "Name": "currProfitBG",
                "Type": "Panel",
                "Expanded": "false",
                "Properties": [
                  {
                    "name": "Background",
                    "value": "\"LightGray\""
                  },
                  {
                    "name": "Visibility",
                    "value": "RCViewFlag"
                  }
                ],
                "Children": [
                  {
                    "Name": "separator_12",
                    "Type": "Separator",
                    "Properties": [
                      {
                        "name": "Visibility",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "Profit",
                    "Type": "Label",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"Current Profit\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal bold medium Arial, Helvetica, sans-serif\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ]
                  },
                  {
                    "Name": "profitTextPanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "profitText",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "profitText"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal bold xx-large Arial, Helvetica, sans-serif\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "profitDescriptionPanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [],
                    "Children": [
                      {
                        "Name": "profitDescription",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "profitDescription"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "separator_13",
                    "Type": "Separator",
                    "Properties": [
                      {
                        "name": "Visibility",
                        "value": "false"
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "separator_15",
                "Type": "Separator",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "false"
                  }
                ]
              },
              {
                "Name": "ogProfitBG_2",
                "Type": "Panel",
                "Expanded": "false",
                "Properties": [
                  {
                    "name": "Background",
                    "value": "\"LightGray\""
                  },
                  {
                    "name": "Visibility",
                    "value": "showOGProfit"
                  }
                ],
                "Children": [
                  {
                    "Name": "separator_12_2",
                    "Type": "Separator",
                    "Properties": [
                      {
                        "name": "Visibility",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "Profit_2",
                    "Type": "Label",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"Original Profit\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal bold medium Arial, Helvetica, sans-serif\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      },
                      {
                        "name": "Foreground",
                        "value": "\"Gray\""
                      }
                    ]
                  },
                  {
                    "Name": "profitTextPanel_2",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "profitText_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "profitTextOG"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal bold xx-large Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Foreground",
                            "value": "\"Gray\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "profitDescriptionPanel_2",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [],
                    "Children": [
                      {
                        "Name": "profitDescription_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "profitDescriptionOG"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Foreground",
                            "value": "\"Gray\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "separator_13_2",
                    "Type": "Separator",
                    "Properties": [
                      {
                        "name": "Visibility",
                        "value": "false"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "Name": "separator_11",
            "Type": "Separator",
            "Properties": [
              {
                "name": "Orientation",
                "value": "\"HORIZONTAL\""
              },
              {
                "name": "Visibility",
                "value": "false"
              },
              {
                "name": "Display",
                "value": "\"inline-flex\""
              },
              {
                "name": "Width",
                "value": "\"1%\""
              }
            ]
          },
          {
            "Name": "plotPanel",
            "Type": "Panel",
            "Expanded": "false",
            "Properties": [
              {
                "name": "Width",
                "value": "\"65%\""
              }
            ],
            "Children": [
              {
                "Name": "plottingPanel",
                "Type": "PlottingPanel",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "AutoScaleY",
                    "value": "false"
                  },
                  {
                    "name": "TitleX",
                    "value": "\"Output\""
                  },
                  {
                    "name": "TitleY",
                    "value": "\"Price\""
                  },
                  {
                    "name": "Title",
                    "value": "\" \""
                  },
                  {
                    "name": "AutoScaleX",
                    "value": "false"
                  },
                  {
                    "name": "MinimumX",
                    "value": "0"
                  },
                  {
                    "name": "MaximumX",
                    "value": "50"
                  },
                  {
                    "name": "MinimumY",
                    "value": "0"
                  },
                  {
                    "name": "MaximumY",
                    "value": "50"
                  },
                  {
                    "name": "Width",
                    "value": "\"100%\""
                  },
                  {
                    "name": "XScalePrecision",
                    "value": "0"
                  },
                  {
                    "name": "YScalePrecision",
                    "value": "0"
                  },
                  {
                    "name": "GridXShow",
                    "value": "false"
                  },
                  {
                    "name": "GridYShow",
                    "value": "false"
                  },
                  {
                    "name": "Display",
                    "value": "\"inline-flex\""
                  },
                  {
                    "name": "Enabled",
                    "value": "true"
                  }
                ],
                "Children": [
                  {
                    "Name": "superProfit",
                    "Type": "Shape2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "0"
                      },
                      {
                        "name": "Y",
                        "value": "acEq"
                      },
                      {
                        "name": "SizeX",
                        "value": "xEq"
                      },
                      {
                        "name": "SizeY",
                        "value": "pEq - acEq"
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(0,0,255,0.2)\""
                      },
                      {
                        "name": "ShapeType",
                        "value": "\"RECTANGLE\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"SOUTH_WEST\""
                      },
                      {
                        "name": "Visibility",
                        "value": "superProfit"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(0,0,255,0.2)\""
                      }
                    ]
                  },
                  {
                    "Name": "subProfit",
                    "Type": "Shape2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "0"
                      },
                      {
                        "name": "Y",
                        "value": "pEq"
                      },
                      {
                        "name": "SizeX",
                        "value": "xEq"
                      },
                      {
                        "name": "SizeY",
                        "value": "acEq - pEq"
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(255,165,0.2)\""
                      },
                      {
                        "name": "ShapeType",
                        "value": "\"RECTANGLE\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"SOUTH_WEST\""
                      },
                      {
                        "name": "Visibility",
                        "value": "subProfit"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(255,165,0.2)\""
                      }
                    ]
                  },
                  {
                    "Name": "mcCurveOG",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "\"0.004*(x)*(x^2 - 450) +\"+mcOG"
                      },
                      {
                        "name": "Minimum",
                        "value": "3.5"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGACMC"
                      }
                    ]
                  },
                  {
                    "Name": "mcLabelOG",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"MC\""
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "X",
                        "value": "mcXOG"
                      },
                      {
                        "name": "Y",
                        "value": "mcYOG"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGACMC"
                      }
                    ]
                  },
                  {
                    "Name": "atcCurveOG",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "\"0.001*(x+30)*x*(x-30) +\"+mcOG+\" + \"+fcOG+\"/x\""
                      },
                      {
                        "name": "Minimum",
                        "value": "3.5"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGACMC"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      }
                    ]
                  },
                  {
                    "Name": "acLabelOG",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"AC\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGACMC"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      },
                      {
                        "name": "X",
                        "value": "acXOG"
                      },
                      {
                        "name": "Y",
                        "value": "acYOG"
                      }
                    ]
                  },
                  {
                    "Name": "arCurveOG",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "pedOG + \"*(x-\" + CdOG + \")\""
                      },
                      {
                        "name": "Minimum",
                        "value": "0"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGARMR"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      }
                    ]
                  },
                  {
                    "Name": "arLabelOG",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"AR = D\""
                      },
                      {
                        "name": "X",
                        "value": "arXOG"
                      },
                      {
                        "name": "Y",
                        "value": "arYOG"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGARMR"
                      }
                    ]
                  },
                  {
                    "Name": "mrCurveOG",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Minimum",
                        "value": "0"
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "\"2*\" + pedOG + \"*(x - 0.5*\" + CdOG + \")\""
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGARMR"
                      }
                    ]
                  },
                  {
                    "Name": "mrLabelOG",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"MR\""
                      },
                      {
                        "name": "X",
                        "value": "mrXOG"
                      },
                      {
                        "name": "Y",
                        "value": "mrYOG"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGARMR"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      }
                    ]
                  },
                  {
                    "Name": "avcCurveOG",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "\"0.001*(x+30)*x*(x-30) +\" + mcOG"
                      },
                      {
                        "name": "Minimum",
                        "value": "3.5"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGAVCAFC"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      }
                    ]
                  },
                  {
                    "Name": "avcLabelOG",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"AVC\""
                      },
                      {
                        "name": "X",
                        "value": "avcXOG"
                      },
                      {
                        "name": "Y",
                        "value": "avcYOG"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGAVCAFC"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      }
                    ]
                  },
                  {
                    "Name": "fcCurveOG",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "fcOG + \"/x\""
                      },
                      {
                        "name": "Minimum",
                        "value": "3.5"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGAVCAFC"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      }
                    ]
                  },
                  {
                    "Name": "afcLabelOG",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"AFC\""
                      },
                      {
                        "name": "X",
                        "value": "afcXOG"
                      },
                      {
                        "name": "Y",
                        "value": "afcYOG"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGAVCAFC"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      }
                    ]
                  },
                  {
                    "Name": "xEqOG",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "xEqOG"
                      },
                      {
                        "name": "Y",
                        "value": "0"
                      },
                      {
                        "name": "SizeX",
                        "value": "0"
                      },
                      {
                        "name": "Attributes",
                        "value": "{\"stroke-dasharray\": \"6,2\"}"
                      },
                      {
                        "name": "LineWidth",
                        "value": "2"
                      },
                      {
                        "name": "SizeY",
                        "value": "plotEqXOG"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGProfit"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      }
                    ]
                  },
                  {
                    "Name": "pYOG",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "0"
                      },
                      {
                        "name": "Y",
                        "value": "pEqOG"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "SizeX",
                        "value": "xEqOG"
                      },
                      {
                        "name": "Attributes",
                        "value": "{\"stroke-dasharray\": \"6,2\"}"
                      },
                      {
                        "name": "LineWidth",
                        "value": "2"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGProfit"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      }
                    ]
                  },
                  {
                    "Name": "acYOG",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "0"
                      },
                      {
                        "name": "Y",
                        "value": "acEqOG"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "SizeX",
                        "value": "xEqOG"
                      },
                      {
                        "name": "Attributes",
                        "value": "{\"stroke-dasharray\": \"6,2\"}"
                      },
                      {
                        "name": "LineWidth",
                        "value": "2"
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGProfit"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.2)\""
                      }
                    ]
                  },
                  {
                    "Name": "superProfitOG",
                    "Type": "Shape2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "0"
                      },
                      {
                        "name": "SizeY",
                        "value": "profitMarginOG"
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgba(128,128,128,0.1)\""
                      },
                      {
                        "name": "ShapeType",
                        "value": "\"RECTANGLE\""
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"WEST\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showOGProfit"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgba(128,128,128,0.1)\""
                      },
                      {
                        "name": "Y",
                        "value": "(pEqOG + acEqOG) / 2"
                      },
                      {
                        "name": "SizeX",
                        "value": "xEqOG"
                      }
                    ]
                  },
                  {
                    "Name": "mcCurve",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "\"0.004*(x)*(x^2 - 450) +\" + mc"
                      },
                      {
                        "name": "Minimum",
                        "value": "3.5"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgb(255,165,0)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      },
                      {
                        "name": "Visibility",
                        "value": "showACMC"
                      }
                    ]
                  },
                  {
                    "Name": "avcCurve",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "\"0.001*(x+30)*x*(x-30) +\" + mc"
                      },
                      {
                        "name": "Minimum",
                        "value": "3.5"
                      },
                      {
                        "name": "Visibility",
                        "value": "showAVCAFC"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgb(255, 229, 204)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      }
                    ]
                  },
                  {
                    "Name": "fcCurve",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "fc + \"/x\""
                      },
                      {
                        "name": "Minimum",
                        "value": "3.5"
                      },
                      {
                        "name": "Visibility",
                        "value": "showAVCAFC"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgb(255, 240, 230)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      }
                    ]
                  },
                  {
                    "Name": "atcCurve",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "\"0.001*(x+30)*x*(x-30) +\" + mc + \"+\" + fc + \"/x\""
                      },
                      {
                        "name": "Minimum",
                        "value": "3.5"
                      },
                      {
                        "name": "Visibility",
                        "value": "showACMC"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgb(204, 85, 0)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      }
                    ]
                  },
                  {
                    "Name": "arCurve",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "ped + \"*(x-\" + Cd + \")\""
                      },
                      {
                        "name": "Minimum",
                        "value": "0"
                      },
                      {
                        "name": "Visibility",
                        "value": "showARMR"
                      },
                      {
                        "name": "LineColor",
                        "value": "\"rgb(0, 0, 128)\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      }
                    ]
                  },
                  {
                    "Name": "mrCurve",
                    "Type": "AnalyticCurve2D",
                    "Properties": [
                      {
                        "name": "Minimum",
                        "value": "0"
                      },
                      {
                        "name": "FunctionX",
                        "value": "\"x\""
                      },
                      {
                        "name": "Variable",
                        "value": "\"x\""
                      },
                      {
                        "name": "FunctionY",
                        "value": "\"2*\" + ped + \"*(x - 0.5*\" + Cd +\")\""
                      },
                      {
                        "name": "LineColor",
                        "value": "\"Blue\""
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      },
                      {
                        "name": "Visibility",
                        "value": "showARMR"
                      }
                    ]
                  },
                  {
                    "Name": "xEq",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "xEq"
                      },
                      {
                        "name": "Y",
                        "value": "0"
                      },
                      {
                        "name": "SizeX",
                        "value": "0"
                      },
                      {
                        "name": "Attributes",
                        "value": "{\"stroke-dasharray\": \"6,2\"}"
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      },
                      {
                        "name": "SizeY",
                        "value": "plotEqX"
                      },
                      {
                        "name": "Visibility",
                        "value": "RCViewFlag"
                      }
                    ]
                  },
                  {
                    "Name": "acY",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "0"
                      },
                      {
                        "name": "Y",
                        "value": "acEq"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "SizeX",
                        "value": "xEq"
                      },
                      {
                        "name": "Attributes",
                        "value": "{\"stroke-dasharray\": \"6,2\"}"
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      },
                      {
                        "name": "Visibility",
                        "value": "RCViewFlag"
                      }
                    ]
                  },
                  {
                    "Name": "pY",
                    "Type": "Segment2D",
                    "Properties": [
                      {
                        "name": "X",
                        "value": "0"
                      },
                      {
                        "name": "Y",
                        "value": "pEq"
                      },
                      {
                        "name": "SizeY",
                        "value": "0"
                      },
                      {
                        "name": "SizeX",
                        "value": "xEq"
                      },
                      {
                        "name": "Attributes",
                        "value": "{\"stroke-dasharray\": \"6,2\"}"
                      },
                      {
                        "name": "LineWidth",
                        "value": "3"
                      },
                      {
                        "name": "Visibility",
                        "value": "RCViewFlag"
                      }
                    ]
                  },
                  {
                    "Name": "arLabel",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"AR = D\""
                      },
                      {
                        "name": "X",
                        "value": "arX"
                      },
                      {
                        "name": "Y",
                        "value": "arY"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgb(0, 0, 128)\""
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showARMR"
                      }
                    ]
                  },
                  {
                    "Name": "mrLabel",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"MR\""
                      },
                      {
                        "name": "X",
                        "value": "mrX"
                      },
                      {
                        "name": "Y",
                        "value": "mrY"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"Blue\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showARMR"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      }
                    ]
                  },
                  {
                    "Name": "mcLabel",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"MC\""
                      },
                      {
                        "name": "X",
                        "value": "mcX"
                      },
                      {
                        "name": "Y",
                        "value": "mcY"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgb(255,165,0)\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showACMC"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      }
                    ]
                  },
                  {
                    "Name": "avcLabel",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"AVC\""
                      },
                      {
                        "name": "X",
                        "value": "avcX"
                      },
                      {
                        "name": "Y",
                        "value": "avcY"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgb(255, 229, 204)\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showAVCAFC"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      }
                    ]
                  },
                  {
                    "Name": "afcLabel",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"AFC\""
                      },
                      {
                        "name": "X",
                        "value": "afcX"
                      },
                      {
                        "name": "Y",
                        "value": "afcY"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgb(255, 240, 230)\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showAVCAFC"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      }
                    ]
                  },
                  {
                    "Name": "acLabel",
                    "Type": "Text2D",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"AC\""
                      },
                      {
                        "name": "X",
                        "value": "acX"
                      },
                      {
                        "name": "Y",
                        "value": "acY"
                      },
                      {
                        "name": "RelativePosition",
                        "value": "\"CENTERED\""
                      },
                      {
                        "name": "FillColor",
                        "value": "\"rgb(204, 85, 0)\""
                      },
                      {
                        "name": "Visibility",
                        "value": "showACMC"
                      },
                      {
                        "name": "EnabledPosition",
                        "value": "\"ENABLED_ANY\""
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "legendPanel",
                "Type": "Panel",
                "Expanded": "false",
                "Properties": [
                  {
                    "name": "Background",
                    "value": "\"White\""
                  }
                ],
                "Children": [
                  {
                    "Name": "firstRowPanel_2",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "mcColor_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"3%\""
                          },
                          {
                            "name": "Background",
                            "value": "\"rgb(255,165,0)\""
                          }
                        ]
                      },
                      {
                        "Name": "mcText_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"30%\""
                          },
                          {
                            "name": "Display",
                            "value": "\"inline-flex\""
                          },
                          {
                            "name": "TextAlign",
                            "value": "\"center\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Marginal Cost\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      },
                      {
                        "Name": "acColor_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"3%\""
                          },
                          {
                            "name": "Background",
                            "value": "\"rgb(204, 85, 0)\""
                          }
                        ]
                      },
                      {
                        "Name": "acText",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"30%\""
                          },
                          {
                            "name": "Display",
                            "value": "\"inline-flex\""
                          },
                          {
                            "name": "TextAlign",
                            "value": "\"center\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Average Cost\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      },
                      {
                        "Name": "avcColor_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"3%\""
                          },
                          {
                            "name": "Background",
                            "value": "\"rgb(255, 229, 204)\""
                          }
                        ]
                      },
                      {
                        "Name": "avcText_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"30%\""
                          },
                          {
                            "name": "Display",
                            "value": "\"inline-flex\""
                          },
                          {
                            "name": "TextAlign",
                            "value": "\"center\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Average Variable Cost\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "secondRowPanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "mrColor_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"3%\""
                          },
                          {
                            "name": "Background",
                            "value": "\"Blue\""
                          }
                        ]
                      },
                      {
                        "Name": "mrText",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"30%\""
                          },
                          {
                            "name": "Display",
                            "value": "\"inline-flex\""
                          },
                          {
                            "name": "TextAlign",
                            "value": "\"center\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Marginal Revenue\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      },
                      {
                        "Name": "arColor",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"3%\""
                          },
                          {
                            "name": "Background",
                            "value": "\"rgb(0, 0, 128)\""
                          }
                        ]
                      },
                      {
                        "Name": "arText",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"30%\""
                          },
                          {
                            "name": "Display",
                            "value": "\"inline-flex\""
                          },
                          {
                            "name": "TextAlign",
                            "value": "\"center\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Average Revenue (Demand)\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      },
                      {
                        "Name": "afcColor",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"3%\""
                          },
                          {
                            "name": "Background",
                            "value": "\"rgb(255, 240, 230)\""
                          }
                        ]
                      },
                      {
                        "Name": "afcText",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"30%\""
                          },
                          {
                            "name": "Display",
                            "value": "\"inline-flex\""
                          },
                          {
                            "name": "TextAlign",
                            "value": "\"center\""
                          },
                          {
                            "name": "Text",
                            "value": "\"Average Fixed Cost\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "Name": "separator",
            "Type": "Separator",
            "Properties": [
              {
                "name": "Orientation",
                "value": "\"VERTICAL\""
              },
              {
                "name": "Visibility",
                "value": "false"
              },
              {
                "name": "Width",
                "value": "\"1%\""
              }
            ]
          },
          {
            "Name": "ControlPanel",
            "Type": "Panel",
            "Expanded": "true",
            "Properties": [
              {
                "name": "Width",
                "value": "\"23%\""
              }
            ],
            "Children": [
              {
                "Name": "costControlPanel",
                "Type": "Panel",
                "Expanded": "true",
                "Properties": [
                  {
                    "name": "Width",
                    "value": "\"100%\""
                  }
                ],
                "Children": [
                  {
                    "Name": "costControlLabel",
                    "Type": "Label",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"Cost Controls\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal bold medium Arial, Helvetica, sans-serif\""
                      }
                    ]
                  },
                  {
                    "Name": "vcPanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "decreaseButton",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\u25bc\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%decreaseVC%"
                          },
                          {
                            "name": "Disabled",
                            "value": "vcLowerLimit || ROnlyViewFlag"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to reduce variable cost\""
                          }
                        ]
                      },
                      {
                        "Name": "variableText_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Variable \\n Cost\""
                          },
                          {
                            "name": "Width",
                            "value": "\"50%\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal medium Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "TextAlign",
                            "value": "\"center\""
                          }
                        ]
                      },
                      {
                        "Name": "increaseButton_2",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\u25b2\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%increaseVC%"
                          },
                          {
                            "name": "Disabled",
                            "value": "vcUpperLimit || ROnlyViewFlag"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to increase variable cost\""
                          }
                        ]
                      },
                      {
                        "Name": "separator_2",
                        "Type": "Separator",
                        "Properties": [
                          {
                            "name": "Visibility",
                            "value": "false"
                          },
                          {
                            "name": "Orientation",
                            "value": "\"VERTICAL\""
                          }
                        ]
                      },
                      {
                        "Name": "resetButton_2",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\\u21BA \\n Reset\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%resetVC%"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Width",
                            "value": "\"20%\""
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to reset variable cost to original level\""
                          },
                          {
                            "name": "Disabled",
                            "value": "ROnlyViewFlag"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "separator_3",
                    "Type": "Separator",
                    "Properties": [
                      {
                        "name": "Visibility",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "fcPanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "decreaseButton_2",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\u25bc\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%decreaseFC%"
                          },
                          {
                            "name": "Disabled",
                            "value": "fcLowerLimit || ROnlyViewFlag"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to reduce fixed cost\""
                          }
                        ]
                      },
                      {
                        "Name": "variableText_2_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Fixed Cost\""
                          },
                          {
                            "name": "Width",
                            "value": "\"50%\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal medium Arial, Helvetica, sans-serif\""
                          }
                        ]
                      },
                      {
                        "Name": "increaseButton_2_2",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\u25b2\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%increaseFC%"
                          },
                          {
                            "name": "Disabled",
                            "value": "fcUpperLimit || ROnlyViewFlag"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to increase fixed cost\""
                          }
                        ]
                      },
                      {
                        "Name": "separator_2_2",
                        "Type": "Separator",
                        "Properties": [
                          {
                            "name": "Visibility",
                            "value": "false"
                          },
                          {
                            "name": "Orientation",
                            "value": "\"VERTICAL\""
                          }
                        ]
                      },
                      {
                        "Name": "resetButton_2_2",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\\u21BA \\n Reset\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%resetFC%"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Width",
                            "value": "\"20%\""
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to reset fixed cost to original level\""
                          },
                          {
                            "name": "Disabled",
                            "value": "ROnlyViewFlag"
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "separator_5",
                "Type": "Separator",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "false"
                  }
                ]
              },
              {
                "Name": "demandControlPanel",
                "Type": "Panel",
                "Expanded": "true",
                "Properties": [],
                "Children": [
                  {
                    "Name": "Demand Controls",
                    "Type": "Label",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"Revenue Controls\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal bold medium Arial, Helvetica, sans-serif\""
                      }
                    ]
                  },
                  {
                    "Name": "CdPanel_2",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "decreaseButton_2_2",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\u25bc\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%decreaseDemand%"
                          },
                          {
                            "name": "Disabled",
                            "value": "arLowerLimit || COnlyViewFlag"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to reduce demand\""
                          }
                        ]
                      },
                      {
                        "Name": "variableText_2_2_2",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Demand\""
                          },
                          {
                            "name": "Width",
                            "value": "\"50%\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal medium Arial, Helvetica, sans-serif\""
                          }
                        ]
                      },
                      {
                        "Name": "increaseButton_2_2_2",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\u25b2\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%increaseDemand%"
                          },
                          {
                            "name": "Disabled",
                            "value": "arUpperLimit || COnlyViewFlag"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to increase demand\""
                          }
                        ]
                      },
                      {
                        "Name": "separator_2_2_2",
                        "Type": "Separator",
                        "Properties": [
                          {
                            "name": "Visibility",
                            "value": "false"
                          },
                          {
                            "name": "Orientation",
                            "value": "\"VERTICAL\""
                          }
                        ]
                      },
                      {
                        "Name": "resetButton_2_2_2",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\\u21BA \\n Reset\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%resetDemand%"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Width",
                            "value": "\"20%\""
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to reset demand to original level\""
                          },
                          {
                            "name": "Disabled",
                            "value": "COnlyViewFlag"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "separator_6",
                    "Type": "Separator",
                    "Properties": [
                      {
                        "name": "Visibility",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "pedPanel_2",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "variableText_2_2_3",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Price inelastic\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          }
                        ]
                      },
                      {
                        "Name": "pedSlider",
                        "Type": "Slider",
                        "Properties": [
                          {
                            "name": "Width",
                            "value": "\"80%\""
                          },
                          {
                            "name": "Value",
                            "value": "ped"
                          },
                          {
                            "name": "Minimum",
                            "value": "-1.9"
                          },
                          {
                            "name": "Maximum",
                            "value": "-0.1"
                          },
                          {
                            "name": "Height",
                            "value": "\"100%\""
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Slide to adjust PED\""
                          },
                          {
                            "name": "Disabled",
                            "value": "COnlyViewFlag"
                          }
                        ]
                      },
                      {
                        "Name": "label",
                        "Type": "Label",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Price elastic\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          }
                        ]
                      },
                      {
                        "Name": "separator_7",
                        "Type": "Separator",
                        "Properties": [
                          {
                            "name": "Orientation",
                            "value": "\"VERTICAL\""
                          },
                          {
                            "name": "Visibility",
                            "value": "false"
                          }
                        ]
                      },
                      {
                        "Name": "resetButton_2_2_3",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"\\u21BA \\n Reset\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%resetPED%"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Width",
                            "value": "\"20%\""
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Click to reset PED to original value\""
                          },
                          {
                            "name": "Disabled",
                            "value": "COnlyViewFlag"
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "separator_4",
                "Type": "Separator",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "false"
                  }
                ]
              },
              {
                "Name": "setProfitPanel",
                "Type": "Panel",
                "Expanded": "false",
                "Properties": [],
                "Children": [
                  {
                    "Name": "setProfitLabel",
                    "Type": "Label",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"Set Original Profit\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal bold medium Arial, Helvetica, sans-serif\""
                      }
                    ]
                  },
                  {
                    "Name": "profitButtonPanel",
                    "Type": "Panel",
                    "Expanded": "false",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"95%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "subNormalButton",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Subnormal\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%setToSub%"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Sets graphs to show subnormal profit as the original profit\""
                          }
                        ]
                      },
                      {
                        "Name": "separator_8",
                        "Type": "Separator",
                        "Properties": [
                          {
                            "name": "Orientation",
                            "value": "\"VERTICAL\""
                          },
                          {
                            "name": "Visibility",
                            "value": "false"
                          }
                        ]
                      },
                      {
                        "Name": "normalButton",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Normal\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%setToNormal%"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Sets graphs to show normal profit as the original profit\""
                          }
                        ]
                      },
                      {
                        "Name": "separator_9",
                        "Type": "Separator",
                        "Properties": [
                          {
                            "name": "Orientation",
                            "value": "\"VERTICAL\""
                          },
                          {
                            "name": "Visibility",
                            "value": "false"
                          }
                        ]
                      },
                      {
                        "Name": "superNormalButton",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Supernormal\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%setToSuper%"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Sets graphs to show supernormal profit as the original profit\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "separator_16",
                    "Type": "Separator",
                    "Properties": [
                      {
                        "name": "Visibility",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "setCurrentAsOGPanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"95%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "setCurrentAsOGButton",
                        "Type": "Button",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Set current graphs as original\""
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal small Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Width",
                            "value": "\"100%\""
                          },
                          {
                            "name": "OnPress",
                            "value": "%setCurrentAsOG%"
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Sets current graphs (coloured lines) as the original set of graphs.\""
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                "Name": "separator_10",
                "Type": "Separator",
                "Properties": [
                  {
                    "name": "Visibility",
                    "value": "false"
                  }
                ]
              },
              {
                "Name": "viewModesPanel",
                "Type": "Panel",
                "Expanded": "true",
                "Properties": [],
                "Children": [
                  {
                    "Name": "View Controls",
                    "Type": "Label",
                    "Properties": [
                      {
                        "name": "Text",
                        "value": "\"Viewing Modes\""
                      },
                      {
                        "name": "Font",
                        "value": "\"normal bold medium Arial, Helvetica, sans-serif\""
                      }
                    ]
                  },
                  {
                    "Name": "revCostViewpanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "revCostViewButton",
                        "Type": "RadioButton",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"View revenue & cost curves\""
                          },
                          {
                            "name": "Checked",
                            "value": "RCViewFlag"
                          },
                          {
                            "name": "OnCheckOn",
                            "value": "%viewCR%"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "revViewpanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "revViewButton",
                        "Type": "RadioButton",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"View revenue curves only\""
                          },
                          {
                            "name": "TextAlign",
                            "value": "\"left\""
                          },
                          {
                            "name": "Checked",
                            "value": "ROnlyViewFlag"
                          },
                          {
                            "name": "OnCheckOn",
                            "value": "%viewROnly%"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "CostViewpanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "costViewButton_2",
                        "Type": "RadioButton",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"View cost curves only\""
                          },
                          {
                            "name": "Checked",
                            "value": "COnlyViewFlag"
                          },
                          {
                            "name": "OnCheckOn",
                            "value": "%viewCOnly%"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "separator_14",
                    "Type": "Separator",
                    "Properties": [
                      {
                        "name": "Visibility",
                        "value": "false"
                      }
                    ]
                  },
                  {
                    "Name": "showOGPanel_2",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      }
                    ],
                    "Children": [
                      {
                        "Name": "showOgCheckBox",
                        "Type": "CheckBox",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Show original\""
                          },
                          {
                            "name": "Checked",
                            "value": "showOG"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Toggle to show/hide the original graphs (in grey) before the shifts\""
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "Name": "showAvcAfcPanel",
                    "Type": "Panel",
                    "Expanded": "true",
                    "Properties": [
                      {
                        "name": "Display",
                        "value": "\"inline-flex\""
                      },
                      {
                        "name": "Width",
                        "value": "\"100%\""
                      },
                      {
                        "name": "Visibility",
                        "value": "!ROnlyViewFlag"
                      }
                    ],
                    "Children": [
                      {
                        "Name": "showAvcAfcCheckBox",
                        "Type": "CheckBox",
                        "Properties": [
                          {
                            "name": "Text",
                            "value": "\"Show AVC and AFC\""
                          },
                          {
                            "name": "Checked",
                            "value": "showAVCAFC"
                          },
                          {
                            "name": "Font",
                            "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                          },
                          {
                            "name": "Tooltip",
                            "value": "\"Toggle to show/hide the average variable cost and average fixed cost\""
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "Name": "BottomPanel",
        "Type": "Panel",
        "Expanded": "true",
        "Properties": [
          {
            "name": "Display",
            "value": "\"inline-flex\""
          },
          {
            "name": "Width",
            "value": "\"100%\""
          }
        ],
        "Children": [
          {
            "Name": "metaControlsPanel",
            "Type": "Panel",
            "Expanded": "true",
            "Properties": [
              {
                "name": "Display",
                "value": "\"inline-flex\""
              },
              {
                "name": "Width",
                "value": "\"15%\""
              }
            ],
            "Children": [
              {
                "Name": "instructionsButton",
                "Type": "Button",
                "Properties": [
                  {
                    "name": "Text",
                    "value": "\"Instructions\""
                  },
                  {
                    "name": "Font",
                    "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                  },
                  {
                    "name": "Tooltip",
                    "value": "\"Click here for instructions on how to use this interactive\""
                  },
                  {
                    "name": "OnPress",
                    "value": "%showInstructions%"
                  }
                ]
              },
              {
                "Name": "separator_17",
                "Type": "Separator",
                "Properties": [
                  {
                    "name": "Orientation",
                    "value": "\"VERTICAL\""
                  },
                  {
                    "name": "Visibility",
                    "value": "false"
                  }
                ]
              },
              {
                "Name": "musicTwoStateButton",
                "Type": "TwoStateButton",
                "Properties": [
                  {
                    "name": "TextOn",
                    "value": "\"Play music \\u266a\""
                  },
                  {
                    "name": "TextOff",
                    "value": "\"Stop music \\u266a\""
                  },
                  {
                    "name": "Font",
                    "value": "\"normal normal default Arial, Helvetica, sans-serif\""
                  },
                  {
                    "name": "Tooltip",
                    "value": "\"Click to play/pause background music\""
                  },
                  {
                    "name": "OnClick",
                    "value": "_view.bgMusic.play()"
                  },
                  {
                    "name": "OffClick",
                    "value": "_view.bgMusic.pause()"
                  }
                ]
              },
              {
                "Name": "bgMusic",
                "Type": "Audio",
                "Properties": [
                  {
                    "name": "AudioUrl",
                    "value": "\"./MOs/Market_Dynamics.mp3\""
                  },
                  {
                    "name": "Loop",
                    "value": "true"
                  },
                  {
                    "name": "Volume",
                    "value": "0.2"
                  }
                ]
              }
            ]
          },
          {
            "Name": "resetAllPanel",
            "Type": "Panel",
            "Expanded": "true",
            "Properties": [
              {
                "name": "Width",
                "value": "\"70%\""
              }
            ],
            "Children": [
              {
                "Name": "resetAllButton",
                "Type": "Button",
                "Properties": [
                  {
                    "name": "Text",
                    "value": "\"\\u21BA \\n Reset All\""
                  },
                  {
                    "name": "OnPress",
                    "value": "%resestAll%"
                  },
                  {
                    "name": "Font",
                    "value": "\"normal normal medium Arial, Helvetica, sans-serif\""
                  },
                  {
                    "name": "Width",
                    "value": "\"20%\""
                  },
                  {
                    "name": "Tooltip",
                    "value": "\"Resets all graphs to initial state\""
                  }
                ]
              }
            ]
          },
          {
            "Name": "panel",
            "Type": "Panel",
            "Expanded": "true",
            "Properties": [
              {
                "name": "Width",
                "value": "\"15%\""
              }
            ],
            "Children": [
              {
                "Name": "label_2",
                "Type": "Label",
                "Properties": [
                  {
                    "name": "Text",
                    "value": "\" \""
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "RootProperties": []
  },
  "metadata": {
    "APP": "WebEJS",
    "CreatedWith": "WebEJS : the web version of Easy JavaScript Simulations",
    "MoreInfo": "1.0",
    "version": "https://t.um.es/webejs"
  }
}