@@ -73,6 +73,14 @@ const eq2 = function(a, b, c, d) {
73
73
return ( a - c ) / ( b + d ) ;
74
74
} ;
75
75
76
+ const sp2 = function ( a , b , c , d , f , g ) {
77
+ return ( b * c + a * d + b * f + a * g ) / ( b + d + g ) ;
78
+ } ;
79
+
80
+ const sq2 = function ( a , b , c , d , f , g ) {
81
+ return ( a - c - f ) / ( b + d + g ) ;
82
+ } ;
83
+
76
84
const psurplus2 = function ( a , b , c , d ) {
77
85
return ( ep2 ( a , b , c , d ) - c ) * eq2 ( a , b , c , d ) / 2 ;
78
86
} ;
@@ -85,6 +93,30 @@ const extcost2 = function(a, b, c, d, f, g) {
85
93
return emcmarket2 ( a , b , c , d , f , g ) * eq2 ( a , b , c , d ) / 2 ;
86
94
} ;
87
95
96
+ const spoint2 = function ( a , b , c , d , f , g ) {
97
+ return [ sq2 ( a , b , c , d , f , g ) , sp2 ( a , b , c , d , f , g ) ] ;
98
+ } ;
99
+
100
+ const shint2 = function ( a , b , c , d , f , g ) {
101
+ return [ 0 , sp2 ( a , b , c , d , f , g ) ] ;
102
+ } ;
103
+
104
+ const svint2 = function ( a , b , c , d , f , g ) {
105
+ return [ sq2 ( a , b , c , d , f , g ) , 0 ] ;
106
+ } ;
107
+
108
+ const epoint2 = function ( a , b , c , d ) {
109
+ return [ eq2 ( a , b , c , d ) , ep2 ( a , b , c , d ) ] ;
110
+ } ;
111
+
112
+ const ehint2 = function ( a , b , c , d ) {
113
+ return [ 0 , ep2 ( a , b , c , d ) ] ;
114
+ } ;
115
+
116
+ const evint2 = function ( a , b , c , d ) {
117
+ return [ eq2 ( a , b , c , d ) , 0 ] ;
118
+ } ;
119
+
88
120
89
121
export class NegativeProductionExternalityIndustryGraph extends Graph {
90
122
static getGraphPane ( gFunctionChoice , gA1 , gA2 , gA3 , gA4 , gA5 , gA6 ) {
@@ -95,19 +127,19 @@ export class NegativeProductionExternalityIndustryGraph extends Graph {
95
127
value : eq2 ( gA1 , gA2 , gA3 , gA4 ) . toFixed ( 2 )
96
128
} ,
97
129
{
98
- label : 'Producer Surplus PS ' ,
99
- color : 'orange ' ,
100
- value : psurplus2 ( gA1 , gA2 , gA3 , gA4 ) . toFixed ( 2 )
130
+ label : 'Unregulated Price P* ' ,
131
+ color : 'red ' ,
132
+ value : ep2 ( gA1 , gA2 , gA3 , gA4 ) . toFixed ( 2 )
101
133
} ,
102
134
{
103
- label : 'External Total Cost ' ,
104
- color : 'red ' ,
105
- value : extcost2 ( gA1 , gA2 , gA3 , gA4 , gA5 , gA6 ) . toFixed ( 2 )
135
+ label : 'Socially Desirable Output Q<sup>soc</sup> ' ,
136
+ color : 'orange ' ,
137
+ value : sq2 ( gA1 , gA2 , gA3 , gA4 , gA5 , gA6 ) . toFixed ( 2 )
106
138
} ,
107
139
{
108
- label : 'P* ' ,
109
- color : 'red ' ,
110
- value : ep2 ( gA1 , gA2 , gA3 , gA4 ) . toFixed ( 2 )
140
+ label : 'Socially Desirable Price P<sup>soc</sup> ' ,
141
+ color : 'orange ' ,
142
+ value : sp2 ( gA1 , gA2 , gA3 , gA4 , gA5 , gA6 ) . toFixed ( 2 )
111
143
} ,
112
144
] ;
113
145
}
@@ -192,6 +224,56 @@ export class NegativeProductionExternalityIndustryGraph extends Graph {
192
224
highlight : false
193
225
}
194
226
) ;
227
+
228
+ if ( this . options . gShowIntersection ) {
229
+ const spointEvaluated = spoint2 (
230
+ this . options . gA1 , this . options . gA2 , this . options . gA3 ,
231
+ this . options . gA4 , this . options . gA5 , this . options . gA6 ) ;
232
+
233
+ this . showIntersection (
234
+ this . board . create ( 'line' , [
235
+ shint2 (
236
+ this . options . gA1 , this . options . gA2 , this . options . gA3 ,
237
+ this . options . gA4 , this . options . gA5 , this . options . gA6 ) ,
238
+ spointEvaluated
239
+ ] , {
240
+ visible : false
241
+ } ) ,
242
+ this . board . create ( 'line' , [
243
+ svint2 (
244
+ this . options . gA1 , this . options . gA2 , this . options . gA3 ,
245
+ this . options . gA4 , this . options . gA5 , this . options . gA6 ) ,
246
+ spointEvaluated
247
+ ] , {
248
+ visible : false
249
+ } ) ,
250
+ false , 'Social' , null , 'Q<sup>soc</sup>' ,
251
+ false , false , this . l1Color ) ;
252
+
253
+ const epointEvaluated = epoint2 (
254
+ this . options . gA1 , this . options . gA2 , this . options . gA3 ,
255
+ this . options . gA4 ) ;
256
+
257
+ this . showIntersection (
258
+ this . board . create ( 'line' , [
259
+ ehint2 (
260
+ this . options . gA1 , this . options . gA2 , this . options . gA3 ,
261
+ this . options . gA4 ) ,
262
+ epointEvaluated
263
+ ] , {
264
+ visible : false
265
+ } ) ,
266
+ this . board . create ( 'line' , [
267
+ evint2 (
268
+ this . options . gA1 , this . options . gA2 , this . options . gA3 ,
269
+ this . options . gA4 ) ,
270
+ epointEvaluated
271
+ ] , {
272
+ visible : false
273
+ } ) ,
274
+ false , 'Market' , null , 'Q' ,
275
+ false , false , this . l4Color ) ;
276
+ }
195
277
}
196
278
}
197
279
0 commit comments