How to plot the variations for integrating parameter

Hello all,
I have some equations integrated in Matlab. One such set of equations are,
H2Ox = @(EA) -0.0023*(-8/(48000^8))*(((EA)-183000)^7);
H2Oz = integral(H2Ox, 183000, Inf);
Here there are no issues with integration, but I would like to plot the variations for integrating parameter EA. I don't know if Matlab provides the intervals to understand the change in values.
Is it possible to get the EA values as output ? in order to understand as how EA behaves ?
Kindly someone share the thoughts.
Thank you

7 件のコメント

Ghazwan
Ghazwan 2022 年 10 月 8 日
it looks like you need a for-loop for the values variations you want.
Walter Roberson
Walter Roberson 2022 年 10 月 8 日
integral() divides the initial interval into 10 segments each with 15 nodes. The locations of all active nodes are passed at the same time to the function H2Ox()
integral() then estimates the error for each active segment. Any segment that has a sufficiently low error has its estimated contribution added to the overall sum and then gets deleted from the list of active intervals. Any remaining intervals are subdivided into two pieces and each is reevaluated. This process continues until all intervals have sufficiently low error or 16384 active intervals are reached (i would need to recheck the termination conditions)
Thus during any one call to H2Ox() the function is being asked to evaluate for a number of nodes of intervals that might not be adjacent to each other.
Do I understand correctly that you want to extract a record of the locations evaluated at in order to see how they evolve? To examine, for example, where in the interval are "difficult" to integrate?
Kumaresh Kumaresh
Kumaresh Kumaresh 2022 年 10 月 8 日
編集済み: Kumaresh Kumaresh 2022 年 10 月 8 日
Thank you Mr. Ghazwan and Mr. Walter for your comments.
Yes, I have for-loop and I got the variations for species like H2O, CO2, CO, CH4 and so on. These species variations takes place by integrating EA (Activation energy) from 183,000J/mol (starting value) to higher value (taken as infinity in MATLAB).
To keep my question more clear, I would like to know how this EA varies from 183,000 to ?? (infinity). So, is it possible to extract the variations for EA in MATLAB?
Torsten
Torsten 2022 年 10 月 8 日
Is it possible to get the EA values as output ? in order to understand as how EA behaves ?
I don't understand your question. EA is the independent variable. It behaves as you prescribe it to behave.
Kumaresh Kumaresh
Kumaresh Kumaresh 2022 年 10 月 10 日
Hello Torsten,
Sorry for my late response.
H2Oz = integral(H2Ox, 183000, Inf);
When defining the value from 183,000 to Inf, MATLAB doesn't really define infinity, instead it calculates with the maximum value. Once knowing the range of definite limits of integral, for example, from 183,000 to 300,000, I could able to plot the dependent variables (like FE_H2O) of EA such as, FE_H2O = @(EA) exp(-((((EA)-E0)/48000).^8));
Did you understand my thoughts now ?
Thank you
Ghazwan
Ghazwan 2022 年 10 月 10 日
ok. If you plot it a simple 2D plot, what would be the X and Y axes?
Kumaresh Kumaresh
Kumaresh Kumaresh 2022 年 10 月 10 日
X - EA,
Y - Dependent variables like FE_H2O, CO2, so so on

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

 採用された回答

Torsten
Torsten 2022 年 10 月 10 日

0 投票

Note that integral(H2Ox, 183000, Inf) = Inf !!
H2Ox = @(EA) -0.0023*(-8/(48000^8))*(EA-183000).^7;
H2Oz = @(y) integral(H2Ox, 183000, y);
y = 183000:100:300000;
plot(y,arrayfun(H2Oz,y))

1 件のコメント

Kumaresh Kumaresh
Kumaresh Kumaresh 2022 年 10 月 13 日
Thanks Mr. Torsten. You saved my day. You should be called as MATLAB magic man !!

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

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by