diff options
4 files changed, 248 insertions, 0 deletions
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_epsilon_delta_defn.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_epsilon_delta_defn.py new file mode 100644 index 0000000..63b6165 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file1_epsilon_delta_defn.py @@ -0,0 +1,120 @@ +from manimlib.imports import *
+
+class EpsilonDelta(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes() # creates a 3D Axis
+
+
+ sphere = ParametricSurface(
+ lambda u, v: np.array([
+ 2*np.sin(u)*np.cos(v),
+ 2*np.sin(u)*np.sin(v),
+ 2*np.cos(u)
+ ]),u_min=0,u_max=PI/4,v_min=0,v_max=PI/2,checkerboard_colors=[RED_D, RED_E],
+ resolution=(15, 32)).scale(2)
+ #sphere.shift(0.5*RIGHT+0.5*UP)
+
+ #self.set_camera_orientation(phi=0*DEGREES,theta=270*DEGREES)
+ self.set_camera_orientation(phi=75 * DEGREES)
+
+
+
+ circle = Circle(radius= 0.4,color = GREEN)
+ circle.shift(0.5*RIGHT+0.5*UP)
+
+ line1 = DashedLine(np.array([0.5, 0.1,0]), np.array([0.5, 0.1,2.1]), color = BLUE_E)
+ line2 = DashedLine(np.array([0.5, 0.9,0]), np.array([0.5, 0.9,1.7]), color = BLUE_E)
+ line3 = DashedLine(np.array([0, 0,2.1]), np.array([0.5, 0.1,2.1]), color = YELLOW_C)
+ line4 = DashedLine(np.array([0, 0,1.7]), np.array([0.5, 0.9,1.7]), color = YELLOW_C)
+
+ dot1 = Sphere()
+ dot1.scale(0.01)
+ dot1.move_to(np.array([0,0,1.9]))
+ dot1.set_fill(BLUE_E)
+
+ temp_func1 = TextMobject(r"$L$")
+ temp_func1.scale(0.6)
+ temp_func1.set_color(BLUE_E)
+
+ dot2 = Sphere()
+ dot2.scale(0.01)
+ dot2.move_to(np.array([0,0,1.7]))
+ dot2.set_fill(PURPLE)
+
+ temp_func2 = TextMobject(r"$L - \epsilon$")
+ temp_func2.scale(0.6)
+ temp_func2.set_color(PURPLE)
+
+ dot3 = Sphere()
+ dot3.scale(0.01)
+ dot3.move_to(np.array([0,0,2.1]))
+ dot3.set_fill(PURPLE)
+
+ temp_func3 = TextMobject(r"$L + \epsilon$")
+ temp_func3.scale(0.6)
+ temp_func3.set_color(PURPLE)
+
+ self.add(axes)
+
+ self.play(ShowCreation(dot1))
+ self.add_fixed_in_frame_mobjects(temp_func1)
+ temp_func1.move_to(1.9*UP)
+ self.play(Write(temp_func1))
+
+ self.play(ShowCreation(dot2))
+ self.add_fixed_in_frame_mobjects(temp_func2)
+ temp_func2.move_to(1.7*UP)
+ self.play(Write(temp_func2))
+
+ self.play(ShowCreation(dot3))
+ self.add_fixed_in_frame_mobjects(temp_func3)
+ temp_func3.move_to(2.1*UP)
+ self.play(Write(temp_func3))
+
+
+ circle_center = Sphere()
+ circle_center.scale(0.05)
+ circle_center.move_to(np.array([0.5,0.5,0]))
+ circle_center.set_fill(GREEN)
+
+ temp_circle_center = TextMobject(r"$(a,b,0)$")
+ temp_circle_center.scale(0.5)
+ temp_circle_center.set_color(GREEN)
+
+ curve_circle_center = Sphere()
+ curve_circle_center.scale(0.05)
+ curve_circle_center.move_to(np.array([0.5,0.5,1.9]))
+ curve_circle_center.set_fill(BLUE_E)
+
+ temp_curve_circle_center = TextMobject(r"$(a,b,L)$")
+ temp_curve_circle_center.scale(0.5)
+ temp_curve_circle_center.set_color(BLUE)
+
+ delta_lab = TextMobject(r"$\delta - disk$")
+ delta_lab.scale(0.5)
+ delta_lab.set_color(PINK)
+
+ self.play(ShowCreation(circle_center))
+ self.add_fixed_in_frame_mobjects(temp_circle_center)
+ temp_circle_center.move_to(1.5*RIGHT)
+ self.play(Write(temp_circle_center))
+
+ self.play(ShowCreation(curve_circle_center))
+ self.add_fixed_in_frame_mobjects(temp_curve_circle_center)
+ temp_curve_circle_center.move_to(1.9*UP+1*RIGHT)
+ self.play(Write(temp_curve_circle_center))
+
+
+ self.add_fixed_in_frame_mobjects(delta_lab)
+ delta_lab.move_to(0.4*DOWN+1.7*RIGHT)
+ self.play(Write(delta_lab))
+
+
+
+
+
+ self.begin_ambient_camera_rotation(rate=0.2)
+ self.play(Write(sphere))
+ self.play(ShowCreation(circle), ShowCreation(line1), ShowCreation(line2))
+ self.play(ShowCreation(line3), ShowCreation(line4))
+ self.wait(8)
diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file2_limit_approach_point.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file2_limit_approach_point.py new file mode 100644 index 0000000..57d1d45 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file2_limit_approach_point.py @@ -0,0 +1,66 @@ +from manimlib.imports import *
+
+class Limit(GraphScene):
+ CONFIG = {
+ "x_min": 0,
+ "x_max": 4,
+ "y_min": 0,
+ "y_max": 4,
+ "graph_origin": ORIGIN + 3* DOWN+4*LEFT,
+ "x_labeled_nums": list(range(0, 4)),
+ "y_labeled_nums": list(range(0, 5)),
+ }
+ def construct(self):
+ topic = TextMobject("Different paths of approach to limit point")
+ topic.scale(1.5)
+ topic.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+ self.play(Write(topic))
+ self.wait(1)
+ self.play(FadeOut(topic))
+
+
+
+ XTD = self.x_axis_width/(self.x_max- self.x_min)
+ YTD = self.y_axis_height/(self.y_max- self.y_min)
+
+ self.setup_axes(animate = True)
+
+ y_x = self.get_graph(lambda x : x, x_min = -1, x_max = 4)
+ y_x_lab = self.get_graph_label(y_x, label = r"y = x")
+
+ y_xsquare = self.get_graph(lambda x : x*x, x_min = -1, x_max = 4)
+ y_xsquare_lab = self.get_graph_label(y_xsquare, label = r"y = x^2")
+
+ y_1 = self.get_graph(lambda x : 1, x_min = -1, x_max = 4)
+ y_1_lab = self.get_graph_label(y_1, label = r"y = 1")
+
+ y_2minusx = self.get_graph(lambda x : 2 - x, x_min = -1, x_max = 4, color = RED)
+ y_2minusx_lab = self.get_graph_label(y_2minusx, label = r"y = 2 - x")
+
+ limit_point = Dot().shift(self.graph_origin+1*XTD*RIGHT+1*YTD*UP)
+ limit_point_lab = TextMobject(r"(1,1)")
+ limit_point_lab.next_to(limit_point, DOWN)
+
+ self.play(ShowCreation(limit_point))
+ self.play(Write(limit_point_lab))
+ self.wait(1)
+
+ self.play(ShowCreation(y_x))
+ self.play(Write(y_x_lab))
+ self.wait(1)
+
+ self.play(ShowCreation(y_xsquare))
+ self.play(Write(y_xsquare_lab))
+ self.wait(1)
+
+ self.play(ShowCreation(y_1))
+ self.play(Write(y_1_lab))
+ self.wait(1)
+
+ self.play(ShowCreation(y_2minusx))
+ self.play(Write(y_2minusx_lab))
+ self.wait(1)
+
+
+
+
\ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file3_limit_func.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file3_limit_func.py new file mode 100644 index 0000000..02e00e8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file3_limit_func.py @@ -0,0 +1,30 @@ +from manimlib.imports import *
+
+class LimitFunc(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes()
+
+ text3d = TextMobject(r"$f(x,y) = \frac{x^2 - y^2}{x^2 + y^2}$")
+ self.add_fixed_in_frame_mobjects(text3d)
+
+ text3d.to_corner(UL)
+
+ text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+
+ self.play(Write(text3d))
+ self.wait(1)
+
+ limit_func = ParametricSurface(
+ lambda u, v: np.array([
+ u*np.cos(v),
+ u*np.sin(v),
+ (np.cos(v)*np.cos(v) - np.sin(v)*np.sin(v))/3
+ ]),u_min=-3,u_max=3,v_min=0,v_max=2*PI,checkerboard_colors=[YELLOW_C, YELLOW_E],
+ resolution=(15, 32)).scale(2)
+
+ self.set_camera_orientation(phi=80 * DEGREES)
+ self.begin_ambient_camera_rotation(rate=0.3)
+
+ self.add(axes)
+ self.play(Write(limit_func))
+ self.wait(10)
\ No newline at end of file diff --git a/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file4_continuity_func.py b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file4_continuity_func.py new file mode 100644 index 0000000..551c8a8 --- /dev/null +++ b/FSF-2020/calculus-of-several-variables/multivariable-functions-and-paritial-derivatives/limits-and-continuity-of-multivariable-functions/file4_continuity_func.py @@ -0,0 +1,32 @@ +from manimlib.imports import *
+
+class ContinuityFunc(ThreeDScene):
+ def construct(self):
+ axes = ThreeDAxes()
+
+ text3d = TextMobject(r"$f(x,y) = \frac{3x^2y}{x^2 + y^2}$")
+ self.add_fixed_in_frame_mobjects(text3d)
+
+ text3d.to_corner(UL)
+
+ text3d.set_color_by_gradient(RED, ORANGE, YELLOW, GREEN, BLUE, PURPLE)
+
+ self.play(Write(text3d))
+ self.wait(1)
+
+ continuity_func = ParametricSurface(
+ lambda u, v: np.array([
+ u*np.cos(v),
+ u*np.sin(v),
+ 3*u*np.cos(v)*np.cos(v)*np.sin(v)
+ ]),u_min=-1.5,u_max=1.5,v_min=0,v_max=2*PI,checkerboard_colors=[YELLOW_C, YELLOW_E],
+ resolution=(15, 32)).scale(2)
+
+
+
+ self.set_camera_orientation(phi=80 * DEGREES)
+ self.begin_ambient_camera_rotation(rate=0.3)
+
+ self.add(axes)
+ self.play(Write(continuity_func))
+ self.wait(8)
\ No newline at end of file |