Summary of video: "Plug equation into matlab" ... Video is just a tease since it doesn't show implementing a solver. It starts to sets up the thoeerry annnddd then mmk time to give up and plug into matlab. Would have been an awesome video if you demonstrated scratch approach to fit your data from start to finish.
In this method, equations are assumed to be linear for simplifying calculations. That novel part is missing.But the concept that why method is iterative is very well explained.
Hello, thank you for this class. I have a doubt: I have a mass balance where I want to find the best k: - non-linear: C = C0 * exp(-k*t) - linear: ln (C0/C) = k*t And I want to use the function "fit" in MATLAB. I tried both ways (linear and non-linear, setting the method in the options) and it gave me different results for k. What would be the most correct result? Since linearizing is one extra step, does it input more error to the results? Thank you.
Yes, thank you :) Could you point me a book that states what you said, so I could use it as a reference if needed? Another thing: whenever I try to use the function fit with LinearLeastSquares, MATLAB gives this warning: "Warning: The given fit options specify a LinearLeastSquares fit but the model specifies a NonlinearLeastSquares fit." I don't know what it means by "the model specifies". But I guess it still uses the linear method, since the results are different from the nonlinear. It displays this warning even if my data is completely linear, like: options = fitoptions('Method', 'LinearLeastSquares'); xdata = [0; 300; 600; 900; 1200]; ydata = [0; 3; 6; 9; 12]; k = fit(xdata, ydata, 'k*x', options)
Thank you for the video,I want to ask you about apply Least square method to interpolate this function : y=Ab(e(-bx)-e(-cx))/(b-c), How can I linearize my function?
Thank you for your answer, I'm working in nuclear medecine , I have lot of data to treat(about 18 million curves per package), I succeed until now to do non linear least square to get the coefficient of my function and plot my curve, but this method in machine takes lot of time, so I want to linearize my function to apply linear least square because is fast , the new function is [a.exp(bx)+c.exp(dx)]. example : f(x)=a.exp(b.x) ==> after linearization f(x)=ln(a)+b.x , so I get the forme b.x+a to apply Least square
Summary of video: "Plug equation into matlab" ... Video is just a tease since it doesn't show implementing a solver. It starts to sets up the thoeerry annnddd then mmk time to give up and plug into matlab. Would have been an awesome video if you demonstrated scratch approach to fit your data from start to finish.
Summary of video: "Plug equation into matlab" ... Video is just a tease since it doesn't show implementing a solver. It starts to sets up the thoeerry annnddd then mmk time to give up and plug into matlab. Would have been an awesome video if you demonstrated scratch approach to fit your data from start to finish.
In this method, equations are assumed to be linear for simplifying calculations. That novel part is missing.But the concept that why method is iterative is very well explained.
I appreciate your clear explanation!
No problem!
Nice explanation 👍
Hello, thank you for this class.
I have a doubt: I have a mass balance where I want to find the best k:
- non-linear: C = C0 * exp(-k*t)
- linear: ln (C0/C) = k*t
And I want to use the function "fit" in MATLAB. I tried both ways (linear and non-linear, setting the method in the options) and it gave me different results for k.
What would be the most correct result?
Since linearizing is one extra step, does it input more error to the results?
Thank you.
Yes, thank you :)
Could you point me a book that states what you said, so I could use it as a reference if needed?
Another thing: whenever I try to use the function fit with LinearLeastSquares, MATLAB gives this warning:
"Warning: The given fit options specify a LinearLeastSquares fit but the model specifies a
NonlinearLeastSquares fit."
I don't know what it means by "the model specifies". But I guess it still uses the linear method, since the results are different from the nonlinear.
It displays this warning even if my data is completely linear, like:
options = fitoptions('Method', 'LinearLeastSquares');
xdata = [0; 300; 600; 900; 1200];
ydata = [0; 3; 6; 9; 12];
k = fit(xdata, ydata, 'k*x', options)
Why is the 2 multiplying the summation of each partial derivative is dropped when going to matrix "F" (big F)
Ya, great question. You could keep the "2" in there, but since we are ultimately solving for F = 0, the "2" can also be dropped.
Thank you for the video,I want to ask you about apply Least square method to interpolate this function :
y=Ab(e(-bx)-e(-cx))/(b-c),
How can I linearize my function?
Thank you for your answer, I'm working in nuclear medecine , I have lot of data to treat(about 18 million curves per package), I succeed until now to do non linear least square to get the coefficient of my function and plot my curve, but this method in machine takes lot of time, so I want to linearize my function to apply linear least square because is fast , the new function is [a.exp(bx)+c.exp(dx)]. example :
f(x)=a.exp(b.x) ==> after linearization f(x)=ln(a)+b.x , so I get the forme b.x+a to apply Least square
Should F(Y) not be equal to 2*sum(Y)?
I recognized that once I calculated it myself :D
Thank you
No problem! If you have a suggestion for a different video, feel free to post your idea here.
thank you bro
Summary of video: "Plug equation into matlab" ... Video is just a tease since it doesn't show implementing a solver. It starts to sets up the thoeerry annnddd then mmk time to give up and plug into matlab. Would have been an awesome video if you demonstrated scratch approach to fit your data from start to finish.
*****
Thanks for the reply, I know your probably a super busy guy, but sometime a video on a NL solver would be awesome.