Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jiaqi-knight opened this issue Apr 24, 2019 · 4 comments

Comments

@Jiaqi-knight
Copy link

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:
[1] top-level scope at In[84]:1

Then I search for solutions, referred in
"JuliaApproximation/ApproxFun.jl#590 (comment)"
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
Copy link
Owner

Try adding using LinearAlgebra

@Jiaqi-knight
Copy link
Author

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

@dlfivefifty
Copy link
Owner

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

@Jiaqi-knight
Copy link
Author

I got it!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants