summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus/series-and-transformations/Taylor Series
diff options
context:
space:
mode:
Diffstat (limited to 'FSF-2020/calculus/series-and-transformations/Taylor Series')
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/README.md11
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdfbin119804 -> 125254 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file1_Example_TaylorExpansion.gifbin0 -> 667237 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2_TaylorExpansionGeneralForm.gifbin0 -> 640160 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gifbin0 -> 640160 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file3_radiusOfConvergence.gifbin0 -> 609653 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file4_DivergentRemainder.gifbin0 -> 400593 bytes
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py (renamed from FSF-2020/calculus/series-and-transformations/Taylor Series/script1.py)83
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/video2_TaylorExpansionGeneralForm.py (renamed from FSF-2020/calculus/series-and-transformations/Taylor Series/script2.py)107
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/video3_radiusOfConvergence.py (renamed from FSF-2020/calculus/series-and-transformations/Taylor Series/script3.py)22
-rw-r--r--FSF-2020/calculus/series-and-transformations/Taylor Series/video4_DivergentRemainder.py (renamed from FSF-2020/calculus/series-and-transformations/Taylor Series/script4.py)9
11 files changed, 156 insertions, 76 deletions
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/README.md b/FSF-2020/calculus/series-and-transformations/Taylor Series/README.md
new file mode 100644
index 0000000..88eb772
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/README.md
@@ -0,0 +1,11 @@
+#### Example of Taylors expansion
+![GIF1](gifs/file1_Example_TaylorExpansion.gif)
+
+#### Taylor Series GeneralForm
+![GIF2](gifs/file2a_TaylorExpansionGeneralForm.gif)
+
+#### Radius Of Convergence
+![GIF3](gifs/file3_radiusOfConvergence.gif)
+
+#### Divergence of a Remainder
+![GIF4](gifs/file4_DivergentRemainder.gif)
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdf b/FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdf
index 2096f52..46d46e1 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdf
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/TaylorSeriesQuestions.pdf
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file1_Example_TaylorExpansion.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file1_Example_TaylorExpansion.gif
new file mode 100644
index 0000000..4272d84
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file1_Example_TaylorExpansion.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2_TaylorExpansionGeneralForm.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2_TaylorExpansionGeneralForm.gif
new file mode 100644
index 0000000..33dfa81
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2_TaylorExpansionGeneralForm.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gif
new file mode 100644
index 0000000..33dfa81
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file2a_TaylorExpansionGeneralForm.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file3_radiusOfConvergence.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file3_radiusOfConvergence.gif
new file mode 100644
index 0000000..9e53cfb
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file3_radiusOfConvergence.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file4_DivergentRemainder.gif b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file4_DivergentRemainder.gif
new file mode 100644
index 0000000..0bc8b65
--- /dev/null
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/gifs/file4_DivergentRemainder.gif
Binary files differ
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/script1.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py
index e83eff8..a0c7176 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/script1.py
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video1_Example_TaylorExpansion.py
@@ -31,7 +31,7 @@ class intro(Scene):
self.wait(0.7)
self.play(FadeOut(equation),FadeOut(text))
-class graphScene(GraphScene):
+class graphScene(GraphScene,MovingCameraScene):
CONFIG = {
"x_min": -8,
"x_max": 8,
@@ -45,10 +45,25 @@ class graphScene(GraphScene):
"exclude_zero_label": True,
"x_labeled_nums": range(-8, 8, 1),
}
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
def construct(self):
x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ equation=TextMobject("$f(x)=$","${ e }^{ -x^{ 2 } }$")
+ equation.scale(0.55)
+ equation.set_color_by_tex_to_color_map({"${ e }^{ -x^{ 2 } }$":RED})
+ text=TextMobject("$a=0$")
+ text.scale(0.55)
+
+ equation.shift(3.39*UP+5*LEFT)
+ text.shift(2.9*UP+5*LEFT)
+
+ self.add(equation)
+ self.add(text)
+
generalized_eq_coeff=[]
variables_eq=[]
eq,generalized_eq_coeff=formFormula(generalized_eq_coeff,variables_eq)
@@ -58,7 +73,7 @@ class graphScene(GraphScene):
trTextGrup.scale(0.5)
trTextGrup.to_corner(UP+RIGHT)
self.play(Write(trTextGrup))
- self.setup_axes(animate=True)
+ self.setup_axes(animate=True,scalee=1)
fx=TextMobject("${ e }^{ -x^{ 2 } }$")
fx.scale(0.5)
@@ -66,18 +81,20 @@ class graphScene(GraphScene):
mainfunction=self.get_graph(lambda x:math.exp(-1*pow(x,2)),color=RED,x_min=-8,x_max=8)
self.play(ShowCreation(mainfunction))
self.play(FadeIn(fx))
- self.wait(1.4)
+ self.wait(1)
coeff=[TextMobject("$1$"),TextMobject("$f'(x)$"),TextMobject("$\\frac { f''(x) }{ 2! } $")]
coeff[0].shift(3.39*UP+4.88*RIGHT)
coeff[0].scale(0.5)
- coeff[1].shift(3.39*UP+5.3*RIGHT)
+ coeff[1].shift(3.39*UP+5.4*RIGHT)
coeff[1].scale(0.275)
- coeff[2].shift(3.39*UP+5.98*RIGHT)
+ coeff[2].shift(3.39*UP+6*RIGHT)
coeff[2].scale(0.28)
for obj in coeff:
obj.set_color(GOLD_A)
+ group=VGroup(coeff[0],coeff[1],coeff[2])
+
firstApprox=[self.get_graph(lambda x:1,color=BLUE)]
secondApprox=[self.get_graph(lambda x:1,color=BLUE),
@@ -124,16 +141,37 @@ class graphScene(GraphScene):
bottomText8.scale(0.5)
bottomText1.shift(4.5*RIGHT+2.5*DOWN)
- bottomText2.shift(4.5*RIGHT+2.5*DOWN)
- bottomText3.shift(4.5*RIGHT+2.5*DOWN)
- bottomText4.shift(4.5*RIGHT+2.5*DOWN)
- bottomText5.shift(4.5*RIGHT+2.5*DOWN)
- bottomText6.shift(4.5*RIGHT+2.5*DOWN)
- bottomText7.shift(4.5*RIGHT+2.5*DOWN)
- bottomText8.shift(4.5*RIGHT+2.5*DOWN)
+ bottomText2.shift(3*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText3.shift(3*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText4.shift(3*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText5.shift(3*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText6.shift(3.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText7.shift(3.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText8.shift(3.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+
+ bottomText2.scale(0.7)
+ bottomText3.scale(0.7)
+ bottomText4.scale(0.7)
+ bottomText5.scale(0.7)
+ bottomText6.scale(0.7)
+ bottomText7.scale(0.7)
+ bottomText8.scale(0.7)
self.play(Write(bottomText1))
- self.wait(1)
+ self.wait(0.8)
+ #self.activate_zooming(animate=True)
+ self.camera_frame.save_state()
+ group.move_to(4*y_each_unit*UP+4.6*RIGHT*x_each_unit).scale(0.7)
+ self.play(self.camera_frame.set_width, 8,
+ self.camera_frame.move_to, x_each_unit*UP,
+ ApplyMethod(trTextGrup.move_to,4*y_each_unit*UP+4.1*RIGHT*x_each_unit),
+ ApplyMethod(bottomText1.move_to,3.4*RIGHT*x_each_unit+2.5*DOWN*y_each_unit),
+ ApplyMethod(equation.shift,1.39*DOWN+2*RIGHT),
+ ApplyMethod(text.shift,1.39*DOWN+2*RIGHT),)
+ self.play(ApplyMethod(text.scale,0.5),ApplyMethod(equation.scale,0.5),ApplyMethod(bottomText1.scale,0.6),ApplyMethod(trTextGrup.scale,0.7))
+ self.play(ApplyMethod(text.shift,0.3*UP))
+ self.wait(0.6)
+
self.play(ShowCreation(firstApprox[0]),ReplacementTransform(bottomText1,bottomText2))
#change coeff in tn(x)
self.play(ReplacementTransform(generalized_eq_coeff[0],coeff[0]))
@@ -170,10 +208,12 @@ class graphScene(GraphScene):
self.wait(2)
textFinal=TextMobject("And so on..!")
- textFinal.scale(0.7)
- textFinal.shift(4.5*RIGHT+2.5*DOWN)
+ textFinal.scale(0.35)
+ textFinal.shift(3.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
self.play(ReplacementTransform(bottomText8,textFinal))
- self.wait(2.5)
+ self.wait(1)
+ self.play(FadeOut(equation),FadeOut(text))
+ self.play(self.camera_frame.set_width, 15)
finalFormula=TextMobject("Hence","$T_{ n }(x)$","=","$f(0)+f'(0)x+\\frac { f''(0) }{ 2! }x^2+..+\\frac { { f }^{ n }(0) }{ n! } { x }^{ n }$")
finalFormula.scale(0.8)
@@ -182,16 +222,7 @@ class graphScene(GraphScene):
self.play(FadeOut(self.axes),FadeOut(textFinal),FadeOut(secondGraph),FadeOut(trTextGrup),FadeOut(mainfunction),FadeOut(fx),FadeOut(coeff[0]),FadeOut(coeff[1]),FadeOut(coeff[2]))
self.play(Write(finalFormula))
self.wait(2)
- # self.play(ReplacementTransform(secondApprox[2],secondApprox[3]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[3],secondApprox[4]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[4],secondApprox[5]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[0],secondApprox[0]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[0],secondApprox[0]))
- # self.wait(0.5)
+
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/script2.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video2_TaylorExpansionGeneralForm.py
index b5d0a53..5be336b 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/script2.py
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video2_TaylorExpansionGeneralForm.py
@@ -7,7 +7,7 @@ class intro(Scene):
equation=TextMobject("$f(x)=$","${ e }^{ -x^{ 2 } }$")
equation.scale(2)
equation.set_color_by_tex_to_color_map({"${ e }^{ -x^{ 2 } }$":RED})
- text=TextMobject("at $a=1$")
+ text=TextMobject("about $x=1$")
text.scale(0.7)
text.shift(DOWN)
@@ -41,7 +41,7 @@ def formFormula(coeff_list,variable_list):
return expansion,coeff_list
-class graphScene(GraphScene):
+class graphScene(GraphScene,MovingCameraScene):
CONFIG = {
"x_min": -8,
"x_max": 8,
@@ -55,10 +55,25 @@ class graphScene(GraphScene):
"exclude_zero_label": True,
"x_labeled_nums": range(-8, 8, 1),
}
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
def construct(self):
x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
+ equation=TextMobject("$f(x)=$","${ e }^{ -x^{ 2 } }$")
+ equation.scale(0.55)
+ equation.set_color_by_tex_to_color_map({"${ e }^{ -x^{ 2 } }$":RED})
+ text=TextMobject("about $x=1$")
+ text.scale(0.55)
+ equation.shift(3.39*UP+5*LEFT)
+ text.shift(3*UP+5*LEFT)
+
+ self.add(equation)
+ self.add(text)
+
+
generalized_eq_coeff=[]
variables_eq=[]
eq,generalized_eq_coeff=formFormula(generalized_eq_coeff,variables_eq)
@@ -68,7 +83,7 @@ class graphScene(GraphScene):
trTextGrup.scale(0.5)
trTextGrup.to_corner(UP+RIGHT)
self.play(Write(trTextGrup))
- self.setup_axes(animate=True)
+ self.setup_axes(animate=True,scalee=1)
fx=TextMobject("${ e }^{ -x^{ 2 } }$")
fx.scale(0.5)
@@ -79,29 +94,29 @@ class graphScene(GraphScene):
self.wait(1.4)
coeff=[TextMobject("$e^{-1}$"),TextMobject("$f'(x)$"),TextMobject("$\\frac { f''(x) }{ 2! } $")]
- coeff[0].shift(3.33*UP+3.65*RIGHT)
- coeff[0].scale(0.45)
- coeff[1].shift(3.33*UP+4.13*RIGHT)
- coeff[1].scale(0.275)
- coeff[2].shift(3.33*UP+5.36*RIGHT)
- coeff[2].scale(0.28)
+ coeff[0].shift(4.1*y_each_unit*UP+5.15*RIGHT*x_each_unit)
+ coeff[0].scale(0.3)
+ coeff[1].shift(4*y_each_unit*UP+5.7*RIGHT*x_each_unit)
+ coeff[1].scale(0.2)
+ coeff[2].shift(4*y_each_unit*UP+7.3*RIGHT*x_each_unit)
+ coeff[2].scale(0.18)
for obj in coeff:
obj.set_color(GOLD_A)
- firstApprox=[self.get_graph(lambda x:math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5)]
- secondApprox=[self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5),
- self.get_graph(lambda x:math.exp(-1)+3*(x-1)*math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5),
- self.get_graph(lambda x:math.exp(-1)-4*(x-1)*math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5)]
- thirdApprox=[self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)-2*math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5),
- self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)-0.1*math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5),
- self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_max=5.5,x_min=-5.5),
- self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+0.5*math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5),
- self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+2*math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5)]
+ firstApprox=[self.get_graph(lambda x:math.exp(-1),color=BLUE,x_min=-3,x_max=4)]
+ secondApprox=[self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_min=-3,x_max=4),
+ self.get_graph(lambda x:math.exp(-1)+3*(x-1)*math.exp(-1),color=BLUE,x_min=-3,x_max=4),
+ self.get_graph(lambda x:math.exp(-1)-4*(x-1)*math.exp(-1),color=BLUE,x_min=-3,x_max=4)]
+ thirdApprox=[self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)-2*math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3),
+ self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)-0.1*math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3),
+ self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_max=4,x_min=-3),
+ self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+0.5*math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3),
+ self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+2*math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3)]
- firstGraph=self.get_graph(lambda x:math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5)
- secondGraph=self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_min=-5.5,x_max=5.5)
- thirdGraph=self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+math.exp(-1)*(x-1)**2,color=BLUE,x_max=5.5,x_min=-5.5)
+ firstGraph=self.get_graph(lambda x:math.exp(-1),color=BLUE,x_min=-3,x_max=4)
+ secondGraph=self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1),color=BLUE,x_min=-3,x_max=4)
+ thirdGraph=self.get_graph(lambda x:math.exp(-1)-2*(x-1)*math.exp(-1)+math.exp(-1)*(x-1)**2,color=BLUE,x_max=4,x_min=-3)
bottomText1=TextMobject("Apply","$f(1)=T_{n}(1)$")
bottomText2=TextMobject("This gives","$a_{ 0 }=e^{-1}$")
@@ -135,16 +150,35 @@ class graphScene(GraphScene):
bottomText8.scale(0.5)
bottomText1.shift(4.5*RIGHT+2.5*DOWN)
- bottomText2.shift(4.5*RIGHT+2.5*DOWN)
- bottomText3.shift(4.5*RIGHT+2.5*DOWN)
- bottomText4.shift(4.5*RIGHT+2.5*DOWN)
- bottomText5.shift(4.5*RIGHT+2.5*DOWN)
- bottomText6.shift(4.5*RIGHT+2.5*DOWN)
- bottomText7.shift(4.5*RIGHT+2.5*DOWN)
- bottomText8.shift(4.5*RIGHT+2.5*DOWN)
+ bottomText2.shift(5*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText3.shift(5*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText4.shift(5*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText5.shift(5*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText6.shift(5.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText7.shift(5.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+ bottomText8.shift(5.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
+
+ bottomText2.scale(0.7)
+ bottomText3.scale(0.7)
+ bottomText4.scale(0.7)
+ bottomText5.scale(0.7)
+ bottomText6.scale(0.7)
+ bottomText7.scale(0.7)
+ bottomText8.scale(0.7)
self.play(Write(bottomText1))
- self.wait(1)
+ self.wait(0.8)
+ self.camera_frame.save_state()
+ self.play(self.camera_frame.set_width, 8,
+ self.camera_frame.move_to, x_each_unit*UP+x_each_unit*2*RIGHT,
+ ApplyMethod(trTextGrup.move_to,4*y_each_unit*UP+6.1*RIGHT*x_each_unit),
+ ApplyMethod(bottomText1.move_to,5.4*RIGHT*x_each_unit+2.5*DOWN*y_each_unit),
+ ApplyMethod(equation.shift,1.39*DOWN+2*RIGHT+RIGHT*x_each_unit*2),
+ ApplyMethod(text.shift,1.39*DOWN+2*RIGHT+RIGHT*x_each_unit*2),)
+ self.play(ApplyMethod(text.scale,0.5),ApplyMethod(equation.scale,0.5),ApplyMethod(bottomText1.scale,0.6),ApplyMethod(trTextGrup.scale,0.7))
+ self.play(ApplyMethod(text.shift,0.25*UP))
+ self.wait(0.6)
+
self.play(ShowCreation(firstApprox[0]),ReplacementTransform(bottomText1,bottomText2))
#change coeff in tn(x)
self.play(ReplacementTransform(generalized_eq_coeff[0],coeff[0]))
@@ -154,8 +188,6 @@ class graphScene(GraphScene):
self.play(ReplacementTransform(firstApprox[0],secondApprox[1]))
self.wait(0.5)
self.play(ReplacementTransform(secondApprox[1],secondApprox[2]))
- # self.wait(0.5)
- # self.play(ReplacementTransform(secondApprox[2],secondApprox[0]))
self.wait(1)
self.play(ReplacementTransform(bottomText3,bottomText4),FadeOut(secondApprox[2]))
self.wait(1)
@@ -167,8 +199,6 @@ class graphScene(GraphScene):
self.play(ReplacementTransform(secondGraph,thirdApprox[0]))
self.wait(0.6)
self.play(ReplacementTransform(thirdApprox[0],thirdApprox[1]))
- # self.wait(0.6)
- # self.play(ReplacementTransform(thirdApprox[1],thirdApprox[2]))
self.wait(0.6)
self.play(ReplacementTransform(thirdApprox[1],thirdApprox[3]))
self.wait(0.6)
@@ -181,10 +211,13 @@ class graphScene(GraphScene):
self.wait(2)
textFinal=TextMobject("And so on..!")
- textFinal.scale(0.7)
- textFinal.shift(4.5*RIGHT+2.5*DOWN)
+ textFinal.scale(0.35)
+ textFinal.shift(5.7*RIGHT*x_each_unit+2.5*DOWN*y_each_unit)
self.play(ReplacementTransform(bottomText8,textFinal))
- self.wait(2.5)
+ self.wait(1)
+ self.play(FadeOut(equation),FadeOut(text))
+ self.play(self.camera_frame.set_width, 15,
+ self.camera_frame.move_to, 0)
finalFormula=TextMobject("Hence","$T_{ n }(x)$","=","$f(1)+f'(1)(x-1)+\\frac { f''(1) }{ 2! }(x-1)^2+..+\\frac { { f }^{ n }(1) }{ n! } { (x-1) }^{ n }$")
finalFormula.scale(0.8)
@@ -192,4 +225,4 @@ class graphScene(GraphScene):
self.play(FadeOut(self.axes),FadeOut(textFinal),FadeOut(thirdGraph),FadeOut(trTextGrup),FadeOut(mainfunction),FadeOut(fx),FadeOut(coeff[0]),FadeOut(coeff[1]),FadeOut(coeff[2]))
self.play(Write(finalFormula))
- self.wait(2) \ No newline at end of file
+ self.wait(2)
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/script3.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video3_radiusOfConvergence.py
index a2870d4..52f07bb 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/script3.py
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video3_radiusOfConvergence.py
@@ -2,7 +2,7 @@ from manimlib.imports import*
import math
-class graphScene(GraphScene):
+class graphScene(GraphScene,MovingCameraScene):
CONFIG = {
"x_min": -8,
"x_max": 8,
@@ -16,12 +16,15 @@ class graphScene(GraphScene):
"exclude_zero_label": True,
"x_labeled_nums": range(-8, 8, 1),
}
+ def setup(self):
+ GraphScene.setup(self)
+ MovingCameraScene.setup(self)
def construct(self):
x_each_unit = self.x_axis_width / (self.x_max - self.x_min)
y_each_unit = self.y_axis_height / (self.y_max - self.y_min)
- self.setup_axes(animate=True)
+ self.setup_axes(animate=True,scalee=1)
lnx=self.get_graph(lambda x:math.log2(x),color=RED,x_min=0.01,x_max=8)
@@ -98,14 +101,23 @@ class graphScene(GraphScene):
circle=Circle(radius=ORIGIN+x_each_unit*2,color=PURPLE_E)
circle.shift(ORIGIN+RIGHT*x_each_unit*2)
- radiusLine=Line(start=ORIGIN+x_each_unit*RIGHT*2,end=ORIGIN+x_each_unit*4*RIGHT,color=PURPLE_E)
+ radiusLine=Line(start=ORIGIN+x_each_unit*RIGHT*2,end=ORIGIN+x_each_unit*2*RIGHT+y_each_unit*3*UP,color=PURPLE_E)
radius=TextMobject("$R$")
radius.set_color(RED)
radius.scale(0.5)
- radius.shift(ORIGIN+RIGHT*x_each_unit*2.45+DOWN*y_each_unit*0.6)
+ radius.shift(ORIGIN+RIGHT*x_each_unit*2.45+UP*y_each_unit*2.2)
+ rText=TextMobject("R",":","Radius of Convergence").scale(0.3).shift(x_each_unit*RIGHT*2+UP*y_each_unit*3.3).set_color_by_tex_to_color_map({"R":RED,"Radius of Convergence":YELLOW})
self.play(FadeOut(equations[6]),Write(circle))
self.wait(0.6)
self.play(Write(radiusLine))
self.play(FadeIn(radius))
- self.wait(2) \ No newline at end of file
+ self.wait(0.7)
+ self.camera_frame.save_state()
+ self.play(self.camera_frame.set_width, 8,
+ self.camera_frame.move_to, y_each_unit*UP+x_each_unit*2*RIGHT)
+ self.play(Write(rText))
+ self.wait(1)
+ self.play(self.camera_frame.set_width, 15,
+ self.camera_frame.move_to,0)
+ self.wait(2) \ No newline at end of file
diff --git a/FSF-2020/calculus/series-and-transformations/Taylor Series/script4.py b/FSF-2020/calculus/series-and-transformations/Taylor Series/video4_DivergentRemainder.py
index 1f41c97..6b368da 100644
--- a/FSF-2020/calculus/series-and-transformations/Taylor Series/script4.py
+++ b/FSF-2020/calculus/series-and-transformations/Taylor Series/video4_DivergentRemainder.py
@@ -43,7 +43,6 @@ class graphScene(GraphScene):
bottomText1=TextMobject("$R_{n}(x)=\\frac { d }{ dx } ($","area bounded","$)$")
bottomText1.set_color_by_tex_to_color_map({"area bounded":ORANGE})
- #bottomText2.set_color_by_tex_to_color_map({"area bounded":BLUE})
arrow=TextMobject("$\downarrow$")
arrow.scale(2.5)
arrow.shift(ORIGIN+x_each_unit*RIGHT*9.5+UP*y_each_unit)
@@ -56,12 +55,8 @@ class graphScene(GraphScene):
increasingText.scale(0.4)
bottomText1.scale(0.5)
- #bottomText2.scale(0.5)
- #bottomText3.scale(0.5)
bottomText1.shift(3.5*LEFT+2*DOWN)
- #bottomText2.shift(3.5*LEFT+2.4*DOWN)
- #bottomText3.shift(3.5*LEFT+2.8*DOWN)
dline=DashedLine(start=ORIGIN+8*y_each_unit*UP,end=ORIGIN+8*y_each_unit*DOWN)
dline.shift(ORIGIN+x_each_unit*4*RIGHT)
@@ -72,11 +67,9 @@ class graphScene(GraphScene):
self.play(Write(dline))
self.wait(0.5)
self.play(ShowCreation(area1),ShowCreation(area2),Write(bottomText1))
- # self.play(Write(bottomText2))
- # self.play(FadeIn(bottomText3))
self.play(Write(arrow))
self.wait(0.7)
self.play(Write(increasingText))
self.play(FadeIn(followupText))
self.wait(2)
- \ No newline at end of file
+