Skip to content

Commit

Permalink
Merge pull request #3679 from ccnmtl/production-quota
Browse files Browse the repository at this point in the history
Add production quota line
  • Loading branch information
nikolas authored Dec 16, 2024
2 parents 0b30e8c + 1184e96 commit a4377b0
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions media/js/src/graphs/LinearDemandSupplySurplus.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ const eqsmax = function(c, b, a, d, pmax) {
return (-a + pmax) / d;
};

const epsqbar = function(c, b, a, d, qbar) {
return a + d * qbar;
};

export class LinearDemandSupplySurplus extends Graph {
static getRuleOptions() {
return [
Expand Down Expand Up @@ -674,6 +678,53 @@ export class LinearDemandSupplySurplus extends Graph {
this.l2, this.l3, false,
'Q<sub>S</sub>');
}
} else if (
this.options.gFunctionChoice === 10 ||
this.options.gFunctionChoice === 11
) {
this.board.create('line', [
[0, me.options.gA3],
[
me.options.gA5,
epsqbar(
me.options.gA1, me.options.gA2, me.options.gA3,
me.options.gA4, me.options.gA5)]
], {
straightFirst: false,
straightLast: false,
strokeWidth: 2,
strokeColor: 'red',
fixed: true,
highlight: false
});

this.board.create('line', [
[me.options.gA5, epsqbar(
me.options.gA1, me.options.gA2, me.options.gA3,
me.options.gA4, me.options.gA5)],
[me.options.gA5, 2500]
], {
name: 'Supply - Quota',
withLabel: true,
label: {
strokeColor: 'red'
},
straightFirst: false,
straightLast: false,
strokeWidth: 2,
strokeColor: 'red',
fixed: true,
highlight: false
});


if (this.options.gShowIntersection) {
this.showIntersection(
this.l1, this.l2, false, null,
'P<sup>quota</sup>',
'<math><msubsup><mo>Q</mo><mn>D</mn><mn>quota</mn></msubsup></math>'
);
}
}
}
}
Expand Down

0 comments on commit a4377b0

Please sign in to comment.