Physics informed Neural Network
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Ben
am 26 Jul. 2023
@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.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!