필터 지우기
필터 지우기

Symbolically solving an equation with multiple variables

조회 수: 2 (최근 30일)
Anna Julia
Anna Julia 2024년 5월 20일
이동: VBBV 2024년 5월 24일
This is the nozzle expansion ratio equation and I am attempting to solve for the exit pressure. It is quite complex to rearrange for Pe (exit pressure) by hand so I figured I would put it into Matlab and solve symbollically. I keep getting an empty vector for solveEqn... I'm quite inexperienced with solving symbollically in Matlab so I would appreciate some help. Thank you.
syms Pe k A_ratio Pc
A_ratio = 2.06265092035577;
k = 1.1876;
Pc = 3447378.65;
eqn = ((k+1)/2)^(1/(k+1))*(Pe/Pc)^1/k*sqrt((k+1)/(k-1))*(1-(Pe/Pc)^(k-1)/k) == A_ratio;
solveEqn = solve(A_ratio, Pe);

답변 (1개)

VBBV
VBBV 2024년 5월 21일
이동: VBBV 2024년 5월 24일
@Anna Julia, You can calculate the exit pressure something like this, by using the eqn and vpasolve
% exit pressure low
syms Pe
A_ratio = 2.06265092035577;
k = 1.1876;
Pc = 3447378.65;
eqn = ((k+1)/2)^(1/(k+1))*(Pe/Pc)^(1/k)*sqrt((k+1)/(k-1))*(1-(Pe/Pc)^(k-1)/k) == A_ratio;
solveEqn = vpa(real(vpasolve(eqn, Pe)),8)
solveEqn = 
% check the equation you typed in Matlab with actual equation
% exit pressure high (undesirable)
eqn = ((k+1)/2)^(1/(k+1))*(Pe/Pc)^(1/k)*sqrt(((k+1)/(k-1))*(1-(Pe/Pc)^(k-1)/k)) == A_ratio;
solveEqn = vpa(real(vpasolve(eqn, Pe)),8)
solveEqn = 
5110154.2

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by