A little program for calculating taper modification with resistors

Started by Fancy Lime, September 19, 2017, 05:09:34 AM

Previous topic - Next topic

Fancy Lime

Hey everyone,

I wrote a little piece of Fortran90 code to calculate and visualize what influence different parallel resistor arrangements have on the taper of a linear potentiometer used as a variable resistor. Maybe that is useful for others as well.

Here's the link:

http://www.aronnelson.com/DIYFiles/up/varres.txt

Cheers,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

Plexi

To you, buffered bypass sucks tone.
To me, it sucks my balls.

imJonWain

and some people say C is old, I thought this was a necro-bump at first  ;D
  • SUPPORTER
TFRelectronics

EBK

It's kinda funny how I almost dismissed this when I read "Fortran90" (purely from a personal lack of knowledge standpoint), but then I read the code comments and realized how simple it would be to get it running.   :icon_smile:

I'll definitely check it out sometime when I have my laptop handy (notebook, I mean -- I guess they stopped using the word "laptop" once these things started burning testicles years ago (man, I'm getting old..)...  :icon_eek: :icon_razz:)
  • SUPPORTER
Technical difficulties.  Please stand by.

Fancy Lime

It's funny how Fortran has a reputation for being obsolete, especially with surprisingly many programmers and computer scientists. The fact of the matter is that the vast majority of scientific numerical high performance computing is still done on Fortran. Weather forecasts, climate simulations, theoretical subatomic particle physics: all done with Fortran on supercomputers. Much of the underlying code is still in Fortran77, so you can write your program on punch cards. Punch cards! And if I were the betting type, my money would be on Fortran for that purpose for at least the next 30 Years. It is simply by far the most efficient way to crunch numbers. Its basically just a programmable calculator. The most powerful calculator invented yet, but still just a calculator. So numerical jobs are easier to program and MUCH quicker to execute than with anything else. Funny enough, the stuff that cannot be not done well with Fortran, like artificial intelligence, is mostly done in LISP (or its direct descendants), a language that is only one year younger than Fortran.

I could have written this program in a modern language like Python or Matlab or even Java. Python would be quite similar, only a factor of 10 or so slower, so no problem for this purpose, but you would need to install additional libraries (which brings with it compatibility issues). In Matlab, it would constantly crash and be a factor of 1000 slower and you would have to buy a very expensive license to run it. In Java the code would be twice as long and execution much, much slower and you would have to wait for updates when starting the runtime environment. So Fortran is simply the obvious choice for this. But apparently, the only measure of usefulness of a programing language today, at least in the eye of the computer science undergrad, is "how easily can I program a smartphone app with this?".

And the "obsolete technology" thing is by no means limited to programming even though it is quite prominent there:
https://xkcd.com/1891/

[rant] I don't know about you guys but I would LOVE to be able to buy a new car that does not beep when I put it in reverse and beep when I haven't closed the seatbelt yet and beep when I open the door with the key in the ignition and beep when there are heavy groceries on the passengers seat and I didn't put a seatbelt on those. I view technology as a tool and I bloody hate when the stupid technology thinks it's smarter than me and can push me around. Anyone seen Terminator? Good thing about old programming languages like old cars is: They may not always be as comfortable but at least they let you do what you want without talking back. [/rant]

Cheers,
Andy

p.s.: I started learning Fortran about a year ago. For fun, because I though "this looks useful". So it's not like I studied this back in the 60s or 70s (when I wasn't born yet) and am simply too lazy to adjust to newer, better languages.
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

creepingnet

Honestly, so-called "Obsolete" tech is not obsolete unless it's actually useless.  I have an old 486 based PC I still use for a lot of things, running DOS, WFWG, and Win95.  Actually, my favorite Tablature program is for DOS.  I might have to try this out, might help with the sweep on the Fuzz Pedal I designed that I'm currently testing.

Hatredman

The problem with a not so widespread language is that You may reach fewer users.

.

Kirk Hammet invented the Burst Box.