Runge-kutta (rk2) for radio decay
8 views (last 30 days)
Show older comments
brandon fries on 27 Sep 2016
Answered: Michael Abboud on 29 Sep 2016
solve the equation
initial nuclei=1000 @ t=0
my code so far is:
for i =2:length(t);
it keeps running the error message 'too many input arguments'
Am i headed in the right direction? anything will help
James Tursa on 27 Sep 2016
Please show the decay code. Note that you are calling decay with only 2 arguments in the Y1 line, but with 3 arguments in the other lines.
Michael Abboud on 29 Sep 2016
When I tried to run your code, I received the following error message: “PDS is not a polytopic or parameter-dependent system”, so I’m wondering if you perhaps wrote your own “decay” function.
However, if you are using the MATLAB “decay” function from the Robust Control Toolbox, appears from the documentation page that “decay” has only two inputs: “ps” and “options”. Here, “options” is an array of 2 values, yet you are passing in 3 separate arguments.
Instead of using the line:
>> Y2 = dt * decay( tn+dt/2, Nn+Y1/2, tau);
Try the following:
>> options = [Nn+Y1/2 , tau];
>> Y2 = dt*decay( tn+dt/2, options);
Find more on Runge Kutta Methods in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!