deepxde
deepxde copied to clipboard
Need the maximum of the output in each time step as an Input
Hi
I wanted to know that whether there is a way to define the maximum value of an output in a spatial domain as input?
For example when my output is Temperature and I need it's max value over spatial domain at each timestep to implement in another equation which is coupled with the temperature equation.
Thanks
I don't have a good answer to this. Maybe you can update the max every certain iteration.
I don't have a good answer to this. Maybe you can update the max every certain iteration.
Many thanks for your time and reply.
One Idea that I had which I'm not sure is right was I define the points by anchors
in which for example 51
points for x
and 51
points for y
and 100 points for t
and x,y
points are for every elements of my time domain (51*51*100).
Since thetrain_x_all
is ordered by bc_points
and train_x
points then I define a new tensor in pde
by the locations of my points.
bc_point = y[:4*51*100,0:1]
ic_point = y( 4*51*100 : 4*51*100 + 2*51*51, 0:1)
domain_point = y[4*51*100 + 2*51*51:,0:1]
then I use tf.reduce_max
for every timestep I defined for example for the domain points it would be every 51*51
elements since my time changes every 51*51
times. then I assign them to a new tensor of the shape (batch_size,0:1).
This tensor contains the T_max
for every timestep in spatial domain. I've tried it but it seems it doesn't work.
the points are uniformly distributed by np.linspace(start,end,num)
Is there another way to define T_max
in each iteration? should I use a for loop?
Your idea sounds good. I think it should work. Not sure why. Maybe you can double check train_x_all
.
Using for loop might be very slow.