From ef2e803f955cc03a4de1034dca2b204460eafacc Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 11:56:09 +0530 Subject: Update and rename FSF-2020/approximations-and-optimizations/Critical Points/example.py to FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py --- .../Critical Points/example.py | 32 ---------------------- .../file 4- f(x,y) = (y-x)(1-2x-3y).py | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/example.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/example.py b/FSF-2020/approximations-and-optimizations/Critical Points/example.py deleted file mode 100644 index 3a41be7..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/example.py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - (v-u)*(1-2*u-3*v) - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py new file mode 100644 index 0000000..72c93b1 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py @@ -0,0 +1,32 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point + d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 + r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) + + #----f(x,y) = (y-x)(1-2x-3y) + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (v-u)*(1-2*u-3*v) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.5) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(d_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(3) -- cgit From 035733edd4208514f9112f3446b79f92824a84b1 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 11:58:31 +0530 Subject: Delete motivation.py --- .../Critical Points/motivation.py | 30 ---------------------- 1 file changed, 30 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/motivation.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py b/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py deleted file mode 100644 index 27354ef..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/motivation.py +++ /dev/null @@ -1,30 +0,0 @@ -from manimlib.imports import* - -class MotivationAnimation(Scene): - def construct(self): - - r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip - b = Brace(r,UP) - r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) - m_text = TextMobject("Metal Strip").shift(3*DOWN) - a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) - a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) - START = [1,0,0] - END = [0,3,0] - l = Line(START,END,color = RED).shift(0.9*DOWN) - a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) - - group1 = VGroup(r_text,b,a,l,a2,a2_text) - f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) - - ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip - - self.play(Write(r)) - self.wait(1) - self.play(ShowCreation(m_text)) - self.wait(1) - self.play(Write(group1)) - self.wait(2) - self.play(FadeOut(group1)) - self.wait(1) - self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) -- cgit From 3c659b3c55cc39fed44a08554ca457ed9ec4cbb3 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 11:58:39 +0530 Subject: Delete theorem.py --- .../Critical Points/theorem.py | 55 ---------------------- 1 file changed, 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/theorem.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py b/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py deleted file mode 100644 index 7c82aa9..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/theorem.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [TEAL_E], - resolution = (20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_E,PURPLE_E], - resolution = (20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate = 0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color = '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) -- cgit From 783a5e218275f3d01b243cc8e7f793208bcfe4f9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 11:58:47 +0530 Subject: Delete types_of_cp.py --- .../Critical Points/types_of_cp.py | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py b/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical Points/types_of_cp.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----graph of first function f(x,y) = -x**2-y**2 - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], - resolution = (20, 20)).scale(1) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----graph of second function f(x,y) = -x**2+y**2 - f2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], - resolution = (20, 20)).scale(1) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----graph of third function f(x,y) = x**2+y**2 - f3 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], - resolution = (20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) -- cgit From 322d35f52839c38f3df5bbb71544ce0b8361b8f8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:04:55 +0530 Subject: Add files via upload --- .../file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 | Bin 0 -> 2542434 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 new file mode 100644 index 0000000..b01d279 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 differ -- cgit From 206e13c581fc949943434e5d0a66626b5732da62 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:08:11 +0530 Subject: Rename file 4- f(x,y) = (y-x)(1-2x-3y).py to file 4_f(x,y) = (y-x)(1-2x-3y).py --- .../file 4- f(x,y) = (y-x)(1-2x-3y).py | 32 ---------------------- .../file 4_f(x,y) = (y-x)(1-2x-3y).py | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py deleted file mode 100644 index 72c93b1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4- f(x,y) = (y-x)(1-2x-3y).py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - (v-u)*(1-2*u-3*v) - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py new file mode 100644 index 0000000..72c93b1 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py @@ -0,0 +1,32 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point + d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 + r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) + + #----f(x,y) = (y-x)(1-2x-3y) + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (v-u)*(1-2*u-3*v) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.5) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(d_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(3) -- cgit From 11fa5f7cbb945530999a2f0f8957fadbcd8a1419 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:12:15 +0530 Subject: Create file 3_Visualization of types of critical points.py --- ... 3_Visualization of types of critical points.py | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py new file mode 100644 index 0000000..f9055e6 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py @@ -0,0 +1,70 @@ +from manimlib.imports import * + +class TypescpAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + #----graph of first function f(x,y) = -x**2-y**2 + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], + resolution = (20, 20)).scale(1) + + r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + #----graph of second function f(x,y) = -x**2+y**2 + f2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], + resolution = (20, 20)).scale(1) + + r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + #----graph of third function f(x,y) = x**2+y**2 + f3 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], + resolution = (20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.add(axes) + self.play(Write(f2),Write(d)) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.play(FadeOut(r3_text)) + self.add(axes) + self.play(Write(f3),Write(d)) + self.add_fixed_in_frame_mobjects(f3_text) + self.wait(2) -- cgit From 33f8da2e2df30ee550010d7186ce56821181fd59 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:14:25 +0530 Subject: Add files via upload --- ..._Visualization of types of critical points.gif.mp4 | Bin 0 -> 1035267 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 new file mode 100644 index 0000000..ea6b781 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 differ -- cgit From f4d67bbc33ae30992bf3b66ccdb4c8110ed8700b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:16:41 +0530 Subject: Create file 2_Tangent plane at extrema of a function.py --- ...ile 2_Tangent plane at extrema of a function.py | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py new file mode 100644 index 0000000..6889a52 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py @@ -0,0 +1,55 @@ +from manimlib.imports import* + +class TheoremAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + + #----parabola: x**2+y**2 + parabola1 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_E], + resolution=(20, 20)).scale(1) + + #----parabola: -x**2-y**2 + parabola2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[PURPLE_E,PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane + + parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.add(axes) + self.add_fixed_in_frame_mobjects(parabola2_text) + self.wait(1) + self.play(Write(parabola1)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) + self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + + self.wait(1) + self.add_fixed_in_frame_mobjects(parabola1_text) + self.wait(1) + self.play(Write(parabola2)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) -- cgit From f2ff715f096058647093dbafab8912487ffcb886 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:19:32 +0530 Subject: Add files via upload --- .../file2_Tangent plane at extrema of a function.mp4 | Bin 0 -> 3483550 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 new file mode 100644 index 0000000..75657be Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 differ -- cgit From ec0eaf91e660704750ec9490aee64cd5f35076b8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:20:06 +0530 Subject: Delete file 3_Visualization of types of critical points.gif.mp4 --- ..._Visualization of types of critical points.gif.mp4 | Bin 1035267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 deleted file mode 100644 index ea6b781..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.gif.mp4 and /dev/null differ -- cgit From 13f38fa93f34b60d6998a7111c2bb6cb62c90446 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:20:16 +0530 Subject: Delete file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 --- .../file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 | Bin 2542434 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 deleted file mode 100644 index b01d279..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).gif.mp4 and /dev/null differ -- cgit From 6d371da0a54d8b887894fdd9008ea4a6afc09e9e Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:21:38 +0530 Subject: Create file1_Total area of cross section A.py --- .../file1_Total area of cross section A.py | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py new file mode 100644 index 0000000..b1ce29c --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py @@ -0,0 +1,31 @@ +from manimlib.imports import* + +class MotivationAnimation(Scene): + def construct(self): + + r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip + b = Brace(r,UP) + r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) + m_text = TextMobject("Metal Strip").shift(3*DOWN) + a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) + a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) + START = [1,0,0] + END = [0,3,0] + l = Line(START,END,color = RED).shift(0.9*DOWN) + a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) + + group1 = VGroup(r_text,b,a,l,a2,a2_text) + f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) + + ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip + + self.play(Write(r)) + self.wait(1) + self.play(ShowCreation(m_text)) + self.wait(1) + self.play(Write(group1)) + self.wait(2) + self.play(FadeOut(group1)) + self.wait(1) + self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) + -- cgit From 6f0a08e8e7db04c9fb87136fda8200f08279a4a9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:22:00 +0530 Subject: Rename file 3_Visualization of types of critical points.py to file3_Visualization of types of critical points.py --- ... 3_Visualization of types of critical points.py | 70 ---------------------- ...e3_Visualization of types of critical points.py | 70 ++++++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----graph of first function f(x,y) = -x**2-y**2 - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], - resolution = (20, 20)).scale(1) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----graph of second function f(x,y) = -x**2+y**2 - f2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], - resolution = (20, 20)).scale(1) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----graph of third function f(x,y) = x**2+y**2 - f3 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], - resolution = (20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py new file mode 100644 index 0000000..f9055e6 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py @@ -0,0 +1,70 @@ +from manimlib.imports import * + +class TypescpAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + #----graph of first function f(x,y) = -x**2-y**2 + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], + resolution = (20, 20)).scale(1) + + r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + #----graph of second function f(x,y) = -x**2+y**2 + f2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], + resolution = (20, 20)).scale(1) + + r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + #----graph of third function f(x,y) = x**2+y**2 + f3 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], + resolution = (20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.add(axes) + self.play(Write(f2),Write(d)) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.play(FadeOut(r3_text)) + self.add(axes) + self.play(Write(f3),Write(d)) + self.add_fixed_in_frame_mobjects(f3_text) + self.wait(2) -- cgit From 4f3ae2072d6312cde707b4c643ddb8777e867c6b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:22:35 +0530 Subject: Rename file 4_f(x,y) = (y-x)(1-2x-3y).py to file4_f(x,y) = (y-x)(1-2x-3y).py --- .../file 4_f(x,y) = (y-x)(1-2x-3y).py | 32 ---------------------- .../file4_f(x,y) = (y-x)(1-2x-3y).py | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py deleted file mode 100644 index 72c93b1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file 4_f(x,y) = (y-x)(1-2x-3y).py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - (v-u)*(1-2*u-3*v) - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py new file mode 100644 index 0000000..72c93b1 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py @@ -0,0 +1,32 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point + d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 + r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) + + #----f(x,y) = (y-x)(1-2x-3y) + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (v-u)*(1-2*u-3*v) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.5) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(d_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(3) -- cgit From 25d955f5c9e2a1e19e746c40531763e3f5ad30dd Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:23:20 +0530 Subject: Rename file 2_Tangent plane at extrema of a function.py to file2_Tangent plane at extrema of a function.py --- ...ile 2_Tangent plane at extrema of a function.py | 55 ---------------------- ...file2_Tangent plane at extrema of a function.py | 55 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py deleted file mode 100644 index 6889a52..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file 2_Tangent plane at extrema of a function.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - u**2+v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_E], - resolution=(20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[PURPLE_E,PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py new file mode 100644 index 0000000..6889a52 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py @@ -0,0 +1,55 @@ +from manimlib.imports import* + +class TheoremAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + + #----parabola: x**2+y**2 + parabola1 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_E], + resolution=(20, 20)).scale(1) + + #----parabola: -x**2-y**2 + parabola2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[PURPLE_E,PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane + + parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.add(axes) + self.add_fixed_in_frame_mobjects(parabola2_text) + self.wait(1) + self.play(Write(parabola1)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) + self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + + self.wait(1) + self.add_fixed_in_frame_mobjects(parabola1_text) + self.wait(1) + self.play(Write(parabola2)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) -- cgit From 576d9a6054d5b2c351760b878e29af2cca9c57e4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:24:50 +0530 Subject: Add files via upload --- .../file1_Total area of cross section A.mp4 | Bin 0 -> 283509 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 new file mode 100644 index 0000000..436dedf Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 differ -- cgit From 0df5e06b5035e954f01fcde0fea0dd5a4a0d9b66 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:26:03 +0530 Subject: Add files via upload --- ...le 3_Visualization of types of critical points.mp4 | Bin 0 -> 1035267 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 new file mode 100644 index 0000000..ea6b781 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 differ -- cgit From c99e8f947c3ffe2f2b5d4c877c9c7755d2d4e8c9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:26:42 +0530 Subject: Delete file 3_Visualization of types of critical points.mp4 --- ...le 3_Visualization of types of critical points.mp4 | Bin 1035267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 deleted file mode 100644 index ea6b781..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file 3_Visualization of types of critical points.mp4 and /dev/null differ -- cgit From b735d3d21136fce2384bb5b861894a101295314d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:27:11 +0530 Subject: Add files via upload --- ...ile3_Visualization of types of critical points.mp4 | Bin 0 -> 1035267 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 new file mode 100644 index 0000000..ea6b781 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 differ -- cgit From b868cbd088b9bcb87969d60aadd1df50e3e05816 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Tue, 26 May 2020 12:28:09 +0530 Subject: Add files via upload --- .../Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 | Bin 0 -> 2542434 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 new file mode 100644 index 0000000..b01d279 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 differ -- cgit From dd8dcf80f04ff9b3e01518ebfc8de921d8949e7d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:14:53 +0530 Subject: Create file1_TangentPlanes.py Manim code for Video1 of lecture notes on the subtopic Tangent Plane Approximations--- .../file1_TangentPlanes.py | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py new file mode 100644 index 0000000..8e3a19e --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py @@ -0,0 +1,39 @@ +from manimlib.imports import* + +class TangenttoSurface(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + #parabola: -x**2-y**2 + p = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[BLUE_C,TEAL_D], + resolution=(20, 20)).scale(1).shift(1*RIGHT+2*UP) + self.set_camera_orientation(phi = 35 * DEGREES,theta = -40 * DEGREES ) + + r = Rectangle(side_length=2,side_breadth= 1, fill_color=PURPLE, fill_opacity=0.2).shift(ORIGIN-1+3*UP+2*RIGHT).scale(0.7) #---tangent plane along x axis + + r_text = TextMobject("Tangent Plane along $x$ axis",color = '#FFE4E1').scale(0.6).to_corner(UL) + r2_text = TextMobject("Tangent Plane along $y$ axis",color = '#FFE4E1').scale(0.6).to_corner(UL) + + a = Arrow(color = '#FFFFF0').shift(ORIGIN-1+3*UP+4*RIGHT).scale(0.5) + a2 = Arrow(color = '#FFFFF0').shift(ORIGIN+0.5+3*UP+RIGHT).scale(0.5) + a2.rotate(1.571) #----1.571 radian = 90 degrees + + self.add(axes) + self.play(Write(p)) + self.begin_ambient_camera_rotation(rate = 0.1) + self.add_fixed_in_frame_mobjects(r_text) + self.play(ShowCreation(r)) + self.play(ShowCreation(a)) + self.wait(1) + self.play(FadeOut(r),FadeOut(a),FadeOut(r_text)) + + r.rotate(1.571) #---tangent plane along y axis + self.play(ShowCreation(r)) + self.play(ShowCreation(a2)) + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(2) -- cgit From 3db080a68a32f82722dd77b7ca65cc8336f6c9fb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:18:01 +0530 Subject: file1_TangentPlanes.mp4 Added gif of file1_TangentPlanes.py--- .../file1_TangentPlanes.mp4 | Bin 0 -> 1483459 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 new file mode 100644 index 0000000..6a3ba6d Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 differ -- cgit From 003d8f6f9c391b675b73fc2610dd86d609ea498b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:27:04 +0530 Subject: file2_Tangent_plane_approximation_visualization.py Manim code for Video 2 of the lecture note on the subtopic Tangent Plane Approximations--- ...e2_Tangent_plane_approximation_visualization.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py new file mode 100644 index 0000000..984db16 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.py @@ -0,0 +1,34 @@ +from manimlib.imports import* + +class TangenttoSurface(ThreeDScene): + + def construct(self): + axes = ThreeDAxes() + + #----f(x,y): x**2+y**2 + p = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1,v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_C,GREEN_D], + resolution = (20, 20)).scale(1) + self.set_camera_orientation(phi = 75*DEGREES) + + h_text = TextMobject("The graph tends to coincide with its tangent plane").scale(0.5).to_corner(UL) + d = Dot([0,0,0],color ='#800000') #----critical point + r = Rectangle(height = 2,breadth = 1,color = YELLOW).scale(0.5) #----tangent plane to critical point + line1 = DashedLine(color=RED).shift(4*UP+1.3*RIGHT).rotate(1.571,UP).scale(1.2) + line2 = DashedLine(color=RED).shift(4*UP-1.3*RIGHT).rotate(1.571,UP).scale(1.2) + + r2 = Rectangle(height = 2, breadth = 1,color = GREEN, fill_opacity=0.3).scale(0.5) + + self.add(axes) + self.play(Write(r)) + self.play(Write(p),Write(d)) + self.play(ShowCreation(line1),ShowCreation(line2)) + self.wait(2) + + self.play(FadeOut(line1),FadeOut(line2),ReplacementTransform(p,r2)) + self.add_fixed_in_frame_mobjects(h_text) + self.wait(1) -- cgit From daf039ad46c5c795a4c39a6ab13696eb8f2a2763 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:29:56 +0530 Subject: Gif_2 Added gif of file2_Tangent_plane_approximation_visualization.mp4--- ...file2_Tangent_plane_approximation_visualization.mp4 | Bin 0 -> 336179 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 new file mode 100644 index 0000000..bc3448b Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 differ -- cgit From 9c57f9c032c98ce9e7ea5dda35b08dd2292bc4e7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:30:16 +0530 Subject: Delete file2_Tangent_plane_approximation_visualization.mp4 --- ...file2_Tangent_plane_approximation_visualization.mp4 | Bin 336179 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 deleted file mode 100644 index bc3448b..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 and /dev/null differ -- cgit From aeb9f27dfc12d5d64502f015d13e1a75c32ac7e1 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:31:02 +0530 Subject: Gif_2 Added gif of file2_Tangent_plane_approximation_visualization.py--- ...file2_Tangent_plane_approximation_visualization.mp4 | Bin 0 -> 336179 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 new file mode 100644 index 0000000..bc3448b Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 differ -- cgit From 407c6ad5fda44100792a0e309c2d56a05dfbe228 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:36:37 +0530 Subject: Create file3_non_differentiable_function.py Manim code for Video 3 of lecture note on the subtopic Tangent Plane Approximations--- .../file3_non_differentiable_function.py | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py new file mode 100644 index 0000000..13bd73e --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.py @@ -0,0 +1,30 @@ +from manimlib.imports import* +import math + +#---- tangent plane does not exists for f(x,y): sqrt(x**2+y**2) at origin + +class TangenttoSurface(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + #----f(x,y): sqrt(x**2+y**2) + p = ParametricSurface( + lambda u, v: np.array([ + u, + v, + math.sqrt(u**2+v**2) + ]),v_min = -1,v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_C,TEAL_D], + resolution = (20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + + d = Dot([0,0,0],color = '#800000') #----critical point + d_text = TextMobject("$(0,0)$").scale(0.5).shift(0.2*DOWN) + f_text = TextMobject("$f$ is not differentiable at origin").scale(0.5).to_corner(UL) + + self.begin_ambient_camera_rotation(rate=0.1) + self.add(axes) + self.play(Write(p),Write(d)) + self.add_fixed_in_frame_mobjects(d_text) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) -- cgit From 65853aee28e884322684f8198a755234e6d80239 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:37:24 +0530 Subject: Add file3_non_differentiable_function.mp4 Gif of file3_non_differentiable_function.py--- .../file3_non_differentiable_function.mp4 | Bin 0 -> 424364 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 new file mode 100644 index 0000000..7417a87 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 differ -- cgit From ccf9bdb8caddf9f12e0472c0510eded3e5a895a8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:41:12 +0530 Subject: Create file4_Tangent plane_at_critical_points.py Manim code of Video 4 of the lecture note on the subtopic Tangent Plane Approximations--- .../file4_Tangent plane_at_critical_points.py | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py new file mode 100644 index 0000000..d129213 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.py @@ -0,0 +1,62 @@ +from manimlib.imports import* + +class TangenttoSurface(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + #----graph of first function f(x,y) = -x**2-y**2 + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], + resolution = (20, 20)).scale(1) + f_text = TextMobject("Tangent plane at relative maxima").to_corner(UL).scale(0.5) + + #----graph of second function f(x,y) = -x**2+y**2 + f2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], + resolution = (20, 20)).scale(1) + f2_text = TextMobject("Tangent plane at saddle point").to_corner(UL).scale(0.5) + + #----graph of third function f(x,y) = x**2+y**2 + f3 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], + resolution = (20, 20)).scale(1) + f3_text = TextMobject("Tangent plane at relative minima").to_corner(UL).scale(0.5) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + r = Rectangle(height = 2,breadth = 1,color = PURPLE).scale(0.5) + + self.begin_ambient_camera_rotation(rate = 0.3) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f_text) + self.play(ShowCreation(r)) + self.wait(1) + self.play(FadeOut(r),FadeOut(f),FadeOut(d),FadeOut(f_text)) + self.wait(1) + self.play(Write(f2),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f2_text) + self.play(ShowCreation(r)) + self.wait(1) + self.play(FadeOut(r),FadeOut(f2),FadeOut(d),FadeOut(f2_text)) + self.wait(1) + self.play(Write(f3),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f3_text) + self.play(ShowCreation(r)) + self.wait(1) -- cgit From 29e1ba7b22ed3ee5485a9689a412b57c6ba30350 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:42:27 +0530 Subject: Add file4_Tangent plane_at_critical_points.mp4 Gif of file4_Tangent plane_at_critical_points.py--- .../file4_Tangent plane_at_critical_points.mp4 | Bin 0 -> 3101810 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 new file mode 100644 index 0000000..2c64f38 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 differ -- cgit From 319f956286f2f4529b0390ca6a535b742a52ae53 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:43:25 +0530 Subject: Rename file1_Total area of cross section A.py to file1_Total_area_of_cross_section.py --- .../file1_Total area of cross section A.py | 31 ---------------------- .../file1_Total_area_of_cross_section.py | 31 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py deleted file mode 100644 index b1ce29c..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.py +++ /dev/null @@ -1,31 +0,0 @@ -from manimlib.imports import* - -class MotivationAnimation(Scene): - def construct(self): - - r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip - b = Brace(r,UP) - r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) - m_text = TextMobject("Metal Strip").shift(3*DOWN) - a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) - a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) - START = [1,0,0] - END = [0,3,0] - l = Line(START,END,color = RED).shift(0.9*DOWN) - a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) - - group1 = VGroup(r_text,b,a,l,a2,a2_text) - f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) - - ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip - - self.play(Write(r)) - self.wait(1) - self.play(ShowCreation(m_text)) - self.wait(1) - self.play(Write(group1)) - self.wait(2) - self.play(FadeOut(group1)) - self.wait(1) - self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) - diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py new file mode 100644 index 0000000..b1ce29c --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py @@ -0,0 +1,31 @@ +from manimlib.imports import* + +class MotivationAnimation(Scene): + def construct(self): + + r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip + b = Brace(r,UP) + r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) + m_text = TextMobject("Metal Strip").shift(3*DOWN) + a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) + a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) + START = [1,0,0] + END = [0,3,0] + l = Line(START,END,color = RED).shift(0.9*DOWN) + a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) + + group1 = VGroup(r_text,b,a,l,a2,a2_text) + f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) + + ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip + + self.play(Write(r)) + self.wait(1) + self.play(ShowCreation(m_text)) + self.wait(1) + self.play(Write(group1)) + self.wait(2) + self.play(FadeOut(group1)) + self.wait(1) + self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) + -- cgit From 0122bda3697101b536ade1857b06a7c5814ad3b7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:44:13 +0530 Subject: Rename file2_Tangent plane at extrema of a function.py to file2_Tangent_plane_at_extrema.py --- ...file2_Tangent plane at extrema of a function.py | 55 ---------------------- .../file2_Tangent_plane_at_extrema.py | 55 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py deleted file mode 100644 index 6889a52..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - u**2+v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_E], - resolution=(20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[PURPLE_E,PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py new file mode 100644 index 0000000..6889a52 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py @@ -0,0 +1,55 @@ +from manimlib.imports import* + +class TheoremAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + + #----parabola: x**2+y**2 + parabola1 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_E], + resolution=(20, 20)).scale(1) + + #----parabola: -x**2-y**2 + parabola2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[PURPLE_E,PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane + + parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.add(axes) + self.add_fixed_in_frame_mobjects(parabola2_text) + self.wait(1) + self.play(Write(parabola1)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) + self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + + self.wait(1) + self.add_fixed_in_frame_mobjects(parabola1_text) + self.wait(1) + self.play(Write(parabola2)) + self.wait(1) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) -- cgit From 9621629c384f7c91b2170a3a5f467aaeefbc669a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:44:57 +0530 Subject: Rename file3_Visualization of types of critical points.py to file3_Visualization_of_types_of_critical_points.py --- ...e3_Visualization of types of critical points.py | 70 ---------------------- ...e3_Visualization_of_types_of_critical_points.py | 70 ++++++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----graph of first function f(x,y) = -x**2-y**2 - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], - resolution = (20, 20)).scale(1) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----graph of second function f(x,y) = -x**2+y**2 - f2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], - resolution = (20, 20)).scale(1) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----graph of third function f(x,y) = x**2+y**2 - f3 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], - resolution = (20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py new file mode 100644 index 0000000..f9055e6 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py @@ -0,0 +1,70 @@ +from manimlib.imports import * + +class TypescpAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + #----graph of first function f(x,y) = -x**2-y**2 + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], + resolution = (20, 20)).scale(1) + + r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + #----graph of second function f(x,y) = -x**2+y**2 + f2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], + resolution = (20, 20)).scale(1) + + r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + #----graph of third function f(x,y) = x**2+y**2 + f3 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], + resolution = (20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.add(axes) + self.play(Write(f2),Write(d)) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.play(FadeOut(r3_text)) + self.add(axes) + self.play(Write(f3),Write(d)) + self.add_fixed_in_frame_mobjects(f3_text) + self.wait(2) -- cgit From 9fbf83323d7ed99186887df532ffba98a4edbbce Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:45:29 +0530 Subject: Rename file4_f(x,y) = (y-x)(1-2x-3y).py to file4_f(x,y)=(y-x)(1-2x-3y).py --- .../file4_f(x,y) = (y-x)(1-2x-3y).py | 32 ---------------------- .../Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py deleted file mode 100644 index 72c93b1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y) = (y-x)(1-2x-3y).py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - (v-u)*(1-2*u-3*v) - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py new file mode 100644 index 0000000..72c93b1 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py @@ -0,0 +1,32 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point + d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 + r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) + + #----f(x,y) = (y-x)(1-2x-3y) + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (v-u)*(1-2*u-3*v) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi = 75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.5) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f),Write(d)) + self.wait(1) + self.add_fixed_in_frame_mobjects(d_text) + self.wait(1) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(3) -- cgit From bb85fa86479bd1e67febb275b157a0c39d0f291a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:47:05 +0530 Subject: Delete file1_Total area of cross section A.mp4 --- .../file1_Total area of cross section A.mp4 | Bin 283509 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 deleted file mode 100644 index 436dedf..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total area of cross section A.mp4 and /dev/null differ -- cgit From 8f72ec94d5d699d400c4fb32006ca37c39b17048 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:49:34 +0530 Subject: file1_Total_area_of_cross_section.mp4 Gif of Video 1 of lecture notes on Critical Points--- .../file1_Total_area_of_cross_section.mp4 | Bin 0 -> 283509 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 new file mode 100644 index 0000000..436dedf Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 differ -- cgit From f148b9756f1dd70ce30e382f858d22b66c8f096b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:50:03 +0530 Subject: Delete file2_Tangent plane at extrema of a function.mp4 --- .../file2_Tangent plane at extrema of a function.mp4 | Bin 3483550 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 deleted file mode 100644 index 75657be..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent plane at extrema of a function.mp4 and /dev/null differ -- cgit From 86f55cff7d519184d713c2988759796d3f533692 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:54:00 +0530 Subject: file2_Tangent_plane_at_extrema.mp4 Gif of file2_Tangent_plane_at_extrema.py Video 2 of lecture note on subtopic Critical Points--- .../file2_Tangent_plane_at_extrema.mp4 | Bin 0 -> 3483550 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 new file mode 100644 index 0000000..75657be Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 differ -- cgit From 00ff12bd3bfcad540ff14e7ecf40b5d88406a08f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:54:29 +0530 Subject: Delete file3_Visualization of types of critical points.mp4 --- ...ile3_Visualization of types of critical points.mp4 | Bin 1035267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 deleted file mode 100644 index ea6b781..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of types of critical points.mp4 and /dev/null differ -- cgit From fdec91753096122b57ab787d005d08c2aa8b4386 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 27 May 2020 20:56:32 +0530 Subject: Gif 3 Gif of file3_Visualization of_types_of _critical_points.py Video 3 of lecture note on subtopic Critical Points--- ...le3_Visualization of_types_of _critical_points.mp4 | Bin 0 -> 1035267 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 new file mode 100644 index 0000000..ea6b781 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 differ -- cgit From 29223f0559e2f94166591fdacee0afa651f9bdc0 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 13 Jun 2020 22:58:17 +0530 Subject: Update and rename file1_Total_area_of_cross_section.py to file1_Critical_Point_of_a_function.py modified the code for gif1--- .../file1_Critical_Point_of_a_function.py | 32 ++++++++++++++++++++++ .../file1_Total_area_of_cross_section.py | 31 --------------------- 2 files changed, 32 insertions(+), 31 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py new file mode 100644 index 0000000..0b15ebf --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py @@ -0,0 +1,32 @@ +from manimlib.imports import* +import math as m + + +class CriticalPoint(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + m.exp(-10*u**2-10*v**2) #---- function equation + ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C]).fade(0.6).scale(3.5).shift([0,0,1.5]) + + l1 = Line([0,0,3.75],[0,0,0],color = '#800000') + + d = Dot([0,0,3.75],color = '#800000') + f_text = TextMobject("Critical Point of a function",color = YELLOW).shift([3,0,3.7]).scale(0.7) + + self.add(axes) + self.set_camera_orientation(phi=75*DEGREES,theta=90*DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + self.play(Write(surface)) + self.wait(1) + self.play(Write(l1)) + self.play(Write(d)) + self.wait(2) + self.move_camera(phi=0 * DEGREES,theta = 90*DEGREES) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py deleted file mode 100644 index b1ce29c..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.py +++ /dev/null @@ -1,31 +0,0 @@ -from manimlib.imports import* - -class MotivationAnimation(Scene): - def construct(self): - - r = Rectangle(height = 7,breadth = 2,color = BLUE, fill_opacity = 0.3).scale(0.6) #----metal strip - b = Brace(r,UP) - r_text = TextMobject("$x$ metres",color = YELLOW).shift(3*UP) - m_text = TextMobject("Metal Strip").shift(3*DOWN) - a = Arc(radius=2).rotate(1).shift(LEFT+0.5*UP) - a2 = Arc(radius=2).rotate(5).shift(0.7*LEFT+0.9*UP).scale(0.2) - START = [1,0,0] - END = [0,3,0] - l = Line(START,END,color = RED).shift(0.9*DOWN) - a2_text = TextMobject("$\\theta$",color = PINK).shift(1.6*UP+0.4*RIGHT) - - group1 = VGroup(r_text,b,a,l,a2,a2_text) - f_text = TextMobject("$A = f(x,\\theta)$").shift(2*DOWN) - - ring = Annulus(inner_radius = 0.7, outer_radius = 1, color = BLUE) #--bent metal strip - - self.play(Write(r)) - self.wait(1) - self.play(ShowCreation(m_text)) - self.wait(1) - self.play(Write(group1)) - self.wait(2) - self.play(FadeOut(group1)) - self.wait(1) - self.play(ReplacementTransform(r,ring),ShowCreation(f_text)) - -- cgit From c5e6905c1c739417cb973f29106fb6754a1f6c82 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sat, 13 Jun 2020 22:59:01 +0530 Subject: Delete file1_Total_area_of_cross_section.mp4 --- .../file1_Total_area_of_cross_section.mp4 | Bin 283509 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 deleted file mode 100644 index 436dedf..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Total_area_of_cross_section.mp4 and /dev/null differ -- cgit From 62488c13816018706eb82e1c46e1138eabcc00e4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:09:37 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.mp4 | Bin 0 -> 7572030 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 new file mode 100644 index 0000000..7cb8aa1 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 differ -- cgit From fea71e32256ffb051e73a0e61cf7286711982b57 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:17:13 +0530 Subject: Update and rename file2_Tangent_plane_at_extrema.py to file2_Traces_and_Tangent.py modified the code for gif 2--- .../file2_Tangent_plane_at_extrema.py | 55 ------------- .../Critical-Points/file2_Traces_and_Tangent.py | 93 ++++++++++++++++++++++ 2 files changed, 93 insertions(+), 55 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py deleted file mode 100644 index 6889a52..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.py +++ /dev/null @@ -1,55 +0,0 @@ -from manimlib.imports import* - -class TheoremAnimation(ThreeDScene): - def construct(self): - - axes = ThreeDAxes() - - #----parabola: x**2+y**2 - parabola1 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - u**2+v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_E], - resolution=(20, 20)).scale(1) - - #----parabola: -x**2-y**2 - parabola2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[PURPLE_E,PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.4) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color= '#C0C0C0',fill_opacity =0.3).move_to(ORIGIN) #----tangent plane - - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) - - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) - - self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) - self.wait(1) - self.play(Write(parabola1)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) - - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) - self.wait(1) - self.play(ShowCreation(d)) - self.wait(1) - self.play(ShowCreation(r)) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py new file mode 100644 index 0000000..65b4414 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -0,0 +1,93 @@ +from manimlib.imports import* +import math as m + + +class firstScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes().scale(1.15) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + m.exp(-10*u**2-10*v**2) #---- f(x,y) + ]),u_min=-2,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) + + trace = ParametricSurface( + lambda u, v: np.array([ + m.exp(np.cos(v)+np.sin(v)), + v, + u/4 + ]), v_min = -1, v_max= 2).rotate(1.571,DOWN).shift(2.15*LEFT+[0.6,-0.4,1.54]).scale(1).set_color('#800000') + + + + d = Dot(color =YELLOW).shift([1.9,0.7,4.1]) #---- critical point + tangent_line = Line(color = '#228B22').scale(1).shift([1.9,0.7,4.1]).rotate(4.5) #---- tangent along y axis + + label_x = TextMobject("$x$").shift([5.8,-0.5,0]) + label_y = TextMobject("$y$").shift([-0.5,5.6,0]).rotate(-4.5) + + + f_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) + + self.add(axes) + self.set_camera_orientation(phi=60*DEGREES,theta=15*DEGREES) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.add_fixed_in_frame_mobjects(s_text) + self.add(trace) + self.wait(1) + self.play(Write(tangent_line),Write(d)) + self.wait(2) + + +class secondScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes().scale(1.15) + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + m.exp(-10*u**2-10*v**2) #---- f(x,y) + ]),u_min=-2,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) + + trace = ParametricSurface( + lambda u, v: np.array([ + m.exp(np.cos(v)+np.sin(v)), + v, + u/4 + ]), v_min = -1, v_max= 2).rotate(1.571,DOWN).shift(2.15*LEFT+[0.6,-0.4,1.54]).scale(1).set_color('#800000') + + + + d = Dot(color =YELLOW).shift([1.9,0.7,4.1]) #---- critical point + + label_x = TextMobject("$x$").shift([5.8,-0.5,0]) + label_y = TextMobject("$y$").shift([-0.5,5.6,0]).rotate(-4.5) + + f_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) + + tangent_line = Line(color = '#228B22').scale(1).shift([1.9,0.7,4.1]) #---- tangent along x axis + + + self.add(axes) + self.set_camera_orientation(phi=60*DEGREES,theta=15*DEGREES) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.add_fixed_in_frame_mobjects(f_text) + trace.rotate(-5).shift(0.2*RIGHT+0.8*UP+[0.6,-0.4,0.6]) + self.add(trace) + self.play(Write(tangent_line),Write(d)) + self.wait(1) + + + + + + -- cgit From 0c64724b50c0ba18f9bf222d9ab9182cb2019237 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:18:05 +0530 Subject: Update file2_Traces_and_Tangent.py --- .../Critical-Points/file2_Traces_and_Tangent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py index 65b4414..6be4c6a 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -53,7 +53,7 @@ class secondScene(ThreeDScene): u, v, m.exp(-10*u**2-10*v**2) #---- f(x,y) - ]),u_min=-2,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) + ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) trace = ParametricSurface( lambda u, v: np.array([ -- cgit From 79ffe792983f60f0fc8ace4324a10f53f539df00 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:18:37 +0530 Subject: Delete file2_Tangent_plane_at_extrema.mp4 --- .../file2_Tangent_plane_at_extrema.mp4 | Bin 3483550 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 deleted file mode 100644 index 75657be..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Tangent_plane_at_extrema.mp4 and /dev/null differ -- cgit From 51ee2ee8400ae4591f0559e3c5e90c7059219f42 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:20:24 +0530 Subject: Add files via upload --- .../Critical-Points/file2_Traces_and_Tangent.mp4 | Bin 0 -> 12740681 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 new file mode 100644 index 0000000..7a2d0ee Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 differ -- cgit From b956f1dcb43cf2b93febad29890dbbd1e264dd2f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:25:05 +0530 Subject: Update and rename file3_Visualization_of_types_of_critical_points.py to file3_Tangent_plane_at_extrema_of_a_function.py modified code for gif 3--- ...file3_Tangent_plane_at_extrema_of_a_function.py | 53 ++++++++++++++++ ...e3_Visualization_of_types_of_critical_points.py | 70 ---------------------- 2 files changed, 53 insertions(+), 70 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py new file mode 100644 index 0000000..a9b29f3 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py @@ -0,0 +1,53 @@ +from manimlib.imports import* + +class TheoremAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + + #----parabola: x**2+y**2 + parabola1 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[GREEN_E,GREEN_D,GREEN_C,GREEN_B], + resolution=(20, 20)).scale(1) + + #----parabola: -x**2-y**2 + parabola2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[BLUE_E,BLUE_D,BLUE_C,BLUE_B], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.2) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + r = Rectangle(fill_color= '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) #----tangent plane + + parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.add(axes) + self.add_fixed_in_frame_mobjects(parabola2_text) + self.wait(1) + self.play(Write(parabola1)) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(2) + self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + + self.wait(1) + self.add_fixed_in_frame_mobjects(parabola1_text) + self.wait(1) + self.play(Write(parabola2)) + self.play(ShowCreation(d)) + self.wait(1) + self.play(ShowCreation(r)) + self.wait(1) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py deleted file mode 100644 index f9055e6..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization_of_types_of_critical_points.py +++ /dev/null @@ -1,70 +0,0 @@ -from manimlib.imports import * - -class TypescpAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - - #----graph of first function f(x,y) = -x**2-y**2 - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_D, YELLOW_E], - resolution = (20, 20)).scale(1) - - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) - - #----graph of second function f(x,y) = -x**2+y**2 - f2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_D, RED_E], - resolution = (20, 20)).scale(1) - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----graph of third function f(x,y) = x**2+y**2 - f3 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_D, GREEN_E], - resolution = (20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r3_text) - self.wait(1) - self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) -- cgit From 087ef1aa73a9a9c0099238113a5c4f028fdcef26 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:37:58 +0530 Subject: Delete file3_Visualization of_types_of _critical_points.mp4 --- ...le3_Visualization of_types_of _critical_points.mp4 | Bin 1035267 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 deleted file mode 100644 index ea6b781..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Visualization of_types_of _critical_points.mp4 and /dev/null differ -- cgit From c104de4d17e814ec63e5a4984e2558cb70fb9116 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:39:47 +0530 Subject: Add files via upload --- .../file3_Tangent_plane_at_extrema_of_a_function.mp4 | Bin 0 -> 2286609 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 new file mode 100644 index 0000000..ea5149f Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 differ -- cgit From 50cd0ef4bf0348aa2bb2e7d26a05419e67623a76 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:42:55 +0530 Subject: Update and rename file4_f(x,y)=(y-x)(1-2x-3y).py to file4_Types_of_critical_points.py --- .../file4_Types_of_critical_points.py | 70 ++++++++++++++++++++++ .../Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py | 32 ---------- 2 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py new file mode 100644 index 0000000..f9c1ef0 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py @@ -0,0 +1,70 @@ +from manimlib.imports import * + +class TypescpAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + #----graph of first function f(x,y) = -x**2-y**2 + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E], + resolution = (20, 20)).scale(1.5).shift([0,0,-0.51]).fade(0.3) + + r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + #----graph of second function f(x,y) = -x**2+y**2 + f2 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_B,RED_C,RED_D, RED_E], + resolution = (20, 20)).scale(1.5).shift([0,0.2,0]).fade(0.3) + + r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + #----graph of third function f(x,y) = x**2+y**2 + f3 = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors =[TEAL_B,TEAL_C,TEAL_D,TEAL_E], + resolution = (20, 20)).scale(1.5).shift([0,0,0.55]).fade(0.1) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.play(FadeOut(r2_text)) + self.add(axes) + self.play(Write(f2),Write(d)) + self.add_fixed_in_frame_mobjects(f2_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) + + self.add_fixed_in_frame_mobjects(r3_text) + self.wait(1) + self.play(FadeOut(r3_text)) + self.add(axes) + self.play(Write(f3),Write(d)) + self.add_fixed_in_frame_mobjects(f3_text) + self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py deleted file mode 100644 index 72c93b1..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).py +++ /dev/null @@ -1,32 +0,0 @@ -from manimlib.imports import* - -class ExampleAnimation(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - d = Dot(np.array([0,0,0]), color = '#800000') #---- Critical Point - d_text = TextMobject("$(0.2,0.2)$",color = '#DC143C').scale(0.5).shift(0.2*UP) #----x = 0.2, y = 0.2 - r_text=TextMobject("Critical Point",color = '#00FFFF').shift(0.3*DOWN).scale(0.6) - - #----f(x,y) = (y-x)(1-2x-3y) - f = ParametricSurface( - lambda u, v: np.array([ - u, - v, - (v-u)*(1-2*u-3*v) - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_D, PURPLE_E], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi = 75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.5) - - self.add_fixed_in_frame_mobjects(f_text) - self.wait(1) - self.add(axes) - self.play(Write(f),Write(d)) - self.wait(1) - self.add_fixed_in_frame_mobjects(d_text) - self.wait(1) - self.add_fixed_in_frame_mobjects(r_text) - self.wait(3) -- cgit From 54808110e4ed0a31184d16591df83d17230528af Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:44:08 +0530 Subject: Update file3_Tangent_plane_at_extrema_of_a_function.py --- .../Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py index a9b29f3..b066d04 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py @@ -1,6 +1,6 @@ from manimlib.imports import* -class TheoremAnimation(ThreeDScene): +class TangentPlane(ThreeDScene): def construct(self): axes = ThreeDAxes() -- cgit From 7f9dbe19b3fb5691b20b267da0389ee76c8d47ae Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:44:40 +0530 Subject: Delete file4_f(x,y)=(y-x)(1-2x-3y).mp4 --- .../Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 | Bin 2542434 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 deleted file mode 100644 index b01d279..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_f(x,y)=(y-x)(1-2x-3y).mp4 and /dev/null differ -- cgit From 9c829be87de73eb7bbd0ea2fe5a74e2894fb9720 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:45:53 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.mp4 | Bin 0 -> 1405162 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 new file mode 100644 index 0000000..13e49e6 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 differ -- cgit From 246c53a8a6e621b7d6a6730e4ea7a3a0c3275740 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:47:11 +0530 Subject: Create file5_f(x,y)=(y-x)(1-2x-3y).py --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py new file mode 100644 index 0000000..8a90990 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py @@ -0,0 +1,25 @@ +from manimlib.imports import* + +class ExampleAnimation(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) + + #----f(x,y) = (y-x)(1-2x-3y) + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (v-u)*(1-2*u-3*v) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D, PURPLE_E], + resolution=(20, 20)).scale(1).fade(0.2).shift([0.2,0.2,0]) + + self.set_camera_orientation(phi = 75 * DEGREES,theta= 60*DEGREES) + self.begin_ambient_camera_rotation(rate=0.1) + + self.add_fixed_in_frame_mobjects(f_text) + self.wait(1) + self.add(axes) + self.play(Write(f)) + self.wait(3) -- cgit From 8d29a384e4892c4c8aa4a4fc0555d6e4c86b6555 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 00:48:37 +0530 Subject: Add files via upload --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 | Bin 0 -> 1138064 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 new file mode 100644 index 0000000..44a2fea Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 differ -- cgit From 11a9de691934af10c9bc93456f9f9d05c3c17902 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:06:33 +0530 Subject: Create README.md Created readme file for the subtopic critical points--- .../Critical-Points/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md new file mode 100644 index 0000000..60abeff --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -0,0 +1,11 @@ +1. Critical Points + +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4?raw=true) + +![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4?raw=true) + +![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4?raw=true) + +![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4?raw=true) + +![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).mp4?raw=true) -- cgit From 06f18ec2a72517b01d5d6fd2c1190362fcee9fa3 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:08:52 +0530 Subject: Delete README.md --- .../Critical-Points/README.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md deleted file mode 100644 index 60abeff..0000000 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ /dev/null @@ -1,11 +0,0 @@ -1. Critical Points - -![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4?raw=true) - -![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4?raw=true) - -![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4?raw=true) - -![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4?raw=true) - -![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).mp4?raw=true) -- cgit From 90f5b141f7b0e041f308bab5298ce5358bb79576 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:16:27 +0530 Subject: Delete file1_Critical_Point_of_a_function.mp4 --- .../file1_Critical_Point_of_a_function.mp4 | Bin 7572030 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 deleted file mode 100644 index 7cb8aa1..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.mp4 and /dev/null differ -- cgit From b8bb27b0ce0d0a4d0b5fc04d254dc9e00207e09d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:17:32 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 4518694 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..b29772b Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From 536356d68b0b67380bd5ba992c9330ae5cd20233 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:20:36 +0530 Subject: Create README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/README.md (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md new file mode 100644 index 0000000..4fe0bee --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -0,0 +1,4 @@ +1. Critical Points +-------- Animations -------- + +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -- cgit From 1e3ff2ddc3438ac5feca3221f55421a35a8b32d4 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:21:34 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 4fe0bee..4fa4317 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,4 +1,5 @@ 1. Critical Points +

-------- Animations -------- ![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -- cgit From 701e4d2209cf7b462b527decb3ecb5e0256ce9bb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:23:11 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 4fa4317..0917073 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -2,4 +2,6 @@

-------- Animations -------- -![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +file1_Critical_Point_of_a_function + +
![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -- cgit From 4934006b4a7040a6ef9282fd8374d9935ec386db Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:23:39 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 0917073..a79d69c 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -2,6 +2,6 @@

-------- Animations -------- -file1_Critical_Point_of_a_function + file1_Critical_Point_of_a_function -
![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) -- cgit From 55edb84f67a44f6bfa658335c8b233e738a056bd Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:24:17 +0530 Subject: Delete file2_Traces_and_Tangent.mp4 --- .../Critical-Points/file2_Traces_and_Tangent.mp4 | Bin 12740681 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 deleted file mode 100644 index 7a2d0ee..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.mp4 and /dev/null differ -- cgit From 459a3ebe680bb30572e1fe5fc6272f6606b39fe2 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:26:56 +0530 Subject: Add files via upload --- .../Critical-Points/file2_Traces_and_Tangent.gif | Bin 0 -> 1105801 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif new file mode 100644 index 0000000..e7a2a46 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif differ -- cgit From c8d08f5e9925d5d88e5285f411228284bb231ad6 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:28:08 +0530 Subject: Delete file3_Tangent_plane_at_extrema_of_a_function.mp4 --- .../file3_Tangent_plane_at_extrema_of_a_function.mp4 | Bin 2286609 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 deleted file mode 100644 index ea5149f..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.mp4 and /dev/null differ -- cgit From 86602d63512998b5dd7b9d769a7acd317fa22e4a Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:30:39 +0530 Subject: Add files via upload --- .../file3_Tangent_plane_at_extrema_of_a_function.gif | Bin 0 -> 2195510 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif new file mode 100644 index 0000000..41c72cc Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif differ -- cgit From b8a5421a708d911256c42336ebfc535ac43d91a9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:31:53 +0530 Subject: Delete file4_Types_of_critical_points.mp4 --- .../file4_Types_of_critical_points.mp4 | Bin 1405162 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 deleted file mode 100644 index 13e49e6..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.mp4 and /dev/null differ -- cgit From b1b9cb813181768cb0703eb8054d65fbf676d186 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:32:21 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 1216647 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..63f2b3a Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From d6f4bff69fd272e633f5bd5769db2c3c42eece14 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:33:52 +0530 Subject: Delete file5_f(x,y)=(y-x)(1-2x-3y).mp4 --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 | Bin 1138064 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 deleted file mode 100644 index 44a2fea..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).mp4 and /dev/null differ -- cgit From 4e7cfaf86a6481cbdd68d5d31b75a8ec6dfc7389 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:34:22 +0530 Subject: Add files via upload --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 0 -> 1231893 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif new file mode 100644 index 0000000..0a2785e Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif differ -- cgit From 1608e3ae85eff8374d62f3d7780abecd46913a69 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:35:07 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index a79d69c..364c968 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -2,6 +2,36 @@

-------- Animations -------- +

+

+ file1_Critical_Point_of_a_function ![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +

+

+ +file2_Traces_and_Tangent + + ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) +

+

+ +file3_Tangent_plane_at_extrema_of_a_function + ![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) +

+

+ +file4_Types_of_critical_points + ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) +

+

+ +file5_f(x,y)=(y-x)(1-2x-3y) + ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) +

+

+ + + + -- cgit From 5c9fa6fe7f9215d671dc6a0c0540648964600983 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Sun, 14 Jun 2020 01:35:41 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 364c968..8780553 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -23,11 +23,13 @@

file4_Types_of_critical_points + ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true)



file5_f(x,y)=(y-x)(1-2x-3y) + ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



-- cgit From 65e0afa5075d41d64728250b7d3ee7c18abc9125 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:03:34 +0530 Subject: Update file1_Critical_Point_of_a_function.py --- .../file1_Critical_Point_of_a_function.py | 43 ++++++++++++++++++---- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py index 0b15ebf..f3c16d4 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py @@ -6,27 +6,56 @@ class CriticalPoint(ThreeDScene): def construct(self): axes = ThreeDAxes() - surface = ParametricSurface( + + surface = ParametricSurface( #---- partial derivatives of the funtion exists + lambda u, v: np.array([ + u, + v, + m.exp(-10*u**2-10*v**2)]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C]).fade(0.6).scale(3.5).shift([0,0,1.5]) + + surface2 = ParametricSurface( #---- partial derivatives of the funtion does not exists lambda u, v: np.array([ u, v, - m.exp(-10*u**2-10*v**2) #---- function equation - ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C]).fade(0.6).scale(3.5).shift([0,0,1.5]) + abs(u)+abs(v)]),u_min=-1.5,u_max=1.5, v_min=-1.5,v_max=1.5,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C,TEAL_B]) l1 = Line([0,0,3.75],[0,0,0],color = '#800000') - d = Dot([0,0,3.75],color = '#800000') + d = Dot([0,0,3.75],color = '#800000') #---- critical point of surface + + d2 = Dot([0,0,0],color = '#800000') #---- critical point of surface2 + + d_text = TextMobject("$\\frac{\\partial f}{\\partial x}=\\frac{\\partial f}{\\partial y} = 0$").scale(1).to_corner(UL) + + d2_text = TextMobject("$\\frac{\\partial f}{\\partial x}$ and/or $\\frac{\\partial f}{\\partial y}$ does not exist").scale(0.8).to_corner(UL) + f_text = TextMobject("Critical Point of a function",color = YELLOW).shift([3,0,3.7]).scale(0.7) - self.add(axes) + g_text = TextMobject("Critical Point of a function",color = YELLOW).shift(1*DOWN).scale(0.5) + self.set_camera_orientation(phi=75*DEGREES,theta=90*DEGREES) - self.begin_ambient_camera_rotation(rate=0.4) + self.add(axes) + self.begin_ambient_camera_rotation(rate=0.2) self.play(Write(surface)) + self.add_fixed_in_frame_mobjects(d_text) self.wait(1) self.play(Write(l1)) self.play(Write(d)) - self.wait(2) + self.wait(1) self.move_camera(phi=0 * DEGREES,theta = 90*DEGREES) + self.wait(2) self.add_fixed_in_frame_mobjects(f_text) + self.play(FadeOut(f_text),FadeOut(surface),FadeOut(axes),FadeOut(d_text),FadeOut(d),FadeOut(l1)) self.wait(1) + self.set_camera_orientation(phi=75*DEGREES,theta=60*DEGREES) + self.add(axes) + self.begin_ambient_camera_rotation(rate=0.3) + self.add_fixed_in_frame_mobjects(d2_text) + self.wait(1) + self.play(Write(surface2)) + l1.fade(0.4) + self.play(Write(l1)) + self.play(Write(d2)) + self.add_fixed_in_frame_mobjects(g_text) + self.wait(2) -- cgit From f198339d1a32de887d0695a8dcfc55128efef151 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:05:45 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 4518694 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index b29772b..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From 3cd62fca3e937b454b8fb297a56fd2fa9273b993 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:12:28 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 7079252 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..c376e2d Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From 49b1ae26b41cad68d761c399057a46881fb7e546 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:22:04 +0530 Subject: Update file4_Types_of_critical_points.py --- .../file4_Types_of_critical_points.py | 88 ++++++++++++++++------ 1 file changed, 63 insertions(+), 25 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py index f9c1ef0..42703ba 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py @@ -1,6 +1,7 @@ from manimlib.imports import * -class TypescpAnimation(ThreeDScene): + +class MaximaScene(ThreeDScene): def construct(self): axes = ThreeDAxes() @@ -16,19 +17,74 @@ class TypescpAnimation(ThreeDScene): ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E], resolution = (20, 20)).scale(1.5).shift([0,0,-0.51]).fade(0.3) - r2_text = TextMobject("Saddle Point at ORIGIN",color ='#87CEFA') - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + self.add_fixed_in_frame_mobjects(r_text) + self.wait(1) + self.play(FadeOut(r_text)) + self.add(axes) + self.play(Write(f),Write(d)) + self.add_fixed_in_frame_mobjects(f_text) + self.wait(2) + self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) + +class SaddlePoint(ThreeDScene): + def construct(self): - #----graph of second function f(x,y) = -x**2+y**2 + r2_text = TextMobject("Saddle Point",color ='#87CEFA') + axes = ThreeDAxes() + + #----graph of third function f(x,y) = -x**2+y**2 f2 = ParametricSurface( lambda u, v: np.array([ u, v, -u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [RED_B,RED_C,RED_D, RED_E], - resolution = (20, 20)).scale(1.5).shift([0,0.2,0]).fade(0.3) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1,checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D,PURPLE_E]).scale(1.5).shift([0,0,0]) + + #---- trace along y axis + a = ParametricSurface( + lambda u, v: np.array([ + u, + v, + v**2 + ]),v_min = -1, v_max = 1, u_min = -0.2, u_max = 0.2).shift([0,0,0.36]).scale(1.5).set_color(GREEN) + + #---- trace along x axis + b = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2 + ]),v_min = -0.2, v_max = 0.2, u_min = -1, u_max = 1).scale(1.6).shift([0,0,-0.1]).set_color(GREEN) + + d = Dot(color = '#800000').shift([0,0,0.1]) #---- critical point + + f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + + self.add_fixed_in_frame_mobjects(r2_text) + self.wait(1) + self.set_camera_orientation(phi=75*DEGREES,theta=10*DEGREES) + self.play(FadeOut(r2_text)) + self.add(axes) + self.begin_ambient_camera_rotation(rate=0.4) + self.add_fixed_in_frame_mobjects(f2_text) + self.play(Write(f2)) + self.add(b) + self.wait(1) + self.add(a) + self.wait(3) + self.add(d) + self.wait(2) + + +class MinimaScene(ThreeDScene): + def construct(self): r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + axes = ThreeDAxes() + f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) #----graph of third function f(x,y) = x**2+y**2 @@ -42,25 +98,7 @@ class TypescpAnimation(ThreeDScene): self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.add_fixed_in_frame_mobjects(r_text) - self.wait(1) - self.play(FadeOut(r_text)) - self.add(axes) - self.play(Write(f),Write(d)) - self.add_fixed_in_frame_mobjects(f_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(1) - self.play(FadeOut(r2_text)) - self.add(axes) - self.play(Write(f2),Write(d)) - self.add_fixed_in_frame_mobjects(f2_text) - self.wait(2) - self.play(FadeOut(axes),FadeOut(f2),FadeOut(f2_text),FadeOut(d)) - + self.add_fixed_in_frame_mobjects(r3_text) self.wait(1) self.play(FadeOut(r3_text)) -- cgit From 98a66de0884c14db8f4afc9d65cc484e632a46df Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:23:00 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 1216647 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 63f2b3a..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From 437f4c0deda7dd627110ee5b14c933f0ebacb819 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:23:23 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 2676014 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..6070720 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From 9845dd6804cc62e6c89914e08c1344a6f0783f43 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:25:05 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 2676014 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 6070720..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From 4baab618c5a301d0dde0e31777e104e0b172917e Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:26:26 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 2676014 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..6070720 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From e880078de20f4ed64d4884a1293cb45ce278878b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:27:47 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 2676014 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 6070720..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From 83972a0fd42f688221c271c4d19b73ead4b9ac62 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Thu, 18 Jun 2020 03:28:29 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 2676014 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..6070720 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From a94d10724cbc5866254496becd4b4fc749f08066 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:30:31 +0530 Subject: Update file1_Critical_Point_of_a_function.py --- .../file1_Critical_Point_of_a_function.py | 94 +++++++++++++--------- 1 file changed, 55 insertions(+), 39 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py index f3c16d4..e8cb08d 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.py @@ -1,61 +1,77 @@ from manimlib.imports import* import math as m - -class CriticalPoint(ThreeDScene): +#---- case 1: parial derivatives exist at critical point of the function +class firstScene(ThreeDScene): def construct(self): axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis - surface = ParametricSurface( #---- partial derivatives of the funtion exists + #---- f(x,y) = e^(-10x^2-10y^2) + surface = ParametricSurface( lambda u, v: np.array([ u, v, - m.exp(-10*u**2-10*v**2)]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C]).fade(0.6).scale(3.5).shift([0,0,1.5]) - - surface2 = ParametricSurface( #---- partial derivatives of the funtion does not exists - lambda u, v: np.array([ - u, - v, - abs(u)+abs(v)]),u_min=-1.5,u_max=1.5, v_min=-1.5,v_max=1.5,checkerboard_colors=[TEAL_E,TEAL_D,TEAL_C,TEAL_B]) + m.exp(-10*u**2-10*v**2) + ]),u_min = -1, u_max = 1, v_min = -1, v_max = 1, checkerboard_colors = [TEAL_E,TEAL_D,TEAL_C,TEAL_B]).fade(0.6).scale(3.5).shift([0,0,1.5]) l1 = Line([0,0,3.75],[0,0,0],color = '#800000') - d = Dot([0,0,3.75],color = '#800000') #---- critical point of surface - - d2 = Dot([0,0,0],color = '#800000') #---- critical point of surface2 - - d_text = TextMobject("$\\frac{\\partial f}{\\partial x}=\\frac{\\partial f}{\\partial y} = 0$").scale(1).to_corner(UL) - - d2_text = TextMobject("$\\frac{\\partial f}{\\partial x}$ and/or $\\frac{\\partial f}{\\partial y}$ does not exist").scale(0.8).to_corner(UL) - - f_text = TextMobject("Critical Point of a function",color = YELLOW).shift([3,0,3.7]).scale(0.7) + d = Dot([0,0,3.75],color = '#800000') #---- critical point - g_text = TextMobject("Critical Point of a function",color = YELLOW).shift(1*DOWN).scale(0.5) - - self.set_camera_orientation(phi=75*DEGREES,theta=90*DEGREES) - self.add(axes) - self.begin_ambient_camera_rotation(rate=0.2) - self.play(Write(surface)) + d_text = TextMobject("$\\frac{\\partial f}{\\partial x}=\\frac{\\partial f}{\\partial y} = 0$").scale(0.8).to_corner(UL) + + f_text = TextMobject("Critical Point ",color = YELLOW).shift(3.4*UP).scale(0.5) + + self.set_camera_orientation(phi = 45*DEGREES, theta = 40*DEGREES) + self.add(axes) + self.add(label_x) + self.add(label_y) self.add_fixed_in_frame_mobjects(d_text) + self.begin_ambient_camera_rotation(rate = 0.2) + self.play(Write(surface)) self.wait(1) self.play(Write(l1)) self.play(Write(d)) self.wait(1) - self.move_camera(phi=0 * DEGREES,theta = 90*DEGREES) - self.wait(2) self.add_fixed_in_frame_mobjects(f_text) - self.play(FadeOut(f_text),FadeOut(surface),FadeOut(axes),FadeOut(d_text),FadeOut(d),FadeOut(l1)) - self.wait(1) - self.set_camera_orientation(phi=75*DEGREES,theta=60*DEGREES) - self.add(axes) - self.begin_ambient_camera_rotation(rate=0.3) - self.add_fixed_in_frame_mobjects(d2_text) - self.wait(1) + self.wait(3) + self.play(FadeOut(f_text),FadeOut(surface),FadeOut(axes),FadeOut(d_text),FadeOut(d),FadeOut(l1),FadeOut(label_x),FadeOut(label_y)) + + +#---- case 2: parial derivatives do not exist at critical point of the function +class secondScene(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- g(x,y)= |x|+|y| + surface = ParametricSurface( + lambda u, v: np.array([ + u, + v, + abs(u)+abs(v) + ]),u_min = -1.5, u_max = 1.5, v_min = -1.5, v_max = 1.5, checkerboard_colors = [TEAL_E,TEAL_D,TEAL_C,TEAL_B]) + + d2 = Dot([0,0,0],color = '#800000') #---- critical point + + d2_text = TextMobject("$\\frac{\\partial f}{\\partial x}$ and/or $\\frac{\\partial f}{\\partial y}$ does not exist").scale(0.7).to_corner(UL) + + g_text = TextMobject("Critical Point",color = YELLOW).shift(1.2*RIGHT).scale(0.6) + + self.set_camera_orientation(phi = 60*DEGREES, theta = 40*DEGREES) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.add_fixed_in_frame_mobjects(d2_text) + self.begin_ambient_camera_rotation(rate = 0.2) + self.wait(1) self.play(Write(surface2)) - l1.fade(0.4) - self.play(Write(l1)) - self.play(Write(d2)) + self.wait(1) + self.play(Write(d2)) + self.wait(1) self.add_fixed_in_frame_mobjects(g_text) - self.wait(2) - + self.wait(2) -- cgit From a0755ea6df7e229196cffb64c8f04efeea0601a7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:42:57 +0530 Subject: Update file2_Traces_and_Tangent.py --- .../Critical-Points/file2_Traces_and_Tangent.py | 105 ++++++++++----------- 1 file changed, 50 insertions(+), 55 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py index 6be4c6a..95c3af9 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -1,93 +1,88 @@ from manimlib.imports import* import math as m - +#---- tangent to the trace with x constant class firstScene(ThreeDScene): def construct(self): - axes = ThreeDAxes().scale(1.15) + axes = ThreeDAxes().scale(1) + label_x= TextMobject("$x$").shift([5.8,-0.5,0]) + label_y= TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) + + #---- graph of f(x,y) = -x^2-y^2 surface = ParametricSurface( lambda u, v: np.array([ u, v, - m.exp(-10*u**2-10*v**2) #---- f(x,y) - ]),u_min=-2,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) - - trace = ParametricSurface( + -u**2-v**2 + ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(1.5).shift([0,0,2]).rotate(0.2) + + #---- curve(trace) along y axis + curve = ParametricSurface( lambda u, v: np.array([ - m.exp(np.cos(v)+np.sin(v)), - v, - u/4 - ]), v_min = -1, v_max= 2).rotate(1.571,DOWN).shift(2.15*LEFT+[0.6,-0.4,1.54]).scale(1).set_color('#800000') + u*0.4, + v, + -v**2 + ]),v_min =-1 , v_max =1 , u_min = -0.1, u_max = 0.1).scale(1.6).shift([0.02,0.1,2.3]).set_color("#800000").rotate(0.1) - - - d = Dot(color =YELLOW).shift([1.9,0.7,4.1]) #---- critical point - tangent_line = Line(color = '#228B22').scale(1).shift([1.9,0.7,4.1]).rotate(4.5) #---- tangent along y axis + d = Dot(color =YELLOW).shift([-0.05,-0.2,2.3]) #---- critical point - label_x = TextMobject("$x$").shift([5.8,-0.5,0]) - label_y = TextMobject("$y$").shift([-0.5,5.6,0]).rotate(-4.5) + x_text = TextMobject("Tangent to the trace with $x$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) + tangent_line = Line([-0.05,-1.5,2.3],[-0.05,1.5,2.3],color = '#228B22') - f_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) - self.add(axes) - self.set_camera_orientation(phi=60*DEGREES,theta=15*DEGREES) + self.set_camera_orientation(phi = 40 * DEGREES, theta = 55 * DEGREES) + self.begin_ambient_camera_rotation(rate = 0.1) self.add(label_x) self.add(label_y) self.play(Write(surface)) - self.wait(1) - self.add_fixed_in_frame_mobjects(s_text) - self.add(trace) + self.add_fixed_in_frame_mobjects(x_text) + self.add(curve) self.wait(1) self.play(Write(tangent_line),Write(d)) - self.wait(2) - - + self.wait(1) + + + +#---- tangent to the trace with y constant class secondScene(ThreeDScene): def construct(self): - axes = ThreeDAxes().scale(1.15) + axes = ThreeDAxes().scale(1) + label_x= TextMobject("$x$").shift([5.8,-0.5,0]) + label_y= TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) + + #---- graph of f(x,y) = -x^2-y^2 surface = ParametricSurface( lambda u, v: np.array([ u, v, - m.exp(-10*u**2-10*v**2) #---- f(x,y) - ]),u_min=-1,u_max=1, v_min=-1,v_max=1,checkerboard_colors=[PURPLE_C,PURPLE_D,PURPLE_E,PURPLE_B]).scale(3).shift([1.1,0.48,1.731]) + -u**2-v**2 + ]),u_min = -1, u_max = 1, v_min = -1, v_max = 1, checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D,PURPLE_E]).scale(1.5).shift([0,0,2]).rotate(0.2) - trace = ParametricSurface( + #---- curve(trace) along x axis + curve = ParametricSurface( lambda u, v: np.array([ - m.exp(np.cos(v)+np.sin(v)), - v, - u/4 - ]), v_min = -1, v_max= 2).rotate(1.571,DOWN).shift(2.15*LEFT+[0.6,-0.4,1.54]).scale(1).set_color('#800000') - - + u, + v*0.4, + -u**2 + ]),v_min = -0.1, v_max = 0.1, u_min = -1, u_max = 1).scale(1.6).shift([0.07,0.1,2.3]).set_color("#800000") - d = Dot(color =YELLOW).shift([1.9,0.7,4.1]) #---- critical point - - label_x = TextMobject("$x$").shift([5.8,-0.5,0]) - label_y = TextMobject("$y$").shift([-0.5,5.6,0]).rotate(-4.5) - - f_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) + d = Dot(color = YELLOW).shift([0,-0.2,2.3]) #---- critical point - tangent_line = Line(color = '#228B22').scale(1).shift([1.9,0.7,4.1]) #---- tangent along x axis - + tangent_line = Line(color = '#228B22').scale(1).shift([0,-0.2,2.3]).rotate(m.radians(190),LEFT) + + y_text = TextMobject("Tangent to the trace with $y$ constant at critical point").shift(3*RIGHT+2*UP).scale(0.5).to_corner(UL) self.add(axes) - self.set_camera_orientation(phi=60*DEGREES,theta=15*DEGREES) + self.set_camera_orientation(phi = 40 * DEGREES, theta = 55 * DEGREES) self.add(label_x) self.add(label_y) + self.begin_ambient_camera_rotation(rate = 0.1) self.play(Write(surface)) - self.wait(1) - self.add_fixed_in_frame_mobjects(f_text) - trace.rotate(-5).shift(0.2*RIGHT+0.8*UP+[0.6,-0.4,0.6]) - self.add(trace) + self.add_fixed_in_frame_mobjects(y_text) + self.add(curve) + self.wait(1.5) self.play(Write(tangent_line),Write(d)) - self.wait(1) - - - - - - + self.wait(0.5) -- cgit From ad1c0e62ba7ff5bb9612a8fd674005a26e3fd80b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:44:00 +0530 Subject: Update file2_Traces_and_Tangent.py --- .../Critical-Points/file2_Traces_and_Tangent.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py index 95c3af9..4b020e1 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.py @@ -6,8 +6,8 @@ class firstScene(ThreeDScene): def construct(self): axes = ThreeDAxes().scale(1) - label_x= TextMobject("$x$").shift([5.8,-0.5,0]) - label_y= TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) + label_x = TextMobject("$x$").shift([5.8,-0.5,0]) + label_y = TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) #---- graph of f(x,y) = -x^2-y^2 surface = ParametricSurface( @@ -50,8 +50,8 @@ class secondScene(ThreeDScene): def construct(self): axes = ThreeDAxes().scale(1) - label_x= TextMobject("$x$").shift([5.8,-0.5,0]) - label_y= TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) + label_x = TextMobject("$x$").shift([5.8,-0.5,0]) + label_y = TextMobject("$y$").shift([-0.5,-5.6,0]).rotate(-4.5) #---- graph of f(x,y) = -x^2-y^2 surface = ParametricSurface( -- cgit From 6e5e6936f498a12a514371060916691495cf8c20 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:44:44 +0530 Subject: Update file3_Tangent_plane_at_extrema_of_a_function.py --- ...file3_Tangent_plane_at_extrema_of_a_function.py | 82 ++++++++++++++-------- 1 file changed, 51 insertions(+), 31 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py index b066d04..e674113 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.py @@ -1,53 +1,73 @@ from manimlib.imports import* -class TangentPlane(ThreeDScene): +#---- tangent plane to minima of the function +class firstScene(ThreeDScene): def construct(self): axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis - #----parabola: x**2+y**2 - parabola1 = ParametricSurface( + #---- parabola: f(x,y) = x**2 + y**2 + parabola = ParametricSurface( lambda u, v: np.array([ u, v, u**2+v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[GREEN_E,GREEN_D,GREEN_C,GREEN_B], - resolution=(20, 20)).scale(1) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [GREEN_E,GREEN_D,GREEN_C,GREEN_B], resolution = (20, 20)).scale(1) - #----parabola: -x**2-y**2 - parabola2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[BLUE_E,BLUE_D,BLUE_C,BLUE_B], - resolution=(20, 20)).scale(1) - - self.set_camera_orientation(phi=75 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.2) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - r = Rectangle(fill_color= '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) #----tangent plane + d = Dot(np.array([0,0,0]), color = '#800000') # ---- critical point - parabola1_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + tangent_plane = Rectangle(fill_color = '#C0C0C0', fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) # ----tangent plane - parabola2_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + parabola_text = TextMobject("Minimum with horizontal tangent plane").scale(0.7).to_corner(UL) + self.set_camera_orientation(phi = 75 * DEGREES, theta = 45 * DEGREES) + self.begin_ambient_camera_rotation(rate = 0.2) self.add(axes) - self.add_fixed_in_frame_mobjects(parabola2_text) + self.add(label_x) + self.add(label_y) + self.add_fixed_in_frame_mobjects(parabola_text) self.wait(1) - self.play(Write(parabola1)) + self.play(Write(parabola)) self.play(ShowCreation(d)) self.wait(1) - self.play(ShowCreation(r)) + self.play(ShowCreation(tangent_plane)) self.wait(2) - self.play(FadeOut(parabola2_text),FadeOut(parabola1),FadeOut(r),FadeOut(d)) + self.play(FadeOut(parabola_text),FadeOut(parabola),FadeOut(tangent_plane),FadeOut(d),FadeOut(label_x),FadeOut(label_y),FadeOut(axes)) + + +#---- tangent plane to maxima of the function +class secondScene(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis - self.wait(1) - self.add_fixed_in_frame_mobjects(parabola1_text) - self.wait(1) - self.play(Write(parabola2)) + #----parabola: g(x,y) = -x**2-y**2 + parabola = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [BLUE_E,BLUE_D,BLUE_C,BLUE_B], resolution = (20, 20)).scale(1) + + d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + + tangent_plane = Rectangle(fill_color = '#C0C0C0',fill_opacity = 0.3).move_to(ORIGIN).fade(0.7) #---- tangent plane + + parabola_text = TextMobject("Maximum with horizontal tangent plane").scale(0.7).to_corner(UL) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 45 * DEGREES) + self.begin_ambient_camera_rotation(rate = 0.2) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.add_fixed_in_frame_mobjects(parabola_text) + self.wait(1) + self.play(Write(parabola)) self.play(ShowCreation(d)) self.wait(1) - self.play(ShowCreation(r)) - self.wait(1) + self.play(ShowCreation(tangent_plane)) + self.wait(2) -- cgit From 53563c2c640988232b1f6a61020e2ce7b3e609f1 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:46:50 +0530 Subject: Update file4_Types_of_critical_points.py --- .../file4_Types_of_critical_points.py | 172 ++++++++++++--------- 1 file changed, 99 insertions(+), 73 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py index 42703ba..656fb68 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.py @@ -1,108 +1,134 @@ -from manimlib.imports import * +from manimlib.imports import* + - -class MaximaScene(ThreeDScene): +#---- Relative Maxima +class firstScene(ThreeDScene): def construct(self): - axes = ThreeDAxes() - + r_text = TextMobject("Relative Maximum at ORIGIN",color ='#87CEFA') - f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) - #----graph of first function f(x,y) = -x**2-y**2 - f = ParametricSurface( + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #----graph of the function f(x,y) = -x**2-y**2 + surface = ParametricSurface( lambda u, v: np.array([ u, v, -u**2-v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E], - resolution = (20, 20)).scale(1.5).shift([0,0,-0.51]).fade(0.3) - - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point - - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E]).scale(1.5).shift([0,0,-0.51]).fade(0.3) + + f_text = TextMobject("$f(x,y) = -x^2-y^2$").to_corner(UL) + + d = Dot(color = "#800000").shift([0,0,0]) #---- critical point + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 45 * DEGREES) self.add_fixed_in_frame_mobjects(r_text) self.wait(1) self.play(FadeOut(r_text)) + self.begin_ambient_camera_rotation(rate = 0.1) self.add(axes) - self.play(Write(f),Write(d)) + self.add(label_x) + self.add(label_y) + self.play(Write(surface),Write(d)) self.add_fixed_in_frame_mobjects(f_text) self.wait(2) - self.play(FadeOut(axes),FadeOut(f),FadeOut(f_text),FadeOut(d)) - -class SaddlePoint(ThreeDScene): + self.play(FadeOut(axes),FadeOut(surface),FadeOut(f_text),FadeOut(d),FadeOut(label_x),FadeOut(label_y)) + + +#---- Relative Minima +class secondScene(ThreeDScene): def construct(self): - r2_text = TextMobject("Saddle Point",color ='#87CEFA') + r2_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + axes = ThreeDAxes() - - #----graph of third function f(x,y) = -x**2+y**2 - f2 = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1,checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D,PURPLE_E]).scale(1.5).shift([0,0,0]) - - #---- trace along y axis - a = ParametricSurface( - lambda u, v: np.array([ - u, - v, - v**2 - ]),v_min = -1, v_max = 1, u_min = -0.2, u_max = 0.2).shift([0,0,0.36]).scale(1.5).set_color(GREEN) - - #---- trace along x axis - b = ParametricSurface( + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #----graph of the function g(x,y) = x**2+y**2 + surface = ParametricSurface( lambda u, v: np.array([ u, v, - -u**2 - ]),v_min = -0.2, v_max = 0.2, u_min = -1, u_max = 1).scale(1.6).shift([0,0,-0.1]).set_color(GREEN) - - d = Dot(color = '#800000').shift([0,0,0.1]) #---- critical point - - f2_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors =[TEAL_B,TEAL_C,TEAL_D,TEAL_E]).scale(1.5).shift([0,0,0.55]).fade(0.1) + + d = Dot(color = "#800000").shift([0,0,0]) #---- critical point + g_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 45 * DEGREES) self.add_fixed_in_frame_mobjects(r2_text) self.wait(1) - self.set_camera_orientation(phi=75*DEGREES,theta=10*DEGREES) self.play(FadeOut(r2_text)) - self.add(axes) - self.begin_ambient_camera_rotation(rate=0.4) - self.add_fixed_in_frame_mobjects(f2_text) - self.play(Write(f2)) - self.add(b) - self.wait(1) - self.add(a) - self.wait(3) - self.add(d) + self.begin_ambient_camera_rotation(rate = 0.1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(surface),Write(d)) + self.add_fixed_in_frame_mobjects(g_text) self.wait(2) - - -class MinimaScene(ThreeDScene): + self.play(FadeOut(axes),FadeOut(surface),FadeOut(g_text),FadeOut(d),FadeOut(label_x),FadeOut(label_y)) + + + +#---- Saddle Point +class thirdScene(ThreeDScene): def construct(self): - - r3_text = TextMobject("Relative Minimum at ORIGIN",color ='#87CEFA') + + r3_text = TextMobject("Saddle Point", color = '#87CEFA') + axes = ThreeDAxes() - - f3_text = TextMobject("$f(x,y) = x^2+y^2$").to_corner(UL) - - #----graph of third function f(x,y) = x**2+y**2 - f3 = ParametricSurface( + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- graph of function h(x,y) = -x^2 + y^2 + surface = ParametricSurface( lambda u, v: np.array([ u, v, - u**2+v**2 - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors =[TEAL_B,TEAL_C,TEAL_D,TEAL_E], - resolution = (20, 20)).scale(1.5).shift([0,0,0.55]).fade(0.1) + -u**2+v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1,checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D,PURPLE_E]).scale(1.5).shift([0,0,0]) - self.set_camera_orientation(phi = 75 * DEGREES, theta = -45 * DEGREES ) - d = Dot(np.array([0,0,0]), color = '#800000') #---- critical point + #---- curve(trace) along x axis + curve_x = ParametricSurface( + lambda u, v: np.array([ + u*0.4, + v, + v**2 + ]),v_min = -1, v_max = 1, u_min = -0.2, u_max = 0.2).shift([0,0,0.34]).scale(1.5).set_color("#800000") + + #---- curve(trace) along y axis + curve_y = ParametricSurface( + lambda u, v: np.array([ + u, + v*0.4, + -u**2 + ]),v_min = -0.2, v_max = 0.2, u_min = -1, u_max = 1).scale(1.6).shift([0,0,-0.1]).set_color("#800000") + d = Dot(color = GREEN).shift([0,0,0.1]) #---- critical point + + h_text = TextMobject("$f(x,y) = -x^2+y^2$").to_corner(UL) + self.add_fixed_in_frame_mobjects(r3_text) self.wait(1) + self.set_camera_orientation(phi = 50 * DEGREES,theta = 45 * DEGREES) self.play(FadeOut(r3_text)) - self.add(axes) - self.play(Write(f3),Write(d)) - self.add_fixed_in_frame_mobjects(f3_text) - self.wait(2) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.begin_ambient_camera_rotation(rate = 0.3) + self.add_fixed_in_frame_mobjects(h_text) + self.play(Write(surface)) + self.wait(1) + self.add(curve_y) + self.add(d) + self.wait(1) + self.play(FadeOut(curve_y)) + self.wait(1) + self.add(curve_x) + self.wait(1) + self.add(d) + self.wait(1) -- cgit From 0560d86317ed48bb7cefa3785d511148803f5faa Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:47:30 +0530 Subject: Update file5_f(x,y)=(y-x)(1-2x-3y).py --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py index 8a90990..41c3b61 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).py @@ -1,25 +1,29 @@ from manimlib.imports import* +#---- visualization of the function class ExampleAnimation(ThreeDScene): def construct(self): axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis - f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - - #----f(x,y) = (y-x)(1-2x-3y) - f = ParametricSurface( + #---- f(x,y) = (y-x)(1-2x-3y) + surface = ParametricSurface( lambda u, v: np.array([ u, v, (v-u)*(1-2*u-3*v) - ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D, PURPLE_E], - resolution=(20, 20)).scale(1).fade(0.2).shift([0.2,0.2,0]) + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [PURPLE_B,PURPLE_C,PURPLE_D, PURPLE_E]).scale(1).fade(0.2).shift([0.2,0.2,0]) + + f_text = TextMobject("$f(x,y) = (y-x)(1-2x-3y)$").to_corner(UL) - self.set_camera_orientation(phi = 75 * DEGREES,theta= 60*DEGREES) + self.set_camera_orientation(phi = 60 * DEGREES, theta = 75 * DEGREES) self.begin_ambient_camera_rotation(rate=0.1) - self.add_fixed_in_frame_mobjects(f_text) self.wait(1) self.add(axes) + self.add(label_x) + self.add(label_y) + self.wait(1) self.play(Write(f)) - self.wait(3) + self.wait(4) -- cgit From 24740d5f0847b83fb00fd7c1c11079f5ab0f85fd Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:51:18 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 7079252 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index c376e2d..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From e1655eb3623d275b48cd662c0e325384072c5452 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:52:19 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 8077401 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..ca3989c Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From e62f39b12bd273d5e3d47c00c69f7bf59c0457fe Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:53:14 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 8077401 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index ca3989c..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From b9d4f3663f2b6555162c950850a5e73fe26a408c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:54:33 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 8077401 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..ca3989c Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From 2c55441285f10c62f65f69b51a7c18fa3a2eec10 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:01 +0530 Subject: Delete file1_Critical_Point_of_a_function.gif --- .../file1_Critical_Point_of_a_function.gif | Bin 8077401 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif deleted file mode 100644 index ca3989c..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif and /dev/null differ -- cgit From 90b416dbcf171c2c85693923cf678ca39737f2ff Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:15 +0530 Subject: Delete file2_Traces_and_Tangent.gif --- .../Critical-Points/file2_Traces_and_Tangent.gif | Bin 1105801 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif deleted file mode 100644 index e7a2a46..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif and /dev/null differ -- cgit From d86548e2c9ebd0d45ad1a203c5768aca4e9a319f Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:30 +0530 Subject: Delete file3_Tangent_plane_at_extrema_of_a_function.gif --- .../file3_Tangent_plane_at_extrema_of_a_function.gif | Bin 2195510 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif deleted file mode 100644 index 41c72cc..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif and /dev/null differ -- cgit From bed3d0967b74a6bcb90d5f0438b21c44b5515777 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:46 +0530 Subject: Delete file4_Types_of_critical_points.gif --- .../file4_Types_of_critical_points.gif | Bin 2676014 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif deleted file mode 100644 index 6070720..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif and /dev/null differ -- cgit From 8dffdbbf184c9bda9134b692c6793839c88ed337 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:56:57 +0530 Subject: Delete file5_f(x,y)=(y-x)(1-2x-3y).gif --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 1231893 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif deleted file mode 100644 index 0a2785e..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif and /dev/null differ -- cgit From 0baac10a6e293c6fcdd777f0db48512560f25cee Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:57:46 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 8780553..994622e 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,4 +1,4 @@ -1. Critical Points +SubTopic: Critical Points

-------- Animations -------- -- cgit From ec24b630e802c6fbc628f01cd9f0fe584570ddce Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 00:59:15 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 994622e..7ad6070 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,4 +1,4 @@ -SubTopic: Critical Points +SubTopic: Critical Points

-------- Animations -------- @@ -7,30 +7,30 @@ SubTopic: Critical Points file1_Critical_Point_of_a_function -![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true) +![](?raw=true)



file2_Traces_and_Tangent - ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) + ![](?raw=true)



file3_Tangent_plane_at_extrema_of_a_function - ![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) + ![](?raw=true)



file4_Types_of_critical_points - ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) + ![](?raw=true)



file5_f(x,y)=(y-x)(1-2x-3y) - ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) + ![](f?raw=true)



-- cgit From 32f8ba3ba6a2453ac08afa7eccc9e726b92b1669 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:00:44 +0530 Subject: Add files via upload --- .../file1_Critical_Point_of_a_function.gif | Bin 0 -> 8077401 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif new file mode 100644 index 0000000..ca3989c Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif differ -- cgit From 16f529f4af22e97785fadbcafa3007f11eeaf438 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:01:47 +0530 Subject: Add files via upload --- .../Critical-Points/file2_Traces_and_Tangent.gif | Bin 0 -> 2552938 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif new file mode 100644 index 0000000..84acf2e Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif differ -- cgit From 2597b0e7e3de8bb7211ebac8a0def0d2b90593f8 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:03:20 +0530 Subject: Add files via upload --- .../file3_Tangent_plane_at_extrema_of_a_function.gif | Bin 0 -> 2198637 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif new file mode 100644 index 0000000..14fb318 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif differ -- cgit From a45facc8c59dd1e7a93a91e0a3373c75586f8284 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:04:54 +0530 Subject: Add files via upload --- .../file4_Types_of_critical_points.gif | Bin 0 -> 3864765 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif new file mode 100644 index 0000000..91e7084 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif differ -- cgit From 73eb502063fa9e6c9b4182e4ebb61b85a3398f9c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:06:06 +0530 Subject: Add files via upload --- .../Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif | Bin 0 -> 1522415 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif new file mode 100644 index 0000000..4bc92f8 Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x,y)=(y-x)(1-2x-3y).gif differ -- cgit From f4fe7f0a658736bfa68f3da693f45dc3b366fa4d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:09:04 +0530 Subject: Update README.md --- .../approximations-and-optimizations/Critical-Points/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 7ad6070..c8722a3 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -7,30 +7,30 @@ file1_Critical_Point_of_a_function -![](?raw=true) +![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true)



file2_Traces_and_Tangent - ![](?raw=true) + ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true)



file3_Tangent_plane_at_extrema_of_a_function - ![](?raw=true) + ![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true)



file4_Types_of_critical_points - ![](?raw=true) + ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true)



file5_f(x,y)=(y-x)(1-2x-3y) - ![](f?raw=true) + ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



-- cgit From 143e210fd2234377ff23b0728c4c2583e8ddb336 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:11:45 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index c8722a3..c665c78 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,6 +1,6 @@ -SubTopic: Critical Points +

SubTopic: Critical Points



--------- Animations -------- +

-------- Animations --------





@@ -33,7 +33,7 @@ ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



- + -- cgit From bf1fd9d635a0450f062af7303f9e1f28e82e138b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:13:23 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index c665c78..4c5021d 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,34 +1,38 @@ -

SubTopic: Critical Points

+

SubTopic: Critical Points



-

-------- Animations --------

+

Animations





- file1_Critical_Point_of_a_function +
file1_Critical_Point_of_a_function ![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true)



+
-file2_Traces_and_Tangent +
file2_Traces_and_Tangent ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true)



+
-file3_Tangent_plane_at_extrema_of_a_function +
file3_Tangent_plane_at_extrema_of_a_function ![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true)



+
-file4_Types_of_critical_points +
file4_Types_of_critical_points ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true)



