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

D[R*Cos[w*t], {t,2}] #184

Closed
sn6uv opened this issue Jan 22, 2014 · 2 comments
Closed

D[R*Cos[w*t], {t,2}] #184

sn6uv opened this issue Jan 22, 2014 · 2 comments
Labels

Comments

@sn6uv
Copy link
Member

sn6uv commented Jan 22, 2014

Terms coming from the sympy conversion are apearing in the following expression

>> D[R*Cos[w*t], {t,2}]
 =  -R w ^ 2 Cos[t$1 w]

expected:

-(R*w^2*Cos[t*w])

Reported here.

@GitAnt
Copy link
Contributor

GitAnt commented Mar 7, 2014

This problem traces back to the rule found at the lines 119-120 in mathics/builtin/calculus.py. In general it comes from a name clash between a dummy variable in a module and an argument of the same module. For example, it can be reproduced by defining:

deri[expr_,x_,n_]:=Module[{t}, Nest[Function[{tmp}, D[tmp, x]], expr, n]]

and then trying to calculate

deri[Cos[t],t,1]

while

deri[Cos[a],a,1]

works just fine. Any idea on how to fix this?

@bnjones
Copy link
Member

bnjones commented Nov 20, 2014

It looks like this is fixed now that #202 has been merged. Thanks @GitAnt!

@bnjones bnjones closed this as completed Nov 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants