The obvious answer is via Sage and SymPy, which will do differentiation and integration symbolically to some degree. http://www.scipy-lectures.org/advanced/sympy.html#differentiation However even plain old core Python helps in that students get a sense of functions as top-level citizens. I'm not saying Python is alone in providing this. If the C language could be written: function func(function f1, function f2):{ } with type function both eaten and returned, then we could use C for this kind of thing also. http://mathforum.org/kb/message.jspa?messageID=10168568 (more on this general topic) The repl below (you may skip modal window) shows my latest slimmed down version of Compose, something I introduce to the O'Reilly course as well. https://repl.it/HxMo/2 Function type objects don't ordinarily multiply but what if we want to write h = f * g instead of h(x) = f(g(x)). For one thing, why mention x at this point (the argument object) as we're simply defining a function, not calling it with an input right? The Compose class is just the ticket, swallowing and wrapping a function with a __mul__ API. Now * is your compose operator. Or use __matmul__ for @ symbol. Note then, the use of Compose as a class decorator to the same end. Feel free to recycle this animal in your own lesson plans. MIT license or whatever. Kirby PS: one of the Pycon keynotes was about the affordability of nuke energy, with the claim / calculation that it's less risky to workers than coal. I didn't have time to go up to the podium after and listen in on the conversation. We should have started a BOF. Simulating / modeling risk is something I'm into through CERM Academy. We could start a thread on Facebook.
My students and I solved last year's AP Calculus exam with python last year for fun! Have a look, http://shadowfaxrant.blogspot.com/2016/06/how-to-part-ii-pythonic-calculus.h... HTH, AJG Sent from BlueMail On Jun 10, 2017, 3:20 PM, at 3:20 PM, kirby urner <kirby.urner@gmail.com> wrote:
The obvious answer is via Sage and SymPy, which will do differentiation and integration symbolically to some degree.
http://www.scipy-lectures.org/advanced/sympy.html#differentiation
However even plain old core Python helps in that students get a sense of functions as top-level citizens. I'm not saying Python is alone in providing this.
If the C language could be written:
function func(function f1, function f2):{ }
with type function both eaten and returned, then we could use C for this kind of thing also.
http://mathforum.org/kb/message.jspa?messageID=10168568 (more on this general topic)
The repl below (you may skip modal window) shows my latest slimmed down version of Compose, something I introduce to the O'Reilly course as well.
Function type objects don't ordinarily multiply but what if we want to write h = f * g instead of h(x) = f(g(x)).
For one thing, why mention x at this point (the argument object) as we're simply defining a function, not calling it with an input right?
The Compose class is just the ticket, swallowing and wrapping a function with a __mul__ API. Now * is your compose operator. Or use __matmul__ for @ symbol.
Note then, the use of Compose as a class decorator to the same end.
Feel free to recycle this animal in your own lesson plans. MIT license or whatever.
Kirby
PS: one of the Pycon keynotes was about the affordability of nuke energy, with the claim / calculation that it's less risky to workers than coal. I didn't have time to go up to the podium after and listen in on the conversation. We should have started a BOF. Simulating / modeling risk is something I'm into through CERM Academy. We could start a thread on Facebook.
------------------------------------------------------------------------
_______________________________________________ Edu-sig mailing list Edu-sig@python.org https://mail.python.org/mailman/listinfo/edu-sig
FYI, here's my YouTube playlist including final projects for AP Calculus and AP Computer Science from 2012-2016. Screencasts for 2017 will be forthcoming soon! https://www.youtube.com/playlist?list=PLL956Pn2cKSjxPBTcG2XYzNOB5tQ1txgx This year we'll be using SMC (Sage Math Cloud) https://cloud.sagemath.com, recently renamed https://cocalc.com. CoCalc includes everything you need to code in the cloud. I think it's on GCP (Google Compute Platform) as opposed to https://repl.it, https://cs50.io and https://c9.io which are on AWS (Amazon Web Services). On Cocalc you can make 3 different types of documents: SAGE WorkSheet, Jupyter NoteBook and LaTEX Documents. Also, here's my 2016 playlist for the AP Calculus exam comparing the use of TI84C, TI92, TI nSpire CX CAS, SageCell and python! https://www.youtube.com/playlist?list=PLL956Pn2cKSje0HeHkR38C8BVWbTeOFUy HTH, A. Jorge Garcia Applied Math, Physics & CS http://shadowfaxrant.blogspot.com http://www.youtube.com/calcpage2009 2013-2017 NYS Secondary Math http://PAEMST.org Nominee
(SRY, TYPOS FIXED) FYI, here's my YouTube playlist including final projects for AP Calculus and AP Computer Science from 2012-2016. Screencasts for 2017 will be forthcoming soon! https://www.youtube.com/playlist?list=PLL956Pn2cKSjxPBTcG2XYzNOB5tQ1txgx This year we'll be using SMC (Sage Math Cloud) https://cloud.sagemath.com, recently renamed https://cocalc.com. CoCalc includes everything you need to code in the cloud. I think it's on GCP (Google Compute Platform) as opposed to https://repl.it, https://cs50.io and https://c9.io which are on AWS (Amazon Web Services). On Cocalc you can make 3 different types of documents: SAGE WorkSheet, Jupyter NoteBook and LaTEX Documents. Also, here's my 2016 playlist for the AP Calculus exam comparing the use of TI84C, TI92, TI nSpire CX CAS, SageCell and python! https://www.youtube.com/playlist?list=PLL956Pn2cKSje0HeHkR38C8BVWbTeOFUy HTH, A. Jorge Garcia Applied Math, Physics & CS http://shadowfaxrant.blogspot.com ; http://www.youtube.com/calcpage2009 ; 2013-2017 NYS Secondary Math http://PAEMST.org Nominee
participants (3)
-
A Jorge Garcia
-
A. Jorge Garcia
-
kirby urner