Physics informed Neural Network
9 次查看(过去 30 天)
显示 更早的评论
Dear Matlab Community Members,
i would like to apply my equations in physics-informed neural networks, so i reffered solving Burger's equation L-BFGS method. For example i would like to apply 1D equation
d^u/dt=(d^2g/dx^2)-d^4u/dx^4; where g=2*u*(1-u)*(1-2*u) with
u(x=0,t)=0, u(x=1,t)=0 and
u(t=0,x)=sin(4*pi*x/L)
Model Loss Function
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
U = model(parameters,X,T);
G=2.*U.*(1-U).*(1-2.*U);
gradientsG = dlgradient(sum(G,"all"),{X,T},EnableHigherDerivatives=true);
Gx = gradientsG{1};
Gxx = dlgradient(sum(Gx,"all"),X,EnableHigherDerivatives=true);
gradientsU = dlgradient(sum(U,"all"),{X,T},EnableHigherDerivatives=true);
Ux = gradientsU{1};
Ut = gradientsU{2};
Uxx = dlgradient(sum(Ux,"all"),X,EnableHigherDerivatives=true);
Uxxx = dlgradient(sum(Uxx,"all"),X,EnableHigherDerivatives=true);
Uxxxx = dlgradient(sum(Uxxx,"all"),X,EnableHigherDerivatives=true);
f=Ut-Gxx+2.*Uxxxx;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
i have made the above changes in the code...but i didnt get any expected results....can u please help me with this...?
4 个评论
Ben
2023-7-26
@Sankarganesh P I notice that your ODE is
but the model loss function uses 2.*Uxxxx. That seems like an issue at first glance.
Otherwise your model loss function looks as expected to me. Do you get good training losses?
Of course a small training loss only means the network is "nearly" solving the ODE at the training points - for complex ODEs/PDEs this may only give weak approximations to the true solution in general.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!