Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dz = model(t, z, c)
- dz(1) = ..
- dz(2) = ..
- %p0 = Initial Value of Parameters
- A = [];
- b = [];
- Aeq = [];
- beq = [];
- nlcon = ode45(@(t,z)model(t,z,x), tSpan, z0); % Is this correct?
- p = fmincon(@objective,p0,A,b,Aeq,beq,lb,ub,nlcon);
- function cost = objective(c,expZ,tSpan,z0)
- sol = ode45(@(t,z)model(t,z,c), tSpan, z0); % Is this step required?
- ModelZ = sol(end,:)% the solutions obtained from model at end point of tSpan
- cost = ModelZ-expZ; %expZ contains steady state values of z1,z2..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement