summaryrefslogtreecommitdiff
path: root/FSF-2020/calculus/series-and-transformations/Laplace Transformations/file2_differentialEqSimplification.py
blob: 33e9173b4b515460a67a19919bcdf6ef80cd9eed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from manimlib.imports import *
import pylatex

class scene(Scene):
    def construct(self):
        normalSq=Square(side_length=2,fill_color=BLUE,fill_opacity=0.6)
        normalSqText=TextMobject("$\mathscr{L}$")
        inputText=TextMobject("$f($","$y'(t)$","$)$")
        outputText=TextMobject("$F($","$s$","$)$")
        
        inputText.scale(0.7)
        outputText.scale(0.7)
        inputText.shift(2.5*LEFT)
        outputText.shift(1.7*RIGHT)
        normalSq.scale(1.2)

        inputText.set_color_by_tex_to_color_map({"$y'(t)$":RED})
        outputText.set_color_by_tex_to_color_map({"$s$":RED})

        self.play(ShowCreation(normalSq))
        self.play(FadeIn(normalSqText))
        self.add(inputText)
        self.wait(0.5)
        self.play(ApplyMethod(inputText.shift,0.7*RIGHT))
        self.play(FadeOut(inputText),FadeIn(outputText))
        self.play(ApplyMethod(outputText.shift,RIGHT))
        self.wait(1)

        group1=VGroup(outputText,normalSq,normalSqText)
        self.play(ApplyMethod(group1.scale,0.6))
        self.play(ApplyMethod(group1.shift,4.7*LEFT))
        self.wait(0.6)

        inverseSq=Square(side_length=3,fill_color=GREEN,fill_opacity=0.6)
        inverseSqText=TextMobject("$\mathscr{L}^{ -1 }$")
        outText=TextMobject("$f($","$y(t)$","$)$")
        inverseSqText.scale(0.7)
        outText.scale(0.7)
        outText.set_color_by_tex_to_color_map({"$y(t)$":RED})
        self.play(ShowCreation(inverseSq))
        self.play(FadeIn(inverseSqText))
        self.wait(0.5)
        outText.shift(2*RIGHT)
        self.play(ApplyMethod(outputText.shift,RIGHT))
        self.play(FadeOut(outputText),FadeIn(outText))
        self.play(ApplyMethod(outText.shift,2*RIGHT))
        self.wait(1)

        updatedOutputText=TextMobject("$F($","$s$","$)$")
        updatedOutputText.shift(2.5*LEFT)
        updatedInputText=TextMobject("$f($","$y'(t)$","$)$")
        updatedInputText.shift(6*LEFT)
        updatedInputText.scale(0.7)
        updatedOutputText.scale(0.7)
        updatedOutputText.set_color_by_tex_to_color_map({"$s$":RED})
        updatedInputText.set_color_by_tex_to_color_map({"$y'(t)$":RED})

        self.play(FadeIn(updatedInputText),FadeIn(updatedOutputText))
        self.wait(0.5)

        deText=TextMobject("Differential Equation")
        deinterTexta=TextMobject("Transformed D.E")
        deinterTextb=TextMobject("(Easy to simplify)!")
        deOutText=TextMobject("Solution of D.E")
        deText.set_color(RED)
        deinterTexta.set_color(RED)
        deOutText.set_color(RED)
        deinterTextb.set_color(PURPLE_C)
        deText.scale(0.35)
        deinterTexta.scale(0.35)
        deinterTextb.scale(0.35)
        deOutText.scale(0.35)
        deText.shift(6*LEFT+0.5*DOWN)
        deinterTexta.shift(2.6*LEFT+0.5*DOWN)
        deinterTextb.shift(2.6*LEFT+0.8*DOWN)
        deOutText.shift(4*RIGHT+0.5*DOWN)
        self.play(Write(deText),Write(deinterTexta),Write(deinterTextb),Write(deOutText))
        self.wait(2)