+
-file5_f(x,y)=(y-x)(1-2x-3y) +
file5_f(x,y)=(y-x)(1-2x-3y) ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)

-- cgit From 02a447e3288b5b5fd0b46a330e197b8fe2717e0b Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:15:25 +0530 Subject: Update README.md --- .../Critical-Points/README.md | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 4c5021d..598607b 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,43 +1,36 @@ -

SubTopic: Critical Points

+

SubTopic: Critical Points



-

Animations

+

Animations





-
file1_Critical_Point_of_a_function +file1_Critical_Point_of_a_function ![file1_Critical_Point_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file1_Critical_Point_of_a_function.gif?raw=true)



-
-
file2_Traces_and_Tangent +file2_Traces_and_Tangent - ![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true) +![file2_Traces_and_Tangent](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file2_Traces_and_Tangent.gif?raw=true)



-
-
file3_Tangent_plane_at_extrema_of_a_function - ![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true) +file3_Tangent_plane_at_extrema_of_a_function + +![file3_Tangent_plane_at_extrema_of_a_function](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file3_Tangent_plane_at_extrema_of_a_function.gif?raw=true)



-
-
file4_Types_of_critical_points +file4_Types_of_critical_points - ![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true) +![file4_Types_of_critical_points](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file4_Types_of_critical_points.gif?raw=true)



