How should I use erfc?
2 ビュー (過去 30 日間)
古いコメントを表示
The equation in the photo is the analytic solution of the ED model(equilibrium-dispersive model).
We want to express the expression of the photo in MATLAB.
Shouldn't variables be used in erfc?
Please tell me how to use erfc
The variables are x and t.
c(x,t)
Please tell me how to put it in matlab.
回答 (1 件)
Walter Roberson
2021 年 10 月 4 日
When you use simulink, generally speaking each time you call a function other than the basic mathematical operators, you should assign the result to a variable. The variable should have already been assigned zeros() that is the same size as the result you expect from the function call.
t1 = zeros(1,1);
t2 = zeros(1,1);
t3a = zeros(1,1);
t3b = zeros(1,1);
t4 = zeros(1,1);
t5a = zeros(1,1);
t5b = zeros(1,1);
t1 = sqrt(P_e/2);
t2 = L./u .* (1 + a.*F);
t3a = t2 .* x - t;
t3b = t2 .* x + t;
t4 = sqrt(t2 .* t);
t5a = erfc(t1 .* t3a ./ t4);
t5b = erfc(t1 .* t3b ./ t4);
and so on.
Not all of the above temporary variables are required: some of them exist only to make it easier to write both erfc() sub-expressions
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Partial Differential Equation Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!