Updated

Local gasoline prices are swinging up and down ever more drastically, a result of a national fuel system that is operating with a shrinking margin for error.

Jumps of 20 cents per gallon or more in a single day are becoming more common, for example, according to an AP analysis of daily and weekly price changes at 120,000 U.S. gasoline stations tracked by GasBuddy.com. Sixty-three times this year at least one U.S. metro area has seen such a change. Like the 24-cent increase Decatur, Ill. drivers saw on Jan. 26, or the 24-cent increase in Superior, Wis. on April 30, and the 28-cent increase in Henderson, Ky. on Sept. 19.

Not since 2008 have there been so many 20-cent changes. Last year those happened 58 times. In 2011 they happened just 21 times, and in 2010 just 7 times.

"There's more and more feast or famine," says Tom Kloza, chief oil analyst at the Oil Price Information Service and GasBuddy.com.

The problem, analysts say, is a fuel system increasingly vulnerable to short-term shocks. That's because refiners try to keep stocks of gasoline low to save money, just as other manufacturers aim to operate on a "just-in-time" inventory schedule. The nation has about 26 days' worth of gasoline demand in storage, compared with 30 to 40 days' worth during much of the 1980's and 1990's, according to the Energy Department. Also, there are 143 operating refineries, about half the total from 1980, so, if one has a problem, supplies quickly drop.

That price whiplash has a cost. Spikes in gasoline prices are more damaging to the economy than a slow rise in prices because they undermine consumer confidence, economists say. Drivers may be pleasantly surprised when prices slide lower, like they have recently -- the national average is at $3.28, its lowest level of the year. But they don't know when the price might bounce back up, and increases are almost always sharper than decreases.  That makes it harder to budget for the daily commute, or know whether dinner out or a new appliance will be affordable.

These dramatic local price swings are happening despite relatively stable oil prices and a national average gasoline price that has hovered around $3.50 per gallon for three years. In 2008, the last time local prices were this volatile, oil spiked to $145 a barrel in July, then plunged below $40 in late December as the global financial crisis sent energy markets reeling. The national average gasoline price ranged from $1.62 to $4.11 a gallon.

Nowhere is it more frustrating to buy gas than in Kokomo, Ind., a flat, unassuming blue collar city surrounded by farmland 45 miles north of Indianapolis that regularly sees 10-cent or 20-cent price changes in a single day. On average, the price changes 5 cents there every day and 16 cents every week, the highest in the nation, according to GasBuddy.com.

Jim Brooks, who works at a Chrysler transmission plant in town, does his best to fill up elsewhere. "If I don't have to buy gas in Kokomo, I don't," he said recently at Manjas Marathon station in Kokomo during a lunch break. He bought a soda and some chips, but not gasoline.

Gas station owners set their prices based on how much it cost to buy the last shipment of wholesale gasoline, how much the next shipment will cost, and what competitors are doing. Stations typically make very little on gasoline, because they set the price as low as possible to attract people into their more profitable convenience stores.

The price they pay for wholesale gasoline is determined by deals between refiners and distributors that are usually based on benchmarks set on exchanges, such as the New York Mercantile Exchange.

When supplies are quick to rise or fall, it means more of what frustrates drivers: Gasoline prices that seem to jump around a few cents every time they fill up, for no rhyme or reason. This year 57 U.S. metro areas have averaged price changes of at least a dime over a week. Last year just 38 cities did, and in 2011 it was just 29 cities.

Volatility is most pronounced in the four neighboring states of Illinois, Indiana, Ohio and Kentucky. Of the biggest 50 one-day swings in gasoline prices over the past three years, 41 were in those four states. Michigan is also plagued by especially high volatility. Flint, Michigan is second only to Kokomo in average daily price changes this year.

Analysts say a major upgrade underway at BP's enormous Whiting Refinery in Northwest Indiana that processes 413,000 barrels of oil per day and serves much of the region is partly to blame. Construction has kept output lower, especially during the first half of 2013.

When output at a local refinery falls, fuel terminals must be filled with gasoline from refineries further away. That raises shipping costs, and it lowers supplies throughout the region.

California was a trouble spot in 2012. Prices spiked there last fall to a record $4.67 per gallon after an Exxon refinery in Southern California briefly lost power at a time when a Chevron refinery in Richmond, Calif. was operating at a lower rate following a fire.

Amy Myers Jaffe, an energy policy expert at the University of California, Davis, suggests that refiners should be required by regulators to keep a minimum level of refined fuel in inventory, as is done in Europe, to help protect against sharp price spikes.

That might help people like Mike Barnett, who spends about $250 a day on fuel for his small business in Kokomo installing underground lines for telecom companies. He puts just a quarter or half a tank of gas in his vans and trucks when the price gets high and then waits for a better deal.

"You just can't come and get gas like you used to," he said.