uri Andropov, the Soviet Communist Party leader, was formally elected president today in a move reaffirming his dominant position in the Kremlin leadership.

The two chambers of the Supreme Soviet, the legislature, meeting in joint session at the Great Kremlin Palace, took the decision unanimously. It capped a swift consolidation of power and authority by the former chief of the KGB security police, who succeeded the late Leonid Brezhnev as general secretary of the Communist Party seven months ago.

As general secretary of the party and chief of the Defense Council, or commander in chief of the armed forces, Andropov already held the two most powerful positions in the country. The presidency, a largely ceremonial post, now gives him added prestige, authority and flexibility, particularly in foreign affairs.

Following the vote by 1,500 deputies, Andropov made a short acceptance speech after he rose to acknowledge a standing ovation. A microphone already placed at his seat, perhaps because of his apparent but unspecified physical infirmities, saved him a walk to the podium.

"I see your trust as trust in our Leninist Communist Party, of which I have been a member for more than 40 years and to whose ideals I consider myself dedicated," he said, speaking without notes.

The new president showed little emotion and appeared withdrawn throughout the session, which was addressed by the two senior deputy premiers, Andrei Gromyko and Politburo member Gaidar Aliyev. Gromyko, who also is foreign minister, reviewed foreign policy in general and, after accusing the West of subversion in Poland, stressed Soviet Bloc "determination to defend the inviolability of our borders." Aliyev dealt with internal issues.

The actual decision to confer the ceremonial post on Andropov was taken by the party's policy-making Central Committee yesterday, coinciding with Andropov's 69th birthday. The Supreme Soviet made it formal without debate after a brief nominating speech by Politburo member Konstantin Chernenko, who was Andropov's principal rival in the succession last year.

Saying that the Central Committee decision was made "in complete unity," the 71-year-old Chernenko praised Andropov's "human qualities, wisdom and experience" and described him as an "outstanding leader of the Leninist type."

Andropov is the Soviet Union's 10th president but only the second also to hold the post of general secretary. It took Brezhnev 13 years to obtain both posts.

The post of president of the Supreme Soviet was left open following Brezhnev's death.

Andropov was named general secretary two days later and the following month was elected member of the Presidium of the Supreme Soviet, a collective state presidency, which gave him the right to act as head of state when the occasion required.

Today's lineup of the leaders seated on a dais in the vast neoclassical chamber of the Great Palace indicated that Chernenko's standing had dropped slightly. He ranked fifth after Andropov, Premier Nikolai Tikhonov, the defense minister, Marshal Dmitri Ustinov, and Gromyko.

That Chernenko was a main speaker at the Central Committee meeting and made the nominating speech today suggested a compromise within the Politburo to underline the image of stability and continuity.

By adding the presidency to his other titles, Andropov gained more prestige than authority. The Supreme Soviet is a rubber-stamp legislature, invariably endorsing all decisions made by the 300-member Central Committee, the real seat of power.

The Central Committee, which includes the top echelon of the party, meets only twice a year. Day-to-day authority is concentrated in its 10-member Secretariat and 11-member Politburo.

The Secretariat defines and analyzes issues for decision by the Politburo. Andropov, as general secretary, is the chief officer of both. As such, he can both shape options on issues and then preside over the Politburo as it makes decisions each Thursday.

As chief of the Defense Council, he presides over a body comprising all top military and security figures, as well as top representatives of all military-related aspects of Soviet life.

Brezhnev, by temperament, was a consensus seeker and his was a government by committee. Andropov, by all indications, is more decisive and likely to use the prerogatives of position to bring about change.

Andropov has been brutally frank in his speeches and shown his main preoccupations to be the stagnating economy and ways to revive it. In his first major speech last November, he asserted that he had no "recipe" to cure the economic ills. In the past two days he advanced a broad program for changes that won the approval of the Central Committee. It decided, moreover, to make his speech and the proposals in it a "platform" for party activities.

In the past, more modest changes have been resisted at lower levels of the party bureaucracy.