1
00:00:00,210 --> 00:00:06,630
So we've just learned that four large time starting values are a numerical solution will be different

2
00:00:06,630 --> 00:00:12,750
to the analytical solution, which is just due to the fact that the analytical solution was only true

3
00:00:12,750 --> 00:00:13,980
for an approximation.

4
00:00:14,700 --> 00:00:17,670
And so in the following, we will not consider it anymore.

5
00:00:17,700 --> 00:00:20,220
We will only trust our numerical results.

6
00:00:21,540 --> 00:00:28,440
So now we really have a tool that helps us to understand the harmonic oscillator and the pendulum.

7
00:00:29,280 --> 00:00:32,940
So let's go ahead and make the problem even more difficult by adding more terms.

8
00:00:35,340 --> 00:00:44,610
So we have defined already our differential equation here so that we copy this, maybe all of this and

9
00:00:46,320 --> 00:00:48,210
paste it here and now.

10
00:00:48,210 --> 00:00:57,420
This time I will consider a damping, and the damping is the zero point five.

11
00:00:59,730 --> 00:01:02,160
And what else will I consider?

12
00:01:02,160 --> 00:01:08,280
I will stick to the larger starting value, but I will go back to the a shorter calculation time.

13
00:01:08,910 --> 00:01:09,630
Maybe we can.

14
00:01:09,630 --> 00:01:10,860
We can change this later on.

15
00:01:11,760 --> 00:01:16,050
And though, as I said, we will not compare this to the analytical solutions that we will just use

16
00:01:16,050 --> 00:01:16,680
this one here.

17
00:01:19,110 --> 00:01:27,630
So if I run this and I get the solution for the pendulum and you see what happens, we start from a

18
00:01:27,630 --> 00:01:33,180
large value theta zero of two and then we can now change this also to plot.

19
00:01:34,230 --> 00:01:38,970
And then it oscillates it has still the characteristic time periods.

20
00:01:39,390 --> 00:01:40,050
What do you see?

21
00:01:40,110 --> 00:01:42,200
The amplitude decreases?

22
00:01:42,210 --> 00:01:47,100
This is, of course, due to the damping term that we have now turned on and like in reality, when

23
00:01:47,100 --> 00:01:53,640
you leave a pendulum swinging, then it will just decrease its amplitude over time.

24
00:01:54,880 --> 00:01:55,200
It's not.

25
00:01:55,200 --> 00:02:00,300
What we can also do is checking what happens if we decrease the step size.

26
00:02:01,530 --> 00:02:04,120
But I think there wasn't that much of a difference.

27
00:02:04,140 --> 00:02:11,610
So it seems like the solution is already converged and this is the behavior now with the damping term.

28
00:02:13,320 --> 00:02:17,760
Likewise, we can also modulate a driven oscillator.

29
00:02:18,690 --> 00:02:28,170
So this is when we change the differential equation once more, so we can do this by adding here another

30
00:02:28,170 --> 00:02:28,590
term.

31
00:02:29,430 --> 00:02:44,190
So we're right on minus these times and peer sine of omega tones T and D will be essentially the amplitude

32
00:02:44,550 --> 00:02:49,080
of the gravity of the external force that we have just added.

33
00:02:50,970 --> 00:02:53,010
So let's just test 1.0.

34
00:02:53,010 --> 00:02:53,790
I don't know if it's good.

35
00:02:58,420 --> 00:03:05,740
And also, we have to define Omega, which is the frequency of the external force.

36
00:03:06,490 --> 00:03:16,030
So what we have done is we have added here a term to the to this differential equation where the right

37
00:03:16,030 --> 00:03:19,900
side of the differential equation has a linear term and theta, which is the damping.

38
00:03:20,260 --> 00:03:27,370
It has a linear or sine theentire term, which is the gravitational force, and then it has a term which

39
00:03:27,370 --> 00:03:29,190
doesn't depend on theta at all.

40
00:03:29,200 --> 00:03:33,000
It is a term that only depends on the time explicit explicitly.

41
00:03:33,730 --> 00:03:40,780
So this is now a sign omega t term, which corresponds to when you, for example, apply some kind of

42
00:03:40,780 --> 00:03:47,860
motor to your or some, some some some engine that moves the pendulum while you leave it swinging.

