It sounds like the built-in pot model you are using in your circuit simulator only lets you set the pot position once on the schematic, and then the position is constant during the simulation.
The Potentiometer Model at eCircuit
shows how to build a model that acts like a linear pot that turns during the simulation.
That's exactly what you need, right?
That model has a spice file that uses a piecewise linear source (PWL) that controls the position of the pot vs. time.
* WIPER POSITION: 0V=CCW, 1V=CW
VPOS 20 0 PWL(0MS 0V 1000MS 1V)
You could either use the "voltage" of VPOS as the X coordinate on your graph, representing pot position;
or perhaps it's simpler to plot X as time and pick a PWL that linearly turns the pot proportional to time.
Then you run the simulation, and plot output voltage vs. time.
Perhaps pipe in a square-wave at some audio frequency, and plot the output voltage vs time; then when viewing several seconds of simulation, you'll see a solid mass (the oscillations are too fast too see, more than 1 cycle per pixel width) that shows the envelope of the output waveform, and you can use either the top or the bottom as an estimate of the gain.
To simulate a non-linear pot, you could (a) edit the PWL line to turn the pot at a non-linear rate, but plot X as time, something like:
* nonlinear turn
VPOS 20 0 EXP(TIME)
VPOS 20 0 LOG10(TIME)
Or you could (b) build a model of a non-linear pot, and keep the PWL turning that pot at a linear rate, using something like
EPOS 21 0 TABLE{V(20,0)} = (0 0.7) (1 7.0) (2 700) (3 7k) (4 70k)
Both (a) and (b) give the same resistance-vs-time characteristics, right?
Hopefully you can find some function or polynomial or a set of points to feed into PWL or TABLE that gives a close-enough approximation to the actual resistance of your real-world nonlinear pot.
I'm assuming you already have software tools that let you draw a circuit schematic and simulate it, that also accept SPICE models.
If not, I'm pretty sure there is something suitable in the
List of free electronics circuit simulators.
EDIT:
Or at the Chiphacker list of freeware SPICE simulators.
To plot AC signal gain as a function of pot position,
first run a transient (time) simulation.
Then plot the output (the voltage on the wire going to the speaker) vs. time.
(Or you could plot it vs. the "turn signal", V(20) in the above code).
You might have a pull-down menu option to do this; the old-school method is something like:
* WARNING: untested code
* ANALYSIS
.TRAN 5US 1000MS
*
* VIEW RESULTS
.PRINT TRAN V(1) V(2) V(20) V(77)
*
.PROBE
.END
No resistor at all. Once again, questions should stick to what you want to know or accomplish, not how you think it should be done.
Your basic question is apparently how to power this "speaker" (clearly more than just a speaker) from the power source you supply rather than the two AAA batteries it is designed for. You have available some sort of lithium battery and a regulated 5 V supply generated from that somehow.
First, you need to find out whether the batteries in your speaker unit are ground-referenced. If they are, you can proceed. If not, then this is beyond your level at this time and you either need to find a different speaker unit or a altogether different approach. Run the speaker normally with a fairly strong signal into it. With a voltmeter, measure between the negative terminal of the combined AAA battery pack and the outer ring of the 3.5 mm plug. There should be 0 V, both when measuring AC and DC. Of course exactly 0 will never happen, so in this case anything over about 10 mV means the two points aren't really connected. If they are connected, then the battery is ground-referenced and you can proceed.
If the lithium battery voltage is around 3 V, then use it directly. If this battery is a single cell, this might just work. Basically, if the lithium battery voltage is below the regulated 5 V output, try connecting the battery to the + side of where the AAA pair would go, and ground to the - side.
If the lithium battery voltage is higher than 5 V, then it would be best to to use that directly to make some sort of regulated 3 V to drive the speaker unit with. A linear 3.3 V regulator is a quick and simple answer, but might get warm when the speaker is producing loud sound. Try it and see. If that is not acceptable or the lithium battery voltage is substantially higher than 5 V, then use a switching regulator instead. There are many switching regulator chips out there that can do this with a few external parts. You can even use one that has a fixed 3.3 V output.
Added:
You now say the lithium battery puts out 7.4 V and the link to the speaker unit rates it as 1/2 W, but it's not clear if that is input power or power to the speaker. Just to see where you're at, .5W / 3V = 170 mA. We can't really tell from the sparse information in the link, but lets say top current draw of the speaker unit is 200 mA at 3 V. With just a linear regulator, the regulator would dissipate (7.4V - 3V) * 200mA = 880 mW. That's rather wasteful and something like a TO-220 package will get hot but probably OK with a modest heat sink. You can try a 7803 regulator.
The other thing to try is to power the speaker unit from your existing 5 V source. I don't know what a "BEC" is, so can't tell if this is a linear or switching regulator and how much current it can support. The speaker will draw more current at 5 V than at 3 V. If a lot more, it may get damaged. After all, it's meant to run from 3 V. 5 V may be OK, but you're a test pilot then and you can't complain if it vanishes into a greasy puff of black smoke.
Best Answer
You can use a transistor to do this. Although less common that the other types, a JFET works much like a voltage controlled variable resistance. You'd have to apply an analog voltage to the gate to get a specific resistance. You'd have to be careful about the range of this voltage. The Drain and Source would act as the effective two terminal resistor. Even a mosfet has a linear resistive region so this is not your only option. There are many other options as well which I'm sure will be mentioned.