Predictive curve fitting using cftool
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a question about curve fitting, I have many measurements (375 to be precise) like the one in the picture.
X axis : time
Y axis : temperature
Each sample comes out every 30s.
GOAL : predict the value at the end of the transient
What would you do in this situation?
What I am doing is this : for every new sample I start a new fitting with cftool(and so each fitting is independent from the previous one) and check the value of the fitted curve 2 hours (all curves I have reach steady-state before 2h) after the start of the measurement. If for a number (let's say 5) of subsequent fitting the value in the future stays more or less the same(+-0.2°C) I so assume that the estimation is the right one.
I have tried with rat44 and exp2 models limiting also the parameters (the one with a direct physical meaning such as Temperature at steady state or the time constant) and I would say that this in general 'can save time' (i.e. I can predict rather well the steady value even if I am not already there..more or less at 1500 seconds in the example here below) but other times I have to wait too much time.
rat44=((fitresult1.p1)*(time.^4)+(fitresult1.p2)*(time.^3)+(fitresult1.p3)*(time.^2)+...
(fitresult1.p4)*(time)+fitresult1.p5)./((time.^4)+(fitresult1.q1)*(time.^3)+(fitresult1.q2)*(time.^2)...
+(fitresult1.q3).*time+fitresult1.q4);
%here I have tried limiting fitresult.p1 (T at infinite)
exp2=(fitresult.a)*exp((fitresult.b)*time)+(fitresult.c)*exp(fitresult.d*time);
% I have tried with fitresult.d locked to 0.. to have something like a response with a single pole
This approach seems to me far too simple and I think I am not exploiting all information.
For example the info of the error I am making punctually (e.g. at minute 4:00 I predict and at 4:30 I see that I am doing an error).
Here you can see an example of curve. (Red curve is room temperature)

Here instead a window of the cftool. In the picture the red part of the curve is excluded (but the real data in the future passes through it). the estimation is the blue one. You see in this case I don't have a good prediction... In general I have also more flat curves.

How can you do something better in Matlab? I am a beginner with Matlab and so I may be not aware of possible functions and tools that could do predictions better. Thank you.
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!