Numerical and analytical derivation results are very different

francisco_goya

New member
Joined
Nov 16, 2016
Messages
1
Hello,

I have a question about numerical differentiation using central difference formula. I performed the derivation both in analytical and numerical way. And I found different results. I am sure that my analytical derivation is correct (MATLAB agrees with me) However, I do not understand why the numerical differentiation gives an irrelevant result. Here is my function:

f(x,y)= x^4 + y^4 + sin(x)*cos(x)

attachment.php


My analytical derivation:

fyy = 12y2 - sin(x)*cos(y)
fyy (1,1) = 11.5454

My Numerical derivation bu using Central Difference formula:
attachment.php

And I found 100 !

I don't understand where I did mistake :(

Thank you for your help.
 

Attachments

  • derivative.JPG
    derivative.JPG
    8.8 KB · Views: 11
  • derivative2.JPG
    derivative2.JPG
    10.8 KB · Views: 6
  • derivative2.JPG
    derivative2.JPG
    11.2 KB · Views: 11
Top