Calculating optimum tube load line tool?

It's occurred to me that it's possible to create a software tool that will take the LTSpice model for a tube and create an optimal linear input-output load line. It could also be used to take a given load line and find the most linear load line position.

Has anyone done this already?

I was thinking of creating an Octave (free Matlab clone) tool todo this in a Jupyter notebook. Only issue is Octave is single threaded so may be a little slow.

If I create a 4096x4096 grid I can approximate quickly - not many people need more than 0.1V or 0.1mA accuracy so that would perfectly well.

Then it's a case of finding the flattest linear line across for the given Vg.
 
That's really good. Very useful and you can see from the THD value (assuming this is even order) the distortion.

Three feature requests 🙂
1. 6AS7/6080
2. adding Class B load line (AB)
3. Push Pull mirroring

Not one for wanting the world 😀