-
-
file5_f(x,y)=(y-x)(1-2x-3y) +file5_f(x,y)=(y-x)(1-2x-3y) - ![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true) +![file5_f(x,y)=(y-x)(1-2x-3y)](https://github.com/vnb09/FSF-mathematics-python-code-archive/blob/fsf_tasks/FSF-2020/approximations-and-optimizations/Critical-Points/file5_f(x%2Cy)%3D(y-x)(1-2x-3y).gif?raw=true)



-
- - - -- cgit From 3bf2eb6ac38722218f5a9b3ab89c12629073ed9d Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:16:02 +0530 Subject: Update README.md --- FSF-2020/approximations-and-optimizations/Critical-Points/README.md | 4 ---- 1 file changed, 4 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md index 598607b..f0747bb 100644 --- a/FSF-2020/approximations-and-optimizations/Critical-Points/README.md +++ b/FSF-2020/approximations-and-optimizations/Critical-Points/README.md @@ -1,9 +1,5 @@

SubTopic: Critical Points



-

Animations

- -

-

file1_Critical_Point_of_a_function -- cgit From 14038e183235f0c3c9c8b354e1e16b17728e4bbf Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:45:49 +0530 Subject: Create file1_Second_order_partial_derivatives.py Source code of first animation of the lecture note: The second derivative test--- .../file1_Second_order_partial_derivatives.py | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py new file mode 100644 index 0000000..84052cc --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.py @@ -0,0 +1,78 @@ +from manimlib.imports import* + +#---- graphs of second-order partial derivatives of a function +class SurfacesAnimation(ThreeDScene): + def construct(self): + + axes = ThreeDAxes() + x_label = TextMobject('$x$').shift([5,0.5,0]) #---- x axis + y_label = TextMobject('$y$').shift([0.5,4,0]).rotate(-4.5) #---- y axis + + #---- surface of function: f(x,y) = (x^2+y^2)^2 + surface_f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + ((u**2)+(v**2))**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[GREEN_D, GREEN_E]).scale(1) + + #---- surface of second-order partial derivative f_xx + surface_fxx = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (3*u**2)+(v**2) + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[YELLOW_D, YELLOW_E]).shift([0,0,0]).scale(0.6) + + #---- surface of second-order partial derivative f_yy + surface_fyy = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (u**2)+(3*v**2) + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[PURPLE_D, PURPLE_E]).scale(0.6).shift([0,0,0]) + + #---- surface of second-order partial derivative f_xy = f_yx + surface_fxy = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 8*u*v + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_D, TEAL_E]).scale(0.6) + + f_text= TextMobject("$f(x,y) = (x^2+y^2)^2$",color = GREEN).scale(0.7).to_corner(UL) + + fxx_text= TextMobject("$f_{xx} = 12x^2+4y^2$ (Concavity along x axis)",color = YELLOW).scale(0.5).to_corner(UL) + + fyy_text= TextMobject("$f_{yy} = 4x^2+12y^2$(Concavity along y axis)",color = PURPLE).scale(0.5).to_corner(UL) + + fxy_text= TextMobject("$f_{xy} = f_{yx} = 8xy$ (Twisting of the function)",color = TEAL).scale(0.5).to_corner(UL) + + + self.set_camera_orientation(phi = 40 * DEGREES, theta = 45 * DEGREES) + self.begin_ambient_camera_rotation(rate = 0.1) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.add(x_label) + self.add(y_label) + self.wait(1) + self.play(Write(surface_f)) + self.wait(2) + self.play(FadeOut(f_text)) + + + self.play(ReplacementTransform(surface_f,surface_fxx)) + + self.add_fixed_in_frame_mobjects(fxx_text) + self.wait(2) + self.play(FadeOut(fxx_text)) + + self.play(ReplacementTransform(surface_fxx,surface_fyy)) + self.add_fixed_in_frame_mobjects(fyy_text) + self.wait(2) + self.play(FadeOut(fyy_text)) + + self.play(ReplacementTransform(surface_fyy,surface_fxy)) + self.move_camera(phi = 35 * DEGREES, theta = 80 * DEGREES) + self.add_fixed_in_frame_mobjects(fxy_text) + self.wait(2) -- cgit From 7cfd798434a60d8664b3a0eff04193cfd93b50ab Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 01:49:25 +0530 Subject: Add files via upload --- .../file1_Second_order_partial_derivatives.gif | Bin 0 -> 3166332 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif new file mode 100644 index 0000000..3471e4d Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file1_Second_order_partial_derivatives.gif differ -- cgit From 14a06e6bf4ed8a5a661555f193ba145fe8121b86 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 02:04:03 +0530 Subject: Create file4_Contour_Diagram.py --- .../file4_Contour_Diagram.py | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py new file mode 100644 index 0000000..618dcbd --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py @@ -0,0 +1,121 @@ +from manimlib.imports import* + +#---- contour diagram animation +class ContourDiagram(ThreeDScene): + def construct(self): + + heading = TextMobject("CONTOUR DIAGRAM", color = YELLOW).scale(1) + + axes = ThreeDAxes() + label_x = TextMobject("$x$").shift([5.5,-0.5,0]) #---- x axis + label_y = TextMobject("$y$").shift([-0.5,5.5,0]).rotate(-4.5) #---- y axis + + #---- surface of a paraboloid + surface = ParametricSurface( + lambda u, v: np.array([ + np.cos(v)*u, + np.sin(v)*u, + u**2 + ]),v_min = -2, v_max = 2, u_min = -2, u_max = 2, checkerboard_colors = [GREEN_B,GREEN_C,GREEN_D,GREEN_E]).shift([0,0,0]).scale(0.5) + + #---- first contour projection + contour1 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 2.5*u) + ])).fade(0.5).scale(0.21).shift([0,0,1.01]) + + #---- first contour line + c_1 = Circle(color = BLUE).scale(0.21).shift([0,0,0]).rotate(0.1,DOWN) + + #------------------------------------------------- + + #---- second contour projection + contour2 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 1.6*u) + ])).fade(0.5).scale(0.41).shift([0,0,0.3]).set_color(RED) + + #---- second contour line + c_2 = Circle(color = RED).scale(0.41).shift([0,0,0]).rotate(0.1,DOWN) + + #------------------------------------------------- + + #---- third contour projection + contour3 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 1.5*u) + ]), + resolution=(6, 32)).fade(0.5).scale(0.61).shift([0,0,0.4]).set_color(YELLOW) + + #---- third contour line + c_3 = Circle(color = YELLOW).scale(0.61).shift([0,0,0]) + + #------------------------------------------------- + + #---- fourth contour projection + contour4 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 1.5*u) + ])).fade(0.7).scale(0.81).shift([0,0,0.7]).set_color(PINK) + + #---- fourth contour line + c_4 = Circle(color = PINK).scale(0.81).shift([0,0,0]) + + #------------------------------------------------- + + #---- fifth contour projection + contour5 = ParametricSurface( + lambda u, v: np.array([ + np.cos(TAU * v), + np.sin(TAU * v), + 2*(1 - 1.5*u) + ])).fade(0.7).scale(1.01).shift([0,0,1]).set_color(PURPLE) + + #---- fifth contour line + c_5 = Circle(color = PURPLE).scale(1.01).shift([0,0,0]) + + c_text= TextMobject("Contour Lines").scale(0.5).shift(2*DOWN) + s = Square().scale(1.3) + + self.set_camera_orientation(phi = 75 * DEGREES, theta = 10 * DEGREES) + self.add_fixed_in_frame_mobjects(heading) + self.wait(1) + self.play(FadeOut(heading)) + self.wait(1) + self.add(axes) + self.add(label_x) + self.add(label_y) + self.play(Write(surface)) + self.wait(1) + self.add(contour1) + self.wait(1) + self.play(Write(c_1)) + self.play(ReplacementTransform(contour1,contour2)) + self.wait(1) + self.play(Write(c_2)) + self.play(ReplacementTransform(contour2,contour3)) + self.wait(1) + self.play(Write(c_3)) + self.play(ReplacementTransform(contour3,contour4)) + self.wait(1) + self.play(Write(c_4)) + self.play(ReplacementTransform(contour4,contour5)) + self.wait(1) + self.play(Write(c_5)) + self.wait(1) + self.play(FadeOut(contour5),FadeOut(axes),FadeOut(f),FadeOut(contour5),FadeOut(contour4),FadeOut(contour3),FadeOut(contour2),FadeOut(contour1)) + self.wait(1) + self.move_camera(phi=0 * DEGREES,theta= 90*DEGREES) + self.wait(1) + self.add_fixed_in_frame_mobjects(c_text) + self.wait(1) + self.play(ShowCreation(s),FadeOut(c_text)) + self.wait(1) -- cgit From 1a3fcb648c8be25ff2a21833c532330be6c5238c Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 02:44:28 +0530 Subject: Update file4_Contour_Diagram.py --- .../The-Second-Derivative-Test/file4_Contour_Diagram.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py index 618dcbd..d3084e2 100644 --- a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py +++ b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.py @@ -50,8 +50,7 @@ class ContourDiagram(ThreeDScene): np.cos(TAU * v), np.sin(TAU * v), 2*(1 - 1.5*u) - ]), - resolution=(6, 32)).fade(0.5).scale(0.61).shift([0,0,0.4]).set_color(YELLOW) + ])).fade(0.5).scale(0.61).shift([0,0,0.4]).set_color(YELLOW) #---- third contour line c_3 = Circle(color = YELLOW).scale(0.61).shift([0,0,0]) @@ -111,7 +110,7 @@ class ContourDiagram(ThreeDScene): self.wait(1) self.play(Write(c_5)) self.wait(1) - self.play(FadeOut(contour5),FadeOut(axes),FadeOut(f),FadeOut(contour5),FadeOut(contour4),FadeOut(contour3),FadeOut(contour2),FadeOut(contour1)) + self.play(FadeOut(contour5),FadeOut(axes),FadeOut(label_x),FadeOut(label_y),FadeOut(surface),FadeOut(contour5),FadeOut(contour4),FadeOut(contour3),FadeOut(contour2),FadeOut(contour1)) self.wait(1) self.move_camera(phi=0 * DEGREES,theta= 90*DEGREES) self.wait(1) -- cgit From 51b69836caaea9743d6d4a3c91a789b3fdc8ceee Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 02:47:35 +0530 Subject: Add files via upload --- .../file4_Contour_Diagram.gif | Bin 0 -> 1150777 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif new file mode 100644 index 0000000..129fedc Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file4_Contour_Diagram.gif differ -- cgit From 39e28347b3584d3077cefa2b303d6fa6ac802feb Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:47:48 +0530 Subject: Create file2_Degenerate_Hessian_Matrix.py --- .../file2_Degenerate_Hessian_Matrix.py | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py new file mode 100644 index 0000000..c1e3516 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file2_Degenerate_Hessian_Matrix.py @@ -0,0 +1,52 @@ +from manimlib.imports import* + +class firstscene(Scene): + def construct(self): + + h_text = TextMobject("Degenerate Hessian Matrix", color = RED).scale(1).shift(UP) + + + f_text = TextMobject("$f(x,y) = 2x^3+y^3$", color = TEAL).scale(1).to_corner(UL) + c_text = TextMobject("Critical Point: $(0,0)$", color = TEAL).scale(1).next_to(f_text).shift(DOWN+4.3*LEFT) + m_text = TextMobject("\\begin{equation*} D_2(x,y)= \\begin{vmatrix} 12x\\space & 0\\space \\\\ 0 & 6y \\end{vmatrix} \\end{equation*}",color = YELLOW) + d_text = TextMobject("\\begin{equation*} D_2(0,0)= \\begin{vmatrix} 0 \\space & 0\\space \\\\ 0 & 0 \\end{vmatrix} \\end{equation*}",color = PURPLE) + + + t_text = TextMobject("$D_2 = 0$(Inconclusive)", color = TEAL).scale(1).shift(2*DOWN) + + self.play(ShowCreation(h_text)) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.play(ShowCreation(f_text)) + self.wait(1) + self.play(ShowCreation(c_text)) + self.wait(1) + self.play(ShowCreation(m_text)) + self.wait(2) + self.play(ReplacementTransform(m_text,d_text)) + self.wait(1) + self.play(ShowCreation(t_text)) + self.wait(2) + + +class SecondScene(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + (2*u**3)+v**3 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[TEAL_C,YELLOW_D,BLUE_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=25 * DEGREES,theta = 80*DEGREES) + self.begin_ambient_camera_rotation(rate=0.1) + + f_text = TextMobject("$f(x,y) = 2x^3+y^3$",color = ORANGE).shift(2*DOWN+2*RIGHT).scale(0.8) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.play(Write(f)) + self.wait(2) -- cgit From 355abf1850e7884e91f6bcf4fc35272a704b45b7 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:48:41 +0530 Subject: Create file3_Nondegenerate_Hessian_Matrix.py --- .../file3_Nondegenerate_Hessian_Matrix.py | 145 +++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py new file mode 100644 index 0000000..3056842 --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/The-Second-Derivative-Test/file3_Nondegenerate_Hessian_Matrix.py @@ -0,0 +1,145 @@ +from manimlib.imports import* + +class firstScene(Scene): + def construct(self): + + e_text = TextMobject("Case 3: One positive and one negative eigenvalue", color = YELLOW).scale(1).shift(3*UP+1*LEFT) + f_text = TextMobject("$f(x,y) = x^2-2y^2-2x$").scale(0.8).next_to(e_text).shift(6*LEFT+DOWN) + c_text = TextMobject("Critical Point: $(1,0)$").scale(0.8).next_to(f_text).shift(DOWN+4*LEFT) + d_text = TextMobject("\\begin{equation*} D_2(1,0)= \\begin{vmatrix} 2 \\space & 0\\space \\\\ 0 & -4 \\end{vmatrix} \\end{equation*}",color = GREEN).scale(0.9) + + t_text = TextMobject("$D_2 = -8<0$ (Saddle Point)", color = BLUE).scale(0.9).shift(2*DOWN) + + self.play(ShowCreation(e_text)) + self.wait(1) + self.play(ShowCreation(f_text)) + self.wait(1) + self.play(ShowCreation(c_text)) + self.wait(1) + self.play(ShowCreation(d_text)) + self.wait(1) + self.play(ShowCreation(t_text)) + self.wait(2) + +class SaddlePoint(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + u**2-2*v**2-2*u + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[RED_C,PURPLE_D,YELLOW_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=35 * DEGREES,theta=80*DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + f_text = TextMobject("$f(x,y) = x^2-2y^2-2x$",color = GREEN).shift(2*DOWN+2*RIGHT).scale(0.8) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.play(Write(f)) + self.wait(3) + + +class secondScene(Scene): + def construct(self): + + h_text = TextMobject("NonDegenerate Hessian Matrix", color = GREEN).scale(1).shift(UP) + e_text = TextMobject("Case 1: Two positive eigenvalues", color = PINK).scale(1).shift(3*UP+2*LEFT) + f_text = TextMobject("$f(x,y) = 2x^2+3y^2-2yx$",color = TEAL).scale(0.8).next_to(e_text).shift(6*LEFT+DOWN) + c_text = TextMobject("Critical Point: $(0,0)$",color = TEAL).scale(0.8).next_to(f_text).shift(DOWN+4.5*LEFT) + d_text = TextMobject("\\begin{equation*} D_2(0,0)= \\begin{vmatrix} 4 \\space & -2\\space \\\\ -2 & 6 \\end{vmatrix} \\end{equation*}",color = PINK).scale(0.9) + + t_text = TextMobject("$D_2 = 20>0$ (Relative Maxima or Relative Minima)", color = YELLOW).scale(0.9).shift(1*DOWN) + tm_text = TextMobject("$D_1 = \\frac{\\partial^2 f}{\\partial x^2} =4 >0$ (Relative Minima)", color = YELLOW).scale(0.9).shift(2*DOWN) + + + self.play(ShowCreation(h_text)) + self.wait(1) + self.play(FadeOut(h_text)) + self.wait(1) + self.play(ShowCreation(e_text)) + self.wait(1) + self.play(ShowCreation(f_text)) + self.wait(1) + self.play(ShowCreation(c_text)) + self.wait(1) + self.play(ShowCreation(d_text)) + self.wait(1) + self.play(ShowCreation(t_text)) + self.wait(1) + self.play(ShowCreation(tm_text)) + self.wait(2) + self.play(FadeOut(e_text),FadeOut(f_text),FadeOut(c_text),FadeOut(d_text),FadeOut(t_text),FadeOut(tm_text)) + +class Minima(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + 2*u**2+3*v**2-2*v*u + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[BLUE_C,YELLOW_D,GREEN_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=10 * DEGREES,theta=90*DEGREES) + self.begin_ambient_camera_rotation(rate=0.2) + + f_text = TextMobject("$f(x,y) = 2x^2+3y^2-2yx$",color = PURPLE).shift(2*DOWN+3*RIGHT).scale(0.8) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.play(Write(f)) + self.wait(2) + + +class thirdScene(Scene): + def construct(self): + + + e_text = TextMobject("Case 2: Two negative eigenvalues", color = RED).scale(1).shift(3*UP+2*LEFT) + f_text = TextMobject("$f(x,y) = -x^2-4y^2$",color = BLUE).scale(0.8).next_to(e_text).shift(6*LEFT+DOWN) + c_text = TextMobject("Critical Point: $(0,0)$",color = BLUE).scale(0.8).next_to(f_text).shift(DOWN+3.8*LEFT) + d_text = TextMobject("\\begin{equation*} D_2(0,0)= \\begin{vmatrix} -2 \\space & 0\\space \\\\ 0 & -8 \\end{vmatrix} \\end{equation*}",color = TEAL).scale(0.9) + + t_text = TextMobject("$D_2 = 16>0$ (Relative Maxima or Relative Minima)" ).scale(0.9).shift(1*DOWN) + tm_text = TextMobject("$D_1 = \\frac{\\partial^2 f}{\\partial x^2} =-2 <0$ (Relative Maxima)").scale(0.9).shift(2*DOWN) + + + self.play(ShowCreation(e_text)) + self.wait(1) + self.play(ShowCreation(f_text)) + self.wait(1) + self.play(ShowCreation(c_text)) + self.wait(1) + self.play(ShowCreation(d_text)) + self.wait(1) + self.play(ShowCreation(t_text)) + self.wait(1) + self.play(ShowCreation(tm_text)) + self.wait(2) + self.play(FadeOut(e_text),FadeOut(f_text),FadeOut(c_text),FadeOut(d_text),FadeOut(t_text),FadeOut(tm_text)) + + +class Maxima(ThreeDScene): + def construct(self): + axes = ThreeDAxes() + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-4*v**2 + ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[BLUE_C,PURPLE_D,TEAL_E], + resolution=(20, 20)).scale(1) + + self.set_camera_orientation(phi=75 * DEGREES) + self.begin_ambient_camera_rotation(rate=0.4) + + f_text = TextMobject("$f(x,y) = -x^2-4y^2$",color = YELLOW).shift(2*DOWN+3*RIGHT).scale(0.8) + self.add_fixed_in_frame_mobjects(f_text) + self.add(axes) + self.play(Write(f)) + self.wait(1) + self.move_camera(phi=30*DEGREES,theta=45*DEGREES,run_time=5) + self.wait(2) -- cgit From e4de3f4275bf5684fc14873730bfb050b4cf7d17 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:55:58 +0530 Subject: Update and rename file1_TangentPlanes.py to file1_Tangent_Plane.py --- .../file1_TangentPlanes.py | 39 ---------------- .../file1_Tangent_Plane.py | 52 ++++++++++++++++++++++ 2 files changed, 52 insertions(+), 39 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py deleted file mode 100644 index 8e3a19e..0000000 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.py +++ /dev/null @@ -1,39 +0,0 @@ -from manimlib.imports import* - -class TangenttoSurface(ThreeDScene): - def construct(self): - axes = ThreeDAxes() - - #parabola: -x**2-y**2 - p = ParametricSurface( - lambda u, v: np.array([ - u, - v, - -u**2-v**2 - ]),v_min=-1,v_max=1,u_min=-1,u_max=1,checkerboard_colors=[BLUE_C,TEAL_D], - resolution=(20, 20)).scale(1).shift(1*RIGHT+2*UP) - self.set_camera_orientation(phi = 35 * DEGREES,theta = -40 * DEGREES ) - - r = Rectangle(side_length=2,side_breadth= 1, fill_color=PURPLE, fill_opacity=0.2).shift(ORIGIN-1+3*UP+2*RIGHT).scale(0.7) #---tangent plane along x axis - - r_text = TextMobject("Tangent Plane along $x$ axis",color = '#FFE4E1').scale(0.6).to_corner(UL) - r2_text = TextMobject("Tangent Plane along $y$ axis",color = '#FFE4E1').scale(0.6).to_corner(UL) - - a = Arrow(color = '#FFFFF0').shift(ORIGIN-1+3*UP+4*RIGHT).scale(0.5) - a2 = Arrow(color = '#FFFFF0').shift(ORIGIN+0.5+3*UP+RIGHT).scale(0.5) - a2.rotate(1.571) #----1.571 radian = 90 degrees - - self.add(axes) - self.play(Write(p)) - self.begin_ambient_camera_rotation(rate = 0.1) - self.add_fixed_in_frame_mobjects(r_text) - self.play(ShowCreation(r)) - self.play(ShowCreation(a)) - self.wait(1) - self.play(FadeOut(r),FadeOut(a),FadeOut(r_text)) - - r.rotate(1.571) #---tangent plane along y axis - self.play(ShowCreation(r)) - self.play(ShowCreation(a2)) - self.add_fixed_in_frame_mobjects(r2_text) - self.wait(2) diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py new file mode 100644 index 0000000..3632d7e --- /dev/null +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py @@ -0,0 +1,52 @@ +from manimlib.imports import* + +#---- tangent plane is parallel to the surface of the funtion at a point +class firstScene(ThreeDScene): + def construct(self): + + s1_text=TextMobject("Suppose, the point $(x,y)$ lies on the surface of the function.").scale(0.5).shift(2*UP) + s2_text=TextMobject("When zooming on that point, the surface would appear more and more like a plane.").scale(0.5).shift(1*UP) + s3_text=TextMobject("This plane is called the tangent plane.").scale(0.5) + + #---- graph of function f(x,y) = -x^2-y^2 + + f = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E]).shift([0,0,0]).scale(1) + + + d = Dot([0,0,0],color = '#800000') #---- critical point + + r = Rectangle(color = PURPLE,fill_opacity=0.2).shift([0.1,0,0]).scale(0.3) #---- tangent plane + + s = ParametricSurface( + lambda u, v: np.array([ + u, + v, + -u**2-v**2 + ]),v_min = -1, v_max = 1, u_min = -1, u_max = 1, checkerboard_colors = [YELLOW_B,YELLOW_C,YELLOW_D, YELLOW_E]).shift([0,0,0]).scale(3.5) + + d2 = Dot([0,0,2.5],color = '#800000') #---- changing position of critical point + + r2 = Rectangle(color = PURPLE,fill_opacity=0.5).shift([0.1,0,2.5]).scale(0.3) #---- changing position of tangent plane + + self.set_camera_orientation(phi = 50 * DEGREES, theta = 45 * DEGREES) + self.add_fixed_in_frame_mobjects(s1_text) + self.add_fixed_in_frame_mobjects(s2_text) + self.add_fixed_in_frame_mobjects(s3_text) + self.wait(2) + self.play(FadeOut(s1_text)) + self.play(FadeOut(s2_text)) + self.play(FadeOut(s3_text)) + self.wait(1) + self.play(Write(f)) + self.play(Write(d)) + self.play(Write(r)) + self.wait(2) + self.play(ReplacementTransform(f,s),ReplacementTransform(d,d2),ReplacementTransform(r,r2)) + self.wait(2) + + -- cgit From e59375a9f91c17376c690fd59f86cfe0490018d0 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:56:17 +0530 Subject: Update file1_Tangent_Plane.py --- .../Tangent-Plane-Approximations/file1_Tangent_Plane.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py index 3632d7e..4c17f90 100644 --- a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py +++ b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.py @@ -48,5 +48,3 @@ class firstScene(ThreeDScene): self.wait(2) self.play(ReplacementTransform(f,s),ReplacementTransform(d,d2),ReplacementTransform(r,r2)) self.wait(2) - - -- cgit From 6a369492d9bfceb37b27856c082d218f50dbcb87 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:56:37 +0530 Subject: Delete file1_TangentPlanes.mp4 --- .../file1_TangentPlanes.mp4 | Bin 1483459 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 deleted file mode 100644 index 6a3ba6d..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_TangentPlanes.mp4 and /dev/null differ -- cgit From 4d945dced9720f944215a39d10f78206334f2f61 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:57:12 +0530 Subject: Delete file2_Tangent_plane_approximation_visualization.mp4 --- ...file2_Tangent_plane_approximation_visualization.mp4 | Bin 336179 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 deleted file mode 100644 index bc3448b..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file2_Tangent_plane_approximation_visualization.mp4 and /dev/null differ -- cgit From dd56199fd1aa1e1dc74d7d05280093cc5f5e66b9 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:57:23 +0530 Subject: Delete file3_non_differentiable_function.mp4 --- .../file3_non_differentiable_function.mp4 | Bin 424364 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 deleted file mode 100644 index 7417a87..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file3_non_differentiable_function.mp4 and /dev/null differ -- cgit From e37b2e1ad48269d1fa32c402dbf85331b6490376 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:57:34 +0530 Subject: Delete file4_Tangent plane_at_critical_points.mp4 --- .../file4_Tangent plane_at_critical_points.mp4 | Bin 3101810 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 deleted file mode 100644 index 2c64f38..0000000 Binary files a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file4_Tangent plane_at_critical_points.mp4 and /dev/null differ -- cgit From ada683cd4827f2b996998a10ed5c967b7945d530 Mon Sep 17 00:00:00 2001 From: Vaishnavi Date: Wed, 24 Jun 2020 03:58:34 +0530 Subject: Add files via upload --- .../file1_Tangent_Plane.gif | Bin 0 -> 827096 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif (limited to 'FSF-2020') diff --git a/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif new file mode 100644 index 0000000..2b8bf5f Binary files /dev/null and b/FSF-2020/approximations-and-optimizations/Tangent-Plane-Approximations/file1_Tangent_Plane.gif differ -- cgit