nonlinear regression considering substrate addition over time

8 Ansichten (letzte 30 Tage)
Jack95
Jack95 am 18 Mär. 2023
Bearbeitet: Varun am 25 Aug. 2023
Hi all, I'm trying to generate some code why insert model in my data. The problem is that I have a substrate addition in 3 different periods, which I have split into three tspans.I thought it was simple enough, but some problems appeared that I don't know how to fix. I attach both the code and the data txt file.
Thanks everyone in advance!!

Antworten (1)

Varun
Varun am 25 Aug. 2023
Bearbeitet: Varun am 25 Aug. 2023
Hi Jack95,
I understand that you are facing errors while running your script test.m which uses ode45() function.
I have run your script test.m with data.txt locally, I also faced the errors. I figured out the root cause of error. Actually inside your custom function function
dCdt=ParameterJack(t,C)
you are calling
[T,Cv]=ode45(@DifEq,t,c0);
in which the 2nd argument to ode45 expects a tspan and should have at least 2 elements (e.g. a vector) but you are passing ‘t’ as argument which is a scalar. I tried passing some dummy vector with at least 2 elements and the error was resolved.

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by