After we decide both the initial conditions and boundary condition.
What we will need to do is we will start defining the PDE.
We we're trying to solve and basically the network and here with X deep, deep is these things are quite
simple.
So or like concise regarding the code.
So def we write a function that will take x and.
Will take six and.
Why are you in our case and then d or just make it you.
Due.
With time we're going to be d d e dot grad dot jacobian.
And then we take the value of you.
We take the value of X and I equals.
Zero.
To J equals one.
So this is going to be.
Our first giacobbe.
The second Giacobbe is due over.
This is the second derivative and we do the same thing.
Well, what?
What will change is the method in which we are going to.
Dig the great.
The Great Forum is a Haitian.
And we it will take you or it will give us.
Well, the value of you giving, of course, X.
And.
We have I equals zero and.
J equals or J equals zero.
Because the function this one.
Well, we can call it X, we can call it other thing like for example, um, comp space.
Is comp space.
So it's I think it's better to call it like this.
So comp space.
This is the you, the one we want to calculate and comp space is basically it will has it will have
two components.
The first component is a space which is a which is J equals zero means this space of zero and the J
equals one is the time.
So this is basically how it works.
So comp is both X and Y, and then we have I equals one, which is only you already we have only we
are calculating only one thing, which is you and has one component which is because it's scalar.
Or like nuts, it's most likely it will be like a victor, but it has one value only.
So we put it on the zero and we don't have one.
So basically this is what the what what it means.
And I think comp is better to write it this way.
And the last thing is we need to put return.
Well d d u over d y.
We just put this way.
So basically, um, we have du over dt we move all of this to here and we create something called residual.
The residual has to equal zero.
So.
We created this residual by Du over DT minus.
K multiplied.
Do you?
Over the x and we shift enter.
The next thing we need to do is basically defining the data.
So data.
This is going to define the actual data that we are going to train.
As we said, we have two types of losses.
The the losses related to the the initial condition, boundary condition and the losses related with
the whole domain that has to follow the physics.
So we need to define in this case the data that we are going to use for training, both for the well,
the initial condition, boundary condition, as well as the whole domain.
So data equals dot data.
A dot time PD.
And we open parentheses.
I don't I wanted to to put it here, but anyway, Jim.
Time.
And.
We pass this one basically, and we need to pass boundary condition and initial condition, which we
define here, boundary condition and way up.
We define here the initial condition and.
We also number.
Of domain equals 2540.
And.
Number.
These are the points that's going to be in the domain.
Number of.
Bone dry.
Equals 80.
I'm just checking the spelling.
Boundary.
Yeah.
And.
Number of initial.
Points 160.
Number of test equals to 2540.
And that's it.
So this is the data.
That's it.
It's very quite like, lovely.
And sorry.
2000.
Yeah, it's.
It's.
It's just a warning.
We're using this.
But point.
Yeah, I think no problem.
Yeah I think no problem.
So net equals we now define the network.
And also defining the network is quite simple.
Dot in.
In.
Forward neural network.
And we open it.
We have input of two, which is X and T.
Plus we have 20.
A neuron with three layers with 20 neurons.
And the last thing is going to be plus one.
Again, this is the syntax of this of this library.
We have to follow it.
And then we have.
Ten each.
And this activation function, of course.
And there is a glorot.
Route.
Normal.
It's.
Yeah, this one.
So this one is related with initializing the network itself and or in this method it will initialize
the network weights with a mean equals zero.
So they will change randomly, but the mean of them it will be always zero.
If we want to see the grid, our grid, let's.
Let's see it.
Let's plot dot figure.
And let's see our grid, how it looks.
And of course, there is no grid in pens.
It's a mistress.
The method.
Size equals.
Ten and eight.
PLT dot scatter.
Data dot.
Train.
Takes all.
This is, of course, syntax.
We want to have the points.
We will print them.
This is the X.
And this is the equivalent values of Y.
And of course.
Dot x.
Label.
It's X.
Why?
And we destroy the thing.
PLT dot show.
So what does it mean?
Of course it's random points.
It's just separated.
But the number of points in the in the whole boundaries is 80.
This 80 and this is 80.
And this we have a 160 points and all this in the domain.
We have 2540 points.
So basically, this is how our computation domain will look like.
This is we we will have a kind of fine here, lots of points here.
We will have.
And I'm not so bad points in the boundary we have we will have a lot of boundary in the middle.
And this is how we will calculate this is our actual domain.
And.
Yeah.
So that's it.
That's it.
And let's next time we will solve this like the heat equation.
And of course later we will see the results.