﻿ Sample Problems > Usage > Accuracy > gaus1d

gaus1d

Navigation:  Sample Problems > Usage > Accuracy >

gaus1d   { 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

ngrid=10

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

coordinates

cartesian1

Variables

u

definitions

k = 1

w=0.25

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

s = -dxx(u0)

RMS_error = sqrt(integral((u-u0)^2)/sqrt(integral(u0^2)))

left=point(-1)

right=point(1)

equations

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(RMS_error, errlim) log

end