# Unitful + ForwardDiff

**URL:** <https://discourse.julialang.org/t/unitful-forwarddiff/41422>\
**Category:** General Usage\
**Tags:** forwarddiff, unitful\
**Created:** [June 15, 2020, 6:33am UTC](https://discourse.julialang.org/t/unitful-forwarddiff/41422 "2020-06-15T06:33:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Post date:** [June 15, 2020, 6:33am UTC](https://discourse.julialang.org/t/unitful-forwarddiff/41422/1 "2020-06-15T06:33:46Z")

</div>

ForwardDiff.jl and Unitful.jl do not work together out of the box. Did anybody try to make them work together?

---

<div class="post-metadata">

**Author:** ![EmilioAlvizo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/emilioalvizo/32/23406_2.png) [@EmilioAlvizo](https://discourse.julialang.org/u/EmilioAlvizo)\
**Post date:** [March 29, 2021, 12:22am UTC](https://discourse.julialang.org/t/unitful-forwarddiff/41422/2 "2021-03-29T00:22:06Z")

</div>

I have tried but I can’t make it work, it would be nice if these two packages could be used at the same time

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [April 2, 2021, 12:18pm UTC](https://discourse.julialang.org/t/unitful-forwarddiff/41422/3 "2021-04-02T12:18:48Z")

</div>

An MWE would be useful, but generally I would just add a wrapper that adds units, calls the relevant function, and then removes units, and AD that.

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …
