A page to coordinate the implementation of a unified model for basic calculus that is "insanely easy" (for non-mathematicians) to use.
Design Constraints
This is a (very incomplete) list of goals that are very important for us to reach, in order for SAGE to be adopted as a mainstream computer algebra system (i.e., a system that is ideal for experts and non-experts alike).
Must be "insanely easy", à la David_Joyner
Must require no knowledge of mathematics beyond calculus in order to use (this likely means matrices and polynomials with implicit base rings).
- Must require no knowledge of any system outside SAGE. Learning SAGE should require learning one system; not learning several.
- Must interoperate with other parts of SAGE.
Calculus-related functions (such as, say, differentiate()) should return SAGE objects on which we can do more operations (for example, isolate a variable).
- The system should cooperate in a natural way with other components of SAGE (this may mean providing an interface hiding algebraic notions for modules).
- Transparency between
- Intuitive handling of ODEs
Currently in SAGE
How SAGE currently does calculus
Coming soon.
Bugs in the current implementation
These are thanks to Joel Mohler:
Exhibit 1
sage: x.parent() Univariate Polynomial Ring in x over Rational Field sage: P,y=ZZ['y'].objgen() sage: f=cos(x)*sin(y) sage: f(1) (cos(1)*sin(1))
This should have resulted in a syntax error.
Exhibit 2
What in the world is "sin(x)(1)"?
sage: P,(x,y)=ZZ['x,y'].objgens() sage: f=sin(x) sage: f(1) sin(x)(1) sage: float(f(1)) # disaster strikes (recursive traceback)
From William: Yes, this is wrong. But it's just a NotImplementedError, i.e., the __call__ method of sin doesn't do anything with multivariate polynomials, so it just forms the formal evaluation sin(x), which it doesn't know what to do with.
Exhibit 3
This should result in a type error:
sage: P,x=IntegerModRing(17)['x'].objgen() sage: f=sin(x) sage: f(18) sin(1)
Exhibit 4
Constants should have coercion to a function of 1 variable.
sage: show(plot(1)) --------------------------------------------------------------------------- <type 'exceptions.ValueError'> Traceback (most recent call last)
Exhibit 5
If we use a polynomial ring generator as generic function variables, exponentiation must work like so:
sage: P,x=ZZ['x'].objgen() sage: x^x --------------------------------------------------------------------------- <type 'exceptions.TypeError'> Traceback (most recent call last)
Exhibit 6
This worked in 1.4, but does not in 1.5.alpha6. I suspect it's only a simple regression due to the new arithmetic properties.
sage: pi*x --------------------------------------------------------------------------- <type 'exceptions.NotImplementedError'> Traceback (most recent call last)
Design Ideas
Some ideas to consider and debate.
One idea, which I think students will accept, is to have a command like load_calculus() or something. (The Maple analog is with(student).) This could, for example,
- load predefined variables,
- spit out a very brief screen of explanations (perhaps a list of some available commands, an explanation of how to get help in the notebook or on the command-line, ...),
- load a bunch of teacher-defined *.sage files in examples/calculus,
- other stuff?
Of course, one extremely cool thing about the SAGE notebook is that you can actually design a special calculus control bar if you want. Maybe if you click on help, one of the items says calculus, and there is a link there to explain how to put a calculus help control bar where the normal control bar is .