WAIT, wow, that was a stupid integration mistake.
This
$$-kln\left(m_{o} - kt'\right)|_{0}^{t} = -bln\left(kv_{ex}-bv'\right)|_{0}^{v}$$
should have been
$$-\frac{1}{k}ln\left(m_{o} - kt'\right)|_{0}^{t} = -\frac{1}{b}ln\left(kv_{ex}-bv'\right)|_{0}^{v}$$
Homework Statement
Consider a rocket subject to a linear resistive force, $$f = -bv$$, but no other external forces. Use Equation (3.29) in Problem 3.11 to show that if the rocket starts from rest and ejects mass at a constant rate $$k = -\dot{m}$$, then its speed is given by:
$$v =...
Okay! I figured it out (thanks to looking over the documentation again haha). When using nlinfit, the test function can only take TWO inputs: a vector containing the coefficients, and the independent variable. Here's my working code:
%Test function
t = t';
y = y';
test =...
I've already looked at the documentation and I've done examples in class. I cannot see where my error is coming from.
EDIT: Sorry for being snippy, thank you!
Error using nlinfit (line 205)
Error evaluating model function
'@(t0,k,phi)(t-t0).*sin(k.*(t-t0)+phi).*(t>=t0)+(t0).*sin(k.*t0+phi).*(t<t0)'.
Error in HW6_Part2_Lonner (line 28)
coef_inv = nlinfit(t,y,test_fcn,guess);
Caused by:
Not enough input arguments.
nlinfit is a function from the statistics toolbox offered by Matlab. The anonymous function is the "test" function.
EDIT: I realize my phrasing was confusing, but it was a list of three separate things.
Hello! I'm trying to plot a best fit for some generated EQ data and I'm having issues with nlinfit. My code is as follows and when I try to run it, I get an error referring to the anonymous function ("test"), nlinfit (from Matlab), and not having enough input arguments.
%Test function
t =...