I constantly ask myself where the hell are the geophysics tutorials? Coming from a programming background I find the extreme lack of geophysics tutorials concerning. If you want to solve the most trivial issues in computing the internet has it covered. When you look for trivial geophysics solutions they are nowhere to be found. As geoscientists, we live in a small industry and I expect less free online resources but come on, this is ridiculous.

As a start I include the following tutorial on 1D MT forward modelling. Hopefully it is easy to follow.

...and oh yeah.... the source code is downloadable and is licensed under WTFPL. If you don't know what WTFPL is, ill give you a hint "do what the _ you want to". So in other words, distribute, copy, modify, sell, integrate, delete, make erroneous.... I really don't care what you do with it.
Introduction
The magnetotelluric (MT) method is an electromagnetic geophysical exploration technique. The technique utilizes natural sources of electromagnetic energy for very deep soundings of the earth for crustal, global, geothermal, mineral and hydrocarbon exploration.

We understand that magnetotelluric and telluric fields are large-scale low frequency electromagnetic fields generated by natural source electromagnetic source. The terms "magnetotelluric" and "telluric" are used to describe the fields and currents respectively. These MT sources generally occur outside of the earth including solar emission resulting from the diurnal variation of the earth's magnetic field (i.e., Arora's).

The point of this article is not to go in depth into MT interpretation or background but the formulation of the 1D solution. The derivation and background has been taken from several sources including Niwas et al. (2005) and Pedersen and Hermance (1986)

For a uniform geo-electrical earth the measured surface impedance is related [...]