Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function dz = model(t, z, c)
  2. dz(1) = ..
  3. dz(2) = ..
  4.  
  5. %p0 = Initial Value of Parameters
  6. A = [];
  7. b = [];
  8. Aeq = [];
  9. beq = [];
  10. nlcon = ode45(@(t,z)model(t,z,x), tSpan, z0); % Is this correct?
  11. p = fmincon(@objective,p0,A,b,Aeq,beq,lb,ub,nlcon);
  12.  
  13. function cost = objective(c,expZ,tSpan,z0)
  14. sol = ode45(@(t,z)model(t,z,c), tSpan, z0); % Is this step required?
  15. ModelZ = sol(end,:)% the solutions obtained from model at end point of tSpan
  16. cost = ModelZ-expZ; %expZ contains steady state values of z1,z2..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement