# Thread: Defining a function in mathematica

1. ## Defining a function in mathematica

Hey guys, is there a possibility to write this function (in the pic) in mathematica?
And if so, how can I do it?

Thanks a lot.
Assaf.

2. The function could be defined thusly,

Code:
Needs["PhysicalConstants"];

Z[W_,d_]:=If[W/d<=1,
(60 Pi/Sqrt[VacuumPermittivity]) Log[(8d/W)+(W/4d)],
(120 Pi)/(Sqrt[VacuumPermittivity] (W/d+1.393+0.667 Log[W/d+1.444]))];`
This will use the units of Ampere*Second/Meter*Volt for epsilon.