[General boards] [Winter 2021 courses] [Fall 2020 courses] [Summer 2020 courses] [Older or newer terms]

A1 Q3: What is g(x)?


Hello, this may be a simple question (haven’t seen DE in a while) or misunderstanding.

Using the test u(x) = x^2, without loss of generality the question states that g(x) and gamma(x) are given, and I can see that on the boundaries x=a and x=b gamma is defined as gamma = u = x^2, which for a=0 and b=2, gamma(0)=0 and gamma(2)=4.

How is g(x) found given u(x) here? Are we simply deriving g(x) ourselves using u(x) and the combinations of p, q, and r and then using the derived g(x) in our finite difference method? I remember in lectures you mentioning that we shouldn’t be calculating derivatives ourselves because it’s expensive, but I’m assuming for the sake of testing our finite difference method with the actual solutions (u=x^2, u=x^3, u=exp(x)) and comparing error values we’re allowed to do this?


Yes, for the sake of testing the FD method, you can hard-code the derivatives for each u. Then from these and thee p, q, r functions
you can make g.
I personally never use symbolic differentiation, as I tend to run lots of these tests, and anything symbolic is way more inefficient than numerical hard-coded.