How should I use erfc?
2 views (last 30 days)
Show older comments
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.
Answers (1)
Walter Roberson
on 4 Oct 2021
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 Comments
See Also
Categories
Find more on Partial Differential Equation Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!