1

How can I label the maximum point in a line chart using Maxima?

I have the code below in which I am plotting T(t):

draw2d(
xlabel = "t",
ylabel = "T",
explicit(ev(T), t, 0, 0.99));

However, I want to label in the chart, the point where t maximizes T. I solved the t that maximizes T as following:

opttr: diff(T,t,1)=0;
float(solve (opttr,t));

And I want this optimal t to be labeled in the Chart.

The full code can be found below.

kill(all);
assume(w >0);
assume(1- t >0);
N1:4;
N5:7;
w:5100;
p: (N1+ N5 + 5)*(1-t);

/* Enter the production function  */
Y: 500*(N1+ N5 + 20)*L^(0.5);

/* Enter the profit function  */
Profit: p*Y - w*L;

/* Calculate f.o.c */
eq1: diff(Profit,L,1) = 0;
float(solve (eq1,L));
L : rhs(%[1]);

/* Calculate tax revenue T(t) as a function of t */
T: t*p*ev(Y);

/* Find optimal tax */
opttr: diff(T,t,1)=0;
float(solve (opttr,t));
draw2d(
xlabel = "t",
ylabel = "T",
explicit(ev(T), t, 0, 0.99));
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Macosso
  • 1,352
  • 5
  • 22
  • I think maybe what you want is `draw2d(..., points([xoptimal, yoptimal]))` where `[xoptimal, yoptimal]` is the point at which the function reaches its maximum. `? points` will show some info about it. – Robert Dodier Nov 12 '21 at 17:29

0 Answers0