Custom fitting using equation from differential function
Ältere Kommentare anzeigen
Hello guys,
I have some data that need to be fit by the equation from differential equation solver. I want to obtain parameter from syms A and B as an answer. Here is my code that I try to solve.
syms t y(t) A B
eqn_ass = diff(y,t) == A-B*y;
cond_ass = y(0) == 0;
R_ass = dsolve(eqn_ass,cond_ass); % I want to use equation from here as my fitting equation to obtain parameter A and B
Akzeptierte Antwort
Weitere Antworten (2)
Alan Stevens
am 1 Jun. 2022
0 Stimmen
You equation has the analytical solution y = (A/B)*(1-exp(-B*t)). Use fminsearch to fit the parameters, or the curve fitting toolbox if you have it.
Sabella Huang
am 3 Jun. 2022
0 Stimmen
Kategorien
Mehr zu Calculus finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!