Hey guys, I've got a function which computes the propagation of uncertainty for a given function. It is called "fehler" and an example would be:
fehler[Sin[2*a], a]
which gives me
2 Sqrt[\[CapitalDelta]a^2 Cos[2 a]^2]
So basically the syntax is fehler[function, variable1, variable2,...]. The whole file is attached to the post, the credit goes to some random guy from my university, unluckily I could not figure out who made this function.
Now I'd like to make this function usable inside every notebook, because right now I always use it externally which is not really nice. So for example if i have a random notebook it should work like this:
(*random notebook*)
fehler= (*this is the code i need*)
a = 1; b=2; const=9;
fehler[a*const+b*2, a, b]
(*the output should like this*) Sqrt[const^2 \[CapitalDelta]a^2 + 4 \[CapitalDelta]b^2]
So that in every notebook I use i can simply use the "fehler"-function to calculate to propagation of uncertainty without having to use it globally. I tried to make this possible for a long time, but the main problem is that the existing fehler-function requires to clear all Variables with ClearAll["Global`*"]; before executing fehler. It is important that the output can be further used as a function, and not is simply a (numerical) result.
Do you guys have an idea how I can solve this problem? It would help me (and other students) a lot, if we could the function inside our notebooks and not externally.
Thanks you and best regards, Tobias
Attachments: