ehsanhaghighat / sciann

Deep learning for Engineers - Physics Informed Deep Learning
htttp://sciann.com
Other
318 stars 114 forks source link

How dose SciANN differentiate? #18

Closed MitsuMatsu closed 3 years ago

MitsuMatsu commented 3 years ago

Hi, Thank you for nice package. It's very useful. But I have a question. How dose SciANN model calculate differentiation the constraint equations?

In practical, it needs two values to calculate differentiation. Such as, du/dt = (u2-u1) / (t2-t1)

I guess differentiation of constraint equations are calculated with tf.gradients in this SciANN package. However, input and output of model are one-to-one correspondence. Thus we have only one u and one t. How does model calculate differentiation?

I'm beginner of coding. So sorry if I say besides the point.

ehsanhaghighat commented 3 years ago

It is done through Automatic Differentiation -- you can think about it as analytical differentiation. Therefore, there is no need to do a finite difference type differentiation as you have up there.

MitsuMatsu commented 3 years ago

Thank you!