Thank you for the great contribution. PINNs have been an amazing tool in scientific computing and this enhancement makes it better. I replicated the code of burger's equation and made changes to model the 1D wave equation with a source term:
@tf.function
def f_model(x,t):
c = tf.constant(1, dtype = tf.float32)
Amp = tf.constant(1, dtype = tf.float32)
frequency = tf.constant(1, dtype = tf.float32)
sigma = tf.constant(0.5, dtype = tf.float32)
source_x_coord = tf.constant(0, dtype = tf.float32)
Gaussian_impulse = Amp * tf.exp(-(1/(sigma**2))*(x-source_x_coord)**2)
S = Gaussian_impulse * tf.sin( 1 * tf.constant(math.pi) * frequency * t )
u = u_model(tf.concat([x,t], 1))
u_x = tf.gradients(u,x)
u_xx = tf.gradients(u_x, x)
u_t = tf.gradients(u,t)
u_tt = tf.gradients(u_t,t)
f_u = u_tt + (c**2) * u_xx - S
return f_u
However, the output is not quite what I expected.

I tried a couple of network architectures and learning rates, but the result seems to be the same. What would you suggest to get more accurate results?
Also, I saw how you placed the boundary conditions but I'm not sure how to specify the initial condition? Is it extracted from the exact solution?
Thanks again! Awaiting your feedback.
Thank you for the great contribution. PINNs have been an amazing tool in scientific computing and this enhancement makes it better. I replicated the code of burger's equation and made changes to model the 1D wave equation with a source term:
However, the output is not quite what I expected.
I tried a couple of network architectures and learning rates, but the result seems to be the same. What would you suggest to get more accurate results?
Also, I saw how you placed the boundary conditions but I'm not sure how to specify the initial condition? Is it extracted from the exact solution?
Thanks again! Awaiting your feedback.