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

rewrite diff #523

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

rewrite diff #523

wants to merge 1 commit into from

Conversation

latot
Copy link
Contributor

@latot latot commented Sep 1, 2016

Well, this time its only rewrite of diff to python, why? time of execution:
with the actual diff

>> f=(x-1)^10;
>> tic;diff(f);toc;
Elapsed time is 0.0878189 seconds.

with python:

>> f=(x-1)^10;
>> tic;diff(f);toc;
Elapsed time is 0.0254591 seconds.

i have some questions, reading this: https://es.mathworks.com/help/symbolic/diff.html
and this tests:

%! assert (isequal (diff(f,sym(2)), g))
%! assert (isequal (diff(f,sym(2),x), g))
...
%! assert (isequal (diff(f,1), g))
%! assert (isequal (diff(f,1,x), g))

if i read right diff(f,sym(2),x) should diff f in 2 grades in x, and then derive it again in x? because in the example diff(f,sym(2),x) its the same as diff(f,sym(2))...
i never used SMT so i don't know if that its right, but its doesn't feel it match with the doc.

Well Cya.

@latot latot changed the title rewrite diff2 rewrite diff Sep 2, 2016
@latot
Copy link
Contributor Author

latot commented Sep 4, 2016

as a note, i don't change that tests yet, for that reason travis fails.

@cbm755
Copy link
Collaborator

cbm755 commented Sep 14, 2016

Re: diff(f, 2, x): I dimly recall SMT used to do it this way, and at least in R2014b it is still mentioned in help diff. I haven't checked if its supported in R2016---at least it doesn't seem to be mentioned in the link you sent. Maybe we could remove that "feature": you could file a new issue for that.

@cbm755
Copy link
Collaborator

cbm755 commented Sep 14, 2016

I read release notes, I don't see it being removed from SMT... so maybe we leave it too for now.

@cbm755
Copy link
Collaborator

cbm755 commented Mar 1, 2017

I think the bit about diff(f, 2, x) is resolved.

Re: speed: I don't think we should do this sort of thing unless we write a re-useable "symvar" call in Python. Its non trivial and there are also subtly like #550.

Shall I close this?

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

Successfully merging this pull request may close these issues.

2 participants