martinResearch / MatlabAutoDiff

A matlab implementation of forward automatic differentiation with operator overloading and sparse jacobians
BSD 3-Clause "New" or "Revised" License
39 stars 12 forks source link

Add back a missing function that is used when computing power derivative #6

Closed james34602 closed 3 years ago

james34602 commented 3 years ago

Tested on power function

martinResearch commented 3 years ago

thank you for the contribution. I would like this code to be covered by new tests in https://github.com/martinResearch/MatlabAutoDiff/blob/master/src/AutoDiff_tests.m with different input sizes to test all code paths in valXder if possible before merging. at which revision did you find the code of the valXder function ?

james34602 commented 3 years ago

I find a valXder function from https://github.com/sehyoun/MATLABAutoDiff.

The story is pretty simple, I try to optimize my z-plane model that uses a bunch of nonlinear function, pow() is needed, however, I get error for a missing function, this lead me search the internet for valXder function.

A little moment later, I finally found it, which file appear in sehyoun's repo, I immediately get his valXder into your library, bingo, it works, at least it work for my z-plane model that have multiple matrices and nonlinear function

martinResearch commented 3 years ago

good to hear it works. :) I'll try to find a solution with less additional code and add tests for it in the next few weeks

martinResearch commented 3 years ago

@james34602 I commited changes directly in master to solve your problem , could you confirm that solves your problem ?

james34602 commented 3 years ago

@james34602 I commited changes directly in master to solve your problem , could you confirm that solves your problem ?

Yes, it does, thanks.

martinResearch commented 3 years ago

closing the PR as it has been solved in the main branch