After a second meeting today with Panama's leader, Gen. Omar Torrijos, Sen. Howard H. Baker, Jr. (R-Tenn.) ended his five-day visit here and declared that the Panama Canal treaties can pass the U.S. Senate.

Senate approval will depend on Panamanian willingness to compromise, the Republican minority leader said. But he added that in his opinion, Gen. Torrijos, the Panamanian strong man, would accept compromise including amendments to the original treaties.

Torrijos himself avoided an opportunity to publicly confirm or deny Baker's optimistic prediction by staying away from reporters.

After meeting with the senators for more than an hour at his remote beach house, Torrijos sent his foreign minister to speak for him at the airport news conference that concluded Baker's visit. The foreign minister, Nicholas Gonzalez-Revilla, said Torrijos retained "an open mind," and he made no attempts to dampen the atmosphere or discourage Baker's optimism.

Panamanian sources close to Torrijos have emphasized this week that the real question is how far the general must go to pleace two-thirds of the United States Senate. One of Torrijos' close friends said he would make concessions to the Senate, but he could not rewrite the treaties under American pressure.

[LINE ILLEGIBLE] , the Republican minority leader both say that Torrijos has had a painful time coming to the realization that President Carter cannot insure Senate approval of the Canal agreements. Less than a month ago, sources here said, Carter's aide Hamilton Jordan was telling Torrijos here that the Senate would approve the treaties.

Torrijos was surprised and upset Wednesday when Baker told him at their first meeting that the Canal treaties could not win Senate approval as they presently stand. U.S. officials here said Torrijos may have overestimated his own ability to win over wavering senators and was surprised when Baker refused to be persuaded.

In fact, though - as associates of Baker made clear - the Tennessee Republican has actually decided to support the treaties providing Torrijos makes a few concessions. And this is exactly what Panamanian sources say he is prepared to do.

Sources here suggests that Torrijos' reaction to the changing political situation surrounding the treaties reflects Latin political traditions. His lack of knowledge about U.S. affairs and his delicate position in Panama.

Torrijos has apparently risked his political standing here on success in the treaty negotiations - which would mean securing the Panama Canal for Panama, though not until 1999.When the treaties were signed last year. Torrijos and his associates felt they had won this victory.

Since then, however, they have been forced to make a series of new concessions - not concessions of great substance, but embarrassing nevertheless because they have involved succumbing to U.S. pressure.

Torrijos has cast himself as a military strongman able to cope with the Yankees - but they have been pushing him around.

His first difficulties arose in October over Panamanian interpretations of clauses in the treaties involving U.S. rights to defend the Canal militarily and use it for military purposes after 1999.

During talks in Washington, Carter persuaded Torrijos to approve a joint communique, issued Oct. 14, interpreting the treaty language as fully upholding American rights to defend the Canal and receive priority rights of passage for military vessels in an emergency. But Torrijos did not sign that communique, a fact that he seemed to boast about when he returned to Panama.

This led to renewed pressure from Washington. The United States said the General had to take responsibility for the communique or risk defeat in the Senate. Finally, in a televised speech, Torrijos endorsed it. In fact, in one of the flip-flops for which he is famous here, he boasted that it was a fine communique, one he should have signed in Washington.

Several weeks later Senate Majority Leader Robert C. Byrd (D-W.Va.) and six other senators visited Panama and pressed Torrijos on a new front - human rights.

In a way that is probably only possible for U.S. officials in Central America, as one diplomat here put it, Byrd told Torrijos which of his government's policies and decrees would have to be changed to satisfy the Senate. Torrijos responded diplomatically, agreeing to make the changes Byrd demanded and promising a more liberal regime. Byrd left Panama with a more positive attitude towards the treaties.

By the end of Baker's visit here, Panamanian resentment at continued "meddling" by Americans was palpable.One newspaper columnist wrote:

"With the long parade of Senators [visiting here], we Panamanians have developed a complex of being in a zoo."

But at the same time, government controlled newspapers and Panamanian officials repeated the message that Torrijos was flexible and open-minded. Panamanian sources said Torrijos would accept a reservation or understanding added to the treaties that incorporated the language of the Carter-Torrijos communique.

Another possible change, these sources said, would be to drop the article giving the U.S. the right to build a new canal in Panama and committing America not to build such a canal in any other country. This article added at President Carter's suggestion, has few if any friends in Panama and several foes in the Senate.

Sources close to Torrijos say the General would not find it easy to go beyond these changes. Torrijos is known to want to avoid holding a second plebiscite on the treaties. The first one last fall carried by two to one.

But Torrijos' foreign minister did not rule out another plebiscite in his remarks today. He said it was "premature" to consider one.