You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I am dealing with a problem where an Initial Condition cannot be defined by a function of spatial co-ordinates x. But I have values of initial conditions at discretized points as an array. I used PointSetBC in order to solve the initial condition from the given array. However, after a few hundred iterations of optimization, the model is not able to minimize the loss for initial condition further more. A snippet of the code implementation is below:
x = np.linspace(x_start, x_end, total_points)
X, T_initial = np.meshgrid(x,0) #creating a mesh of discretized points and initial time 0
IC_input = np.hstack((X.flatten()[:,None], T_initial.flatten()[:,None]))
#Define the PDEs
def pde(a, b):
#a is a 2D input array where a[:,0:1] represents spatial domain in x direction and a[:,1:2] represents the temporal domain
#a is the input of the neural net
#b is a the output array where y[:,0:1] represents water depth , y[:,1:2] represents velocity, y[:,2:3] represents bed elevation (topography)
#b is the output of the neural net
x, t = a[:, 0:1], a[:, 1:2]
h, u, z = b[:, 0:1], b[:, 1:2], b[:, 2:3]
...defining rest of the equations...
ic_h = dde.icbc.PointSetBC(IC_input, h_initial, component=0) #initial water depth as an array
ic_u = dde.icbc.PointSetBC(IC_input, u_initial, component=1) #initial water velocity as an array
ic_z = dde.icbc.PointSetBC(IC_input, z_initial, component=2) #initial topography as an array
data = dde.data.TimePDE(geomtime, pde, [ic_h, ic_u, ic_z, bc_l_h, bc_r_h, bc_l_u], num_domain=20000, num_boundary=1000, anchors = input)
I have tried multiple network width and depth, weights, activation functions. But nothing seems to work. Please let me know if there is any solution to this or if my implementation is not correct.
Thank you in advance :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am dealing with a problem where an Initial Condition cannot be defined by a function of spatial co-ordinates x. But I have values of initial conditions at discretized points as an array. I used PointSetBC in order to solve the initial condition from the given array. However, after a few hundred iterations of optimization, the model is not able to minimize the loss for initial condition further more. A snippet of the code implementation is below:
I have tried multiple network width and depth, weights, activation functions. But nothing seems to work. Please let me know if there is any solution to this or if my implementation is not correct.
Thank you in advance :)
Beta Was this translation helpful? Give feedback.
All reactions