Skip to main content
7 events
when toggle format what by license comment
Dec 24, 2015 at 16:38 comment added Michael E2 I don't know exactly. You can look at Derivative[{1, 0}][nfun1][List[0.1`, 0.3`]] // Trace and Derivative[1, 0][nfun][0.1`, 0.3`] // Trace and see that it just doesn't seem to try to do the numeric derivative when the argument to Derivative is a List (the case Derivative[{1, 0}]). I don't see a reason why it shouldn't work. Report it to Wolfram support and see what they say. -- BTW, the numeric derivative is both slower and less accurate, so in a way you're lucky it didn't work. :)
Dec 24, 2015 at 15:15 vote accept Fábio
Dec 24, 2015 at 15:14 comment added Fábio Thank you, Michael, it worked like a charm. It REALLY helped me. Anyway, any clue of why nfun1[arg : {_?NumericQ ..}] doesn't work, while nfun[x1_?NumericQ, x2_?NumericQ] does?
Dec 24, 2015 at 14:39 comment added Michael E2 @Fábio Thanks for letting me know. I wasn't getting that before, but in a new session I do. I must have changed something. The update seems to work well, and actually it's just as fast as the cumbersome NEval solution, which I removed. (Let me know if you want it back and I'll put it in.)
Dec 24, 2015 at 14:36 history edited Michael E2 CC BY-SA 3.0
Corrected code
Dec 24, 2015 at 13:03 comment added Fábio Thank you very much, Michael... I dont know what I am doing wrong, but when I try your code, it gives me the message: "The integrand Cos[x1^x/x2] has evaluated to non-numerical values for \ all sampling points in the region with boundaries {{2,3}}."
Dec 24, 2015 at 6:48 history answered Michael E2 CC BY-SA 3.0