modify tutorials for plotter compatibility

This commit is contained in:
Dario Coscia
2023-10-31 12:03:04 +01:00
committed by Nicola Demo
parent 5336f36f08
commit d556c592e0
36 changed files with 290 additions and 260 deletions

View File

@@ -131,15 +131,15 @@ plotter = Plotter()
# plotting at fixed time t = 0.0
print('Plotting at t=0')
plotter.plot(trainer, fixed_variables={'t': 0.0})
plotter.plot(pinn, fixed_variables={'t': 0.0})
# plotting at fixed time t = 0.5
print('Plotting at t=0.5')
plotter.plot(trainer, fixed_variables={'t': 0.5})
plotter.plot(pinn, fixed_variables={'t': 0.5})
# plotting at fixed time t = 1.
print('Plotting at t=1')
plotter.plot(trainer, fixed_variables={'t': 1.0})
plotter.plot(pinn, fixed_variables={'t': 1.0})
# The results are not so great, and we can clearly see that as time progress the solution get worse.... Can we do better?
@@ -196,15 +196,15 @@ plotter = Plotter()
# plotting at fixed time t = 0.0
print('Plotting at t=0')
plotter.plot(trainer, fixed_variables={'t': 0.0})
plotter.plot(pinn, fixed_variables={'t': 0.0})
# plotting at fixed time t = 0.5
print('Plotting at t=0.5')
plotter.plot(trainer, fixed_variables={'t': 0.5})
plotter.plot(pinn, fixed_variables={'t': 0.5})
# plotting at fixed time t = 1.
print('Plotting at t=1')
plotter.plot(trainer, fixed_variables={'t': 1.0})
plotter.plot(pinn, fixed_variables={'t': 1.0})
# We can see now that the results are way better! This is due to the fact that previously the network was not learning correctly the initial conditon, leading to a poor solution when the time evolved. By imposing the initial condition the network is able to correctly solve the problem.