Won the previous two lectures, we have solved the differential equation for the time decay of radioactive
substances, and you have seen that is a declining exponential function.
And now we are going to use our newly defined function called Euler O the E to solve a other differential
equation.
So this differential equation is given by the change of Y.
So why that is equal to minus the constant times y so pretty similar to the exponential decay times
T, which is something new here.
So basically, I called this time amplified decay, but it's a bit abstract and it's just generic.
So not really a real physical phenomenon because here to change of the amount of the substance is given
not only by the substance itself, but also by that time.
So I don't know.
Maybe you could imagine that for some reason, the rate of the decay would increase with time because
some of some temperature changes or something.
But yeah, this is just a quick example to show you that our method works also for other differential
equations.
And the important thing or the important distance difference here is that we now do not only have a
function y dot that depends on Y, but also it depends on T, which was something that we did not have
previously.
But in general, you see here f depends not only on Y but also on T, which is why I decided to present
to you this example where we have y in T.
So when you look at this function and don't know the solution yet, then it's much more difficult to
get a solution.
So after some thinking, you may guess that the solution is such a Gaussian function, so exponential
function of minus T squared time so constant.
But maybe it is quite difficult to solve this analytically.
So in any case, you could just take our code now and calculate the function numerically.
So we, of course, we don't need to redefine the code because it is written in a general manner.
We just need to change the function.
So I will basically copy this cell here and just adapt to our new function.
So instead of having to write him minus y, I write minus eight times y times T and A is equal to some
number.
And here we should take a pretty small number, maybe the zero point zero one.
So I take your small value because when we increase T, then the rate will increase.
So it's good to start with a smaller eight to see some interesting physics here.
So then we basically just have to provide the T zero, the Y zero, the N Max and the H, and then we
can just go ahead and solve the all an ordinary differential equation with the same line as we had before.
So I run this and now it's plotted.
I will also copy this code here.
And I think this one, we don't even have to change.
I can just run it and look at the solution.
So here we cannot really see that much because we have still our analytical results present.
So yeah, first of all, I should maybe change the analytical results.
So I right here y zero times.
So I have to write this one year terms and it's P minus T square times eight over two.
And now it looks pretty, pretty decent.
So it's still decreasing and it's only at zero point nine eight yet.
So maybe I should increase the total simulation time and I could do this, for example, by decreasing
or so by increasing the value of H.
And then I could also increase here the value of and max.
And then you see, that's first of all, our numerical solution represents the analytical solution quite
well, even though we have increased the step size.
And I think this is due to the fact that the function here a y t is pretty small since we have two small
constant here.
So you see there is not really a unique or an appropriate best choice for H, which is able to solve
all the problems equally well.
So you always have to think about if your function changes fastly or not.
For example, here it was changing quite briefly, going from one to 0.5 and under a second.
So when we when we.
Used equal to zero point one before the solution was not so good and we had to decrease to zero point
zero one.
However, here after one second, we are still very close to one, so the function doesn't change too
briefly, so we get a good result.
Also, with a larger value of h equal to zero point one.
So we see we have this nice agreement and also we see this trend of this Gaussian function.
And I think when you consider this differential equation and put it in the physical context, it makes
sense.
So the rate at which the Y value decreases is given by the product of white itself and the time T.
So if we only consider the influence of T, then the decrease would just get faster and faster with
increasing time.
And this is what we see in the beginning.
So here the value of Y doesn't change much and all the influence comes basically from T, so it decreases
and it decreases faster and faster.
But then at some point, the value of Y will be quite small already, so this will then compensate the
effect of the increasing T.
And so overall, the decay will slow down and it will still then be very close to zero and it will never
go below zero.
So this means we have now tested our function for a new differential equation, which was a bit more
difficult because it does not only include Y but also T, but in the way we have programmed this function,
it still worked.
And it's a nice thing that we have such a function available now and we can now solve basically any
ordinary differential equation of First Order.