43
00:03:48,850 --> 00:03:54,730
And so it's really interesting to analyze what happens when this swinging frequency omega is different

44
00:03:54,730 --> 00:03:57,460
compared to the eigen frequency of the pendulum.

45
00:03:59,350 --> 00:04:02,110
So let me just show you one more thing.

46
00:04:02,380 --> 00:04:09,610
Let me go back to the theory part where we have introduced our second order differential equation here.

47
00:04:10,600 --> 00:04:15,970
We have written down that the second order differential equation in general is characterized by a second

48
00:04:15,970 --> 00:04:22,360
or the derivative that is given by a function that depends on first derivative, the function itself.

49
00:04:22,720 --> 00:04:23,920
And then also T.

50
00:04:24,580 --> 00:04:29,230
And now we really have all three of these terms in our differential equation.

51
00:04:30,520 --> 00:04:35,800
So this is like the most general case that we can solve with our new method.

52
00:04:36,910 --> 00:04:38,470
So let's see how it works.

53
00:04:39,660 --> 00:04:42,040
Um, let me think about the parameters.

54
00:04:42,040 --> 00:04:43,990
Maybe at first, let me go back here a bit.

55
00:04:46,550 --> 00:04:48,350
And let's solve this.

56
00:04:49,100 --> 00:04:54,680
So you see the EU, yeah, the time depends of SETA is no very confusing.

57
00:04:55,100 --> 00:05:01,130
In the very beginning, it looks maybe a bit similar to the UN driven and just -- oscillator.

58
00:05:01,790 --> 00:05:08,180
But then since we have this new fourth term here, it will not decay to zero, but it will still be

59
00:05:08,180 --> 00:05:08,930
oscillating.

60
00:05:09,140 --> 00:05:13,550
And it also seems like there is no clear trend after 20 seconds.

61
00:05:14,180 --> 00:05:16,280
So let's go to a larger time.

62
00:05:17,270 --> 00:05:24,200
Let's increase the step size, for example, and then we see that this solution looks like this.

63
00:05:24,770 --> 00:05:34,790
We could also just increase this one here and then it will look like this, and we can even play a bit

64
00:05:34,790 --> 00:05:35,900
with the parameters.

65
00:05:36,050 --> 00:05:40,250
For example, we could change the sign of the the amplitude.

66
00:05:40,850 --> 00:05:49,250
Then it will look more like this, or if we increase the step size again, we get such a result.

67
00:05:49,970 --> 00:05:56,930
But since in the following, I want to compare this result with this two step Euler method with more

68
00:05:56,930 --> 00:05:58,370
of the optimized methods.

69
00:05:58,640 --> 00:06:06,890
I want to have a more difficult time dependence of data and more change in this curve.

70
00:06:07,490 --> 00:06:13,130
So what I will do, I will I will decrease the damping parameter.

71
00:06:14,210 --> 00:06:21,410
So let me try this so that we have less damping and then hopefully we get more difficult looking time

72
00:06:21,410 --> 00:06:21,980
dependence.

73
00:06:22,580 --> 00:06:23,930
Yeah, I think this is pretty good.

74
00:06:24,050 --> 00:06:27,710
We have now some strange oscillations in the beginning.

75
00:06:27,710 --> 00:06:34,010
This is because the oscillator the pendulum doesn't lose enough energy in the beginning because of damping

76
00:06:34,010 --> 00:06:40,370
is now much smaller and the external force is quite large and it really is in conflict.

77
00:06:40,370 --> 00:06:47,690
It's fighting with the oscillation of the pendulum itself, so it tries to get the pendulum out of its

78
00:06:47,690 --> 00:06:56,840
eigen frequency and eigen pendulum motion, and it tries to dictate the external force with the period

79
00:06:56,870 --> 00:06:58,430
omega onto the pendulum.

80
00:06:59,210 --> 00:07:05,600
And this really takes about one minute until the process is finished and hear the motion looks very

81
00:07:05,600 --> 00:07:06,170
chaotic.

82
00:07:06,170 --> 00:07:13,670
And then after this time, it finally moves in the periodic manner, according to this omega T sine

83
00:07:13,670 --> 00:07:14,180
function.

