There's already a beautifully accurate analog simulator (open source, even!) known as
SPICE, but I understand a desire to build a simulation yourself
I would start with a basic electronics textbook, with a programmatic mindset - translate its concepts into many small prototype functions that you can connect together as you go. As generalizations are realized into modern understanding of electromagnetism, rework old functions to fit the new information. If something behaves differently from what you expect, realize that you're absolutely right in thinking there's more to circuit functionality than what you already know, but also realize you're working from the bottom up on an incredibly complicated problem and everything you've done already might be buggy. Work on one thing at a time until it matches as best you can tell what your source says in all your tests, and you'll get there eventually. Good luck!
(and if you're really itching to reinvent SPICE, which I say go for it, take a look at what it does and why, copy when you feel the need, but don't be afraid to apply your own insights into the process - you may just come up with something awesome that improves speed or accuracy for certain tasks)
For the second, I have a bit more useful information - in a reductionist sense (which most signal simulation uses, and why there's still lots of room for improvement), magnetic tape distortion is all about the AC bias effect cancelling (or failing to cancel) regions of zero magnetic strength (the bits of sound on magnetic tape are actually discrete points laid down by the recording head), plus the azimuth error (alignment of the play head with the surface of the tape), plus the tape speed limiting higher frequencies (source:
http://artsites.ucsc.edu/ems/Music/tech_background/TE-19/teces_19.html). These can all be reduced to modifications to a waveform - a digital emulation, but digital can be very, very good if you're willing to go in-depth. Speaking as a musician, I and many others would love you forever if you made a good, free VST plugin, or even just a .wav file processor, simulating magnetic tape like this. All the other ones I know of are licensed or analog. If you wanted to emulate old cassettes whose binder has started deteriorating ('sticky-shed') it's probably a matter of slowing the tape slightly in a slight drag-pull pattern (two long superimposed forward-sloped sine waves, one much longer than the other in the same octave, is my completely ass-pulled guess) to emulate the warbling it produces
http://www.youtube.com/watch?v=Yw8XWPTmX3o - this guy bitches about it like crazy, but I use esoteric effects like that all the time out of pure self-indulgent eccentricity *butterflies!*
But I also understand the desire to go with a more bottom-up approach. Actually, I'm not aware of any publically available simulation that does this, so you might be edging in on some professional's guarded territory
Magnetic tape is still used for backup by Google! You could be the guy that sparks people to improve it further using new materials.
I would start with the tape itself - how much magnetic flux it can store per unit of measurement (I would stick with real ones for all of them, that way you can tweak it to closely match reality and I can tweak them to match my madness
), how quickly it moves through the deck, and for shits and giggles, how long the spool is combined with how much drag the wheel that levels it out produces on the tape speed towards the beginning of the tape, when resistance is strongest. The recording head size (specifically its gap) combined with the tape speed is very important for the frequency limit - it determines the highest frequency your tape can record without modification after the fact. I don't know the specific equations for this, but it probably involves some higher maths - make a fudge that produces something fairly close to actual audio, and come back, because then you'll have a baseline for the next step. After that is the read head - I wouldn't worry about the eraser, other than to apply its erasing frequency to the whole of the tape. For that you'd need a proportionally higher sample-rate, like 176400hz, which is ridiculous by any sane person's standards but still available.
The read operation seems like a fairly straightforward conversion - magnetic incidence producing periodic electrical impulses. It could be further improved by the simulation of azimuth - that
is a matter of waveform interference, not only of amplitude but frequency as well, as the higher frequencies blend together into larger magnetic features on the tape. Two spots should combine into an entirely different waveform. For this, I would suggest you look at the combination of two square waves (one offset by a different
phase) and two much lower-amplitude sine waves of the same frequencies and phase in your favorite audio editor - Audacity is nice for this kind of experiment. Their peaks and troughs as their frequencies increase/decrease, together or seperately, might maybe closely represent the transformation you'd have to apply on the amplitude of each discrete point as azimuth error increases, possibly with very bad error resulting in a blip of an incorrectly detected signal. This is beyond my math knowledge
The AC bias effect cancelling out areas of zero gain is what baffles me the most. I don't honestly know how you'd emulate it in software. It's a matter of what levels the play head is capable of reading - but everything else should play normally. Maybe a weird filter that extends out
zero-crossing points after the recording process as the gain decreases would be your best bet?
Good luck! And sorry for wikipedia =P It's there to provide reference to what the hell I'm talking about for concepts that
I had to look up - if you need me to explain anything further, just ask. Keep in mind that I'm not a professional either - most of this is coming from a fairly loose understanding of DSP and digital audio tooled to produce the batshit noise I enjoy.