フィルターのクリア

How to plot symbolic variable that has a polynomial ?

1 回表示 (過去 30 日間)
DIP
DIP 2017 年 5 月 1 日
編集済み: DIP 2017 年 5 月 1 日
Hi all.
I have a code, i need to plot y vs the syms variable Lambda_avg as given in the last line. How do i plot so that i can check how to variable changes as a result of distance ?
clc;
syms x
L=1;F=96485;P=47000;
% Anode molar flow rate equation
a=(-(1.12*(x/L)^2 - 2.24*x/L+1.2)*(4.978*(x/L)^4 + 5.756*(x/L)^3-0.544*(x/L)^2 - 0.496*x/L+0.35)*1/F);
int (a);
% Cathode molar flow rate equation
c=(0.5+(1.12*(x/L)^2 - 2.24*x/L+1.2))*(-4.978*(x/L)^4 + 5.756*(x/L)^3 -0.544*(x/L)^2 - 0.496*x/L+0.35)*1/F;
int(c);
% Partial pressure of water at anode and cathode
PH2Oa=100000*a/(1.142*10e-7 + a);
PH2Oc=100000*c/(2.767*10e-7 + c);
% Water uptake at anode and cathode
Lambda_a=1.4089+11.263*(PH2Oa/P)-18.768*(PH2Oa/P)^2+16.209*(PH2Oa/P)^3;
Lambda_c=1.4089+11.263*(PH2Oc/P)-18.768*(PH2Oc/P)^2+16.209*(PH2Oc/P)^3;
Lambda_avg = mean(Lambda_a+Lambda_c);
%plotting the average intake as function of y
Y = linspace(0,1,1000);
plot(Y, subs(Lambda_avg, x, Y));

採用された回答

Walter Roberson
Walter Roberson 2017 年 5 月 1 日
Y = linspace(0,1,1000);
plot(Y, subs(Lambda_avg, y, Y));
Or, alternately, if you have a new enough MATLAB,
fplot(Lambda_avg, [0 1]);
  1 件のコメント
DIP
DIP 2017 年 5 月 1 日
Thank you sir.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by