Post Reply 
How to graph Taylor series on the Prime
07-13-2021, 02:44 PM (This post was last modified: 08-01-2021 07:00 AM by C.Ret.)
Post: #6
RE: How to graph Taylor series on the Prime
(07-11-2021 01:06 PM)roadrunner Wrote:  These commands will recreate that plot:

Thank you for your input ! I was in trouble finding any explaination in the Reference User Manual and was planning using the ptayl function like in this code:

EXPORT PLTYR(Fct,x0,a,b,s)
// Plot F(X) in slot F0 and taylor polynomials
// from order a to b by step of s
//
// Don't forget to enter function
// as single or double quoted expression
// 'SIN(X)' or SIN('X') or "SIN(X)"
BEGIN
// --- Start FUNCTION application ---
STARTAPP("Function");
LOCAL sFct:=REPLACE(STRING(Fct),"X","'X'");
LOCAL k,f;

F0:=EXPR(sFct); CHECK(0); UNCHECK({1,2,3,4,5,6,7,8,9});
FOR k FROM a TO b STEP s DO
f:=1+(k-a)/s;
IF 1≤f AND f≤9 THEN
EVAL(EXPR("F"+f+":=ptayl("+sFct+","+x0+","+k+")"));
CHECK(f)
END;
END;
// --- center plot & square zoom ---
LOCAL h:=Xmax-Ymin, y0:=F0(x0);
// center plot on (x0,y0) coordinates
Xmin:=x0-2*h/3; Xmax:=x0+2*h/3;
Ymin:=y0-h/2; Ymax:=y0+h/2;

STARTVIEW(1);
END;

// --- Alternative Forms Table ---
// 1 argument : PLTYR('F(X)')
EXPORT PLTYR(Fct)
BEGIN PLTYR(Fct, 0,1,9,1) END;
// 2 arguments: PLTYR('F(X)','x0')
EXPORT PLTYR(Fct,x0)
BEGIN PLTYR(Fct,x0,1,9,1) END;
// 3 arguments: PLTYR('F(X)','x0',u) plot only F(X) and one taylor term of order u
EXPORT PLTYR(Fct,x0,m)
BEGIN PLTYR(Fct,x0,m,m,1) END;
// 4 arguments: PLTYR('F(X)','x0',a,b) plot F(X) and a set taylor curve from order a to b inclusive
EXPORT PLTYR(Fct,x0,a,b)
BEGIN PLTYR(Fct,x0,a,b,1) END;


I am just curious about where did you find the documentation about the 'polynom' option of the TAYLOR function ?
Also, is there a way to program the color of the curves for any slot F1 to F0 ?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to graph Taylor series on the Prime - C.Ret - 07-13-2021 02:44 PM



User(s) browsing this thread: 1 Guest(s)