Panama's National Assembly swore in a new president today, after President Nicolas Ardito Barletta announced his resignation, declaring that he was forced out by lack of support from the Panamanian military and his political followers.

In an early morning emergency session, the assembly swore in Eric Arturo Delvalle, the first vice president, as Ardito Barletta's successor, respecting the form of constitutional rule if not the substance.

The abrupt shift in civilian leadership -- Ardito Barletta was at the United Nations as president until yesterday morning -- marred Panama's first attempt at elected government after years of direct military rule. It marked a setback for the Reagan administration's effort to promote the institutions and appearance of democratic government among U.S. allies in Central America as an antidote to leftist subversion.

Delvalle, a 48-year-old businessman with limited political leadership experience, was expected to make little change in Panama's political orientation, and the shift was expected to have no immediate effect on security of the Panama Canal.

The change in leadership was interpreted as another demonstration that Gen. Manuel Antonio Noriega and the Defense Force retain their traditional hold on power in Panama.

Ardito Barletta, 47, a U.S.-trained economist, was picked by Noriega last year to run as the military-sponsored candidate in Panama's first presidential election in 16 years. He was elected in May 1984 by only 1,713 votes out of about 600,000 cast in balloting, widely described by Panamanian and diplomatic observers as fraudulent.

Although heralded as a logical choice to manage Panama's burdensome $3.8 billion debt when he took office last October, Ardito Barletta proved slow in mustering a political following to put through harsh economic reforms made necessary by the debt. The precise reasons for his forced departure after only 11 months in office and its timing were not announced. But the crisis apparently signaled that Noriega and the Defense Force command felt that he was no longer the man for the job and, following the recent Panamanian practice of a "Kleenex presidency," they discarded him after use.

The Defense Force, formerly the National Guard, three years ago forced the resignation of President Aristides Royo. Similarly, last year the military pressured president Ricardo de la Espriella into resigning. Pushing out Ardito Barletta was considered more serious, however, because the first two were appointed and Ardito Barletta was elected in what was hailed as an experiment in democracy.

Delvalle, in a short address after taking over early this morning, referred to what was widely perceived here as Ardito Barletta's inability to inspire political loyalty and over-reliance on painful technical solutions without political spadework to translate them into law and practice. He was particularly criticized by unions for seeking to liberalize the labor code and by business for trying to end protective tariffs.

"For one reason or another, the government has lacked that image of leadership that invites and promotes united and coordinated actions," the new president declared.

Delvalle, trained at Louisiana State University, also underscored the difficulties that now face him, saying Panama is caught "in the middle of a social, political and economic whirlpool."

Ardito Barletta, in a resignation letter broadcast over television before dawn, said he was leaving the presidency because his Revolutionary Democratic Party-led legislative coalition and the Defense Force "consider they can no longer work with my presidency to carry out government actions necessary at this time to pull the country out of the difficult circumstances it is in."

The Revolutionary Democratic Party was founded by the late Gen. Omar Torrijos as a vehicle for returning Panama to civilian rule under military tutelage. Ardito Barletta's election last year was described by Noriega as fulfillment of Torrijos' pledge to lead Panama back to elected civilian government