Scripting a derivation - integration from XY values

13 次查看(过去 30 天)
Hello everyone,
I am working on a project and my last thing is calculate a value from an analysed results.
I have M - T values at constant H. And try to do that (I gave below) step by step calculation at MATLAB but I can not imagine my scriptting.
  1. Plot M(T,H) (H = Constant) -> I have already M - T values (H constant)
  2. Perform numerical differantiation of the function M(T,H) with respect to T. -> I used polyfit(T,M,2)
  3. Plot dM(T,H)/dT (T = constant) from dM(T,H)/dT (H = constant) -> I did not realize it.
  4. Numerical integration of the function dm(T,H)/dT (T=constant) with respect to H. -> Also this one.
OK, I generate a function by using polyfit for M and T values but I did not understand other steps. Can anyone help me?
Thank you!
  4 个评论
John D'Errico
John D'Errico 2020-7-11
编辑:John D'Errico 2020-7-11
You don't necessarily need to create a function. This introduces error, because the approximation will have lack of fit to your data.
For example, you can use the gradient function to differentiate a data series.
You can use trapz or cumtrapz to integrate a data series.
It depends on how much noise is is the data, and how good of an approximation is your curve fit. You may easily be introducing more error into the problem just by your use of a polynomial fit. Without seeing the data and the fit you choose, I would need to say that you need to consider which option is correct.
Semih Ates
Semih Ates 2020-7-11
Alright, I see. But what if I want to integrate my values according to summution approximation.
with this equation ?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by