Solving complex equation.
이전 댓글 표시
I want to create an equation in matlab and for each one variable that is unknown it can solve it directly.

For example I sign every variable to equal a number and solve for Cj.
Below is my coding to solve for Cj.
However I want to create an equation that let say if I have Cj known and I want to find H or y it can solve it without me having to creat another equation to solve for it
mdot = 115; % Source Strength g/s
U = 6.82; % Wind speed m/s
h = 62.6; % Stack Height (m)
Sh = 25.5; % Plume Rise Height (m)
H = h + Sh; % Effective Stack Height (m)
x = 2; % X location (m)
y = 0; % Y location (m)
z = 1.49; % Z location (m)
% Dispersion Coefficients
a = 68;
b = 0.894;
c = 44.5;
d = 0.516;
f = -13;
% Dispersion Coefficients
Sigma_Y = a * (x^b);
Sigma_Z = c * (x^d) + f;
% Exp
e1 = exp((-1/2)*((y/Sigma_Y)^2 + ((z-H)/Sigma_Z)^2));
e2 = exp((-1/2)*((y/Sigma_Y)^2 + ((z+H)/Sigma_Z)^2));
% Equation for Gaussian concentration for absorbing ground
Cj1 = (mdot * e1) / (2*pi*U*Sigma_Y*Sigma_Z);
Cj_Absorbing = Cj1 * 10^6;
% Equation for Gaussian concentration for reflective ground
Cj1 = (mdot * (e1 + e2)) / (2*pi*U*Sigma_Y*Sigma_Z);
Cj_Reflecting = Cj1 * 10^6;
댓글 수: 5
Benjamin Thompson
2022년 2월 22일
편집: Benjamin Thompson
2022년 2월 22일
You could use the Symbolic Math Toolbox. There are a lot of examples here:
Star Strider
2022년 2월 22일
Torsten
2022년 2월 22일
Example:
syms x y
expr = 3*x^2 + sin(y) == 0;
solx = solve(expr,x)
soly = solve(expr,y)
Abdullah Alsayegh
2022년 2월 22일
Torsten
2022년 2월 22일
syms x y
expr = 3*x^2 + sin(y) == 0;
solx = solve(expr,x);
solx = double(subs(solx,y,0.3))
soly = solve(expr,y);
soly = double(subs(soly,x,0.2))
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

