dlfivefifty / M3M6MethodsOfMathematicalPhysics

Lecture notes for M3M6 Methods of Mathematical Physics
MIT License
38 stars 11 forks source link

"S₀ = I : Chebyshev() → Ultraspherical(1)" :UndefVarError: I not defined #4

Open Jiaqi-knight opened 5 years ago

Jiaqi-knight commented 5 years ago

In lecture16, here are several codes: S₀ = I : Chebyshev() → Ultraspherical(1) f = Fun(exp, Chebyshev()) g = S₀*f g(4) - exp(4)

I found the error when I run it: UndefVarError: I not defined

Stacktrace:

Then I search for solutions, referred in "https://github.com/JuliaApproximation/ApproxFun.jl/issues/590#issuecomment-408527643" it can change to code "Conversion(Chebyshev(), Ultraspherical(1))" instead, and it works.

However, the final result such like "g(3) - exp(3)" is equal to -20.085536923187668, not approach to zero.

dlfivefifty commented 5 years ago

Try adding using LinearAlgebra

Jiaqi-knight commented 5 years ago

yes, it works, but the example seems not good?

dlfivefifty commented 5 years ago

Because you can only evaluate a function inside its domain of definition, in this case the default -1 ..1

Jiaqi-knight commented 5 years ago

I got it!!!