How to define a differential or integral operator?
Hi,
What's the difference between the method notation and function notation? Is it possible to define a differential or integral operators using either of these notations or else?
I'm a beginner, just tried a bit codes like the followings
reset
var('x,a,b')
L='diff(x,a,b)'
f=function('f',x)
f.L
or
reset
var('x,a,b,c')
L={c:'diff(x,a,b)'} # defining a dicionary
f=function('f',x)
f.L[c]
and codes like these but none worked. Any idea?
The syntax for creating a dictionary is: L = { c : 'diff(x,a,b)' }. You might want to brush up on some basic python and programming concepts. I would suggest http://en.wikibooks.org/wiki/Non-Programmer's_Tutorial_for_Python
thank you, I corrected the code in the main post, but anyway the code still doesn't work. I always give back the error that 'sage.symbolic.expression.Expression' object has no attribute 'L'. From this respect, both the codes in the main question act a same way! How can I introduce what is contained in L instead of L itself? I am a beginner programmer but if my mind could help there was something using which one could define a phrase in C language before main() whose usage was preprocessed as what it had contained, not a mere name. I thought dictionary would be something like that but the code above shows how wrong I was ...