How can I implement this equation?

It would be nice, if you can provide minimal working example, so people can reproduce your problem locally and give you reasonable answer.

Please read this topic Please read: make it easier to help you