Message Boards Message Boards

GROUPS:

How to modify the code to make the function image clear?

Posted 2 months ago
521 Views
|
5 Replies
|
1 Total Likes
|

How to modify the code so that the abscissa and ordinate of the original function and derivative function are adaptive in the same coordinate system so that the displayed image size is appropriate and the form of the function image can be felt as a whole

ClearAll@f;

f[x_] := Log[x]/-x^2

Manipulate[Refresh[functions = Table[D[f[x], {x, n}], {n, 0, nMax, 1}];
  orders = 
   Table[D[f[x], {x, n}] // Inactivate // TraditionalForm // 
     ToString, {n, 0, nMax, 1}];
  labels = 
   MapThread[#1 <> " = " <> ToString[#2, TraditionalForm] &, {orders, 
     functions}];];
 Plot[functions, {x, 0, 1}, PlotLabels -> labels, PlotRange -> All, 
  ImageSize -> 700, AspectRatio -> 1, 
  PlotLabel -> Row[{"f(x) = ", f[x]}]], {{nMax, 1, "Order"}, 1, 10, 1,
   PopupMenu}]
POSTED BY: lee tao
5 Replies
Posted 2 months ago

The previous effect is like this, which obviously does not meet the requirements

enter image description here

POSTED BY: lee tao
Posted 2 months ago

The problem is that the functions depend inversely on x so they diverge as x -> 0. Try removing PlotRange -> All.

POSTED BY: Rohit Namjoshi
Posted 2 months ago
ClearAll@f;

f[x_] := Log[x]/-x^2
Manipulate[Refresh[functions = Table[D[f[x], {x, n}], {n, 0, nMax, 1}];
  orders = 
   Table[D[f[x], {x, n}] // Inactivate // TraditionalForm // 
     ToString, {n, 0, nMax, 1}];
  labels = 
   MapThread[#1 <> " = " <> ToString[#2, TraditionalForm] &, {orders, 
     functions}];];
 Plot[functions, {x, 0, 13}, PlotLabels -> labels, ImageSize -> 700, 
  AspectRatio -> 1, 
  PlotLabel -> Row[{"f(x) = ", f[x]}]], {{nMax, 1, "Order"}, 1, 10, 1,
   PopupMenu}]
POSTED BY: lee tao
Posted 2 months ago

enter image description here

POSTED BY: lee tao
Posted 2 months ago

Set to equal horizontal and vertical coordinates

ClearAll@f;

f[x_] := x Log[x]
Manipulate[Refresh[functions = Table[D[f[x], {x, n}], {n, 0, nMax, 1}];
  orders = 
   Table[D[f[x], {x, n}] // Inactivate // TraditionalForm // 
     ToString, {n, 0, nMax, 1}];
  labels = 
   MapThread[#1 <> " = " <> ToString[#2, TraditionalForm] &, {orders, 
     functions}];];
 Plot[functions, {x, 0, 5}, PlotLabels -> labels, ImageSize -> 700, 
  AspectRatio -> Automatic, 
  PlotLabel -> Row[{"f(x) = ", f[x]}]], {{nMax, 1, "Order"}, 1, 10, 1,
   PopupMenu}]
POSTED BY: lee tao
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract