Navigation:  Sample Problems > usage > accuracy >

gaus1d

Print this Topic Previous pageReturn to chapter overviewNext page

{ GAUS1D.PDE

 

 This test solves a 1D heat equation with a Gaussian solution and compares

 actual deviations from the exact solution with the error estimates made by

 FlexPDE.

 The problem runs a set of ERRLIM levels and plots the history of the comparison.

 

}

title '1D Accuracy Test - Gaussian'

select

   stages = 5

   ngrid=10

   errlim = staged(1e-2, 1e-3, 1e-4, 1e-5, 1e-6)

   autostage=off

coordinates

   cartesian1

Variables

   u

definitions

   k = 1

   w=0.25

   u0 = exp(-x^2/w^2)

   s = -dxx(u0)

   left=point(-1)

   right=point(1)

equations

   U: div(K*grad(u)) +s = 0

boundaries

  Region 1

      start left point value(u)=u0

      line to right point value(u)=u0

monitors

  elevation(u) from left to right

plots

  elevation(u,u0) from left to right report(errlim)

  elevation(u-u0) from left to right as "absolute error" report(errlim)

  elevation(-div(grad(u)),s) from left to right report(errlim)

histories

  history(sqrt(integral((u-u0)^2))/sqrt(integral(u0^2)), errlim) log

end

 


Page url: index.html?usage_accuracy_gaus1d.html