声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2824|回复: 4

[综合讨论] ??? Error using ==> funfun\private\odearguments

[复制链接]
发表于 2011-3-22 12:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
错误时这样的:
??? Error using ==> funfun\private\odearguments
Solving MODEL_HOFF requires an initial condition vector of length 10.

Error in ==> ode15s at 227
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, ...

Error in ==> IKK_optimal at 22
        [T,Y]=ode15s(@model_hoff,tspan,Y01,[],par,Source);



代码如下:
  1. %#####Optimal Experimental Design based on the Fisher Information Matrix####
  2. %#####The NF-kB model with 10 states and 11 parameters######################
  3. clc;
  4. close all;
  5. clear all;
  6. format long;
  7. parameters_hoff; % parametrization of ODE's and simulation times


  8. IKK_normal=0.9;  %the initial concentration of IKK;  IKK is the initial N

  9. para=[3 4 5];  %the id of parameters analysed

  10.   for k=1:100
  11.       
  12.         Y01(1)=IKK_normal*k/10;
  13.         
  14.         IKK(k)=Y01(1);
  15.         
  16.         tspan=[t0:tau:t0+tw];
  17.         
  18.         [T,Y]=ode15s(@model_hoff,tspan,Y01,[],par,Source);
  19.       
  20.     %%The local sensitivity analysis method is used to gain the absolute sensitivity matrix
  21.       
  22.         error=10;%input gain value[0-100]
  23.         
  24.         disp('please wait......')
  25.         
  26.         abso_s=[];  %the absolute sensitivity matrix
  27.         
  28.     %%the local sensitivity analysis using the infite difference method%%%%%%%%   
  29.      
  30.      for j=1:length(para)
  31.          
  32.           i=para(j);  
  33.          
  34.           %parameter i is decreased with error%
  35.             par(i,1)=par(i,1)*(1-error/100);
  36.           %############ IKK on ####################################
  37.             [T1,Y1]=ode15s(@model_hoff,tspan,Y01,[],par,Source);
  38.           %parameter i is returned to its original value
  39.             par(i,1)=par(i,1)/(1-error/100);
  40.             
  41.           %parameter i is increased with 1error%
  42.             par(i,1)=par(i,1)*(1+error/100);
  43.          %############ IKK on ####################################
  44.             [T2,Y2]=ode15s(@model_hoff,tspan,Y01,[],par,Source);
  45.          %parameter i is returned to its original value
  46.             par(i,1)=par(i,1)/(1+error/100);   
  47.             
  48.          %the absolute sensitivity S(i,j)=[x(p+error%*p)-x(p-error%*p)]/(2*error%*p)
  49.             S=(Y2-Y1)/(2*par(i,1)*error/100);
  50.                  
  51.             abso_s=[abso_s S(:,9)]; %the absolute sensitivity matrix of the system output states x9 w.r.t the i-th parameter        
  52.      end
  53.       
  54.           relative_error=0.05;  %the relative error of the measure value
  55.           absolute_error=0.001; %the absolute error of the measure value

  56.           cova_v=[]; %the error covariance matrix
  57.           v=[]; %the diagnoal elements of the error covariance matrix
  58.          
  59.           for j=9
  60.              for i=1:max(size(Y))
  61.                  sigma(:,i)=relative_error*Y(i,j)+absolute_error;
  62.              end
  63.              v=[v sigma];
  64.           end
  65.           cova_v=diag(v.^2);
  66.   
  67.           %the Fisher information matrix FIM
  68.             FIM=abso_s'*inv(cova_v)*abso_s;
  69.             
  70.             [vec,lam]=eig(FIM); %to calculate the eigenvalue of FIM
  71.             
  72.             for j=1:length(para)
  73.                 lambda(j)=lam(j,j); %the eigenvalue lamda of FIM
  74.             end
  75.             
  76.           %Optimal experimental design w.r.t initial value of IKK
  77.             oed_a(k)=trace(inv(FIM));           %A-optimal criterion
  78.             oed_d(k)=det(FIM);                  %D-optimal criterion
  79.             oed_e(k)=min(lambda);               %E-optimal criterion
  80.             oed_me(k)=max(lambda)/min(lambda);  %Modified E-optimal criterion         
  81.   end
复制代码





请问怎么改? 谢谢!!

另外model-hoff程序如下:
  1. %#############10 states####################################################################
  2.   %  y(1)   E
  3.   %  y(2)   ES
  4.   %  y(3)   E*
  5.   %  y(4)   EQ
  6.   %  y(5)   ER
  7.   %  y(6)   S
  8.   %  y(7)   P
  9.   %  y(8)   N
  10.   %  y(9)   Q
  11.   %  y(10)  R
  12.   %########################################################################
  13.   %##############
  14. function dy=model_hoff(t,y,par,Source)
  15. dy=zeros(10,1);
  16. y=zeros(10,1);

  17. dy(1)=-par(1,1)*y(1)*y(6)+par(2,1)*y(2)+par(7,1)*y(4)-par(8,1)*y(1)*y(9)+par(11,1)*y(5);
  18. dy(2)=par(1,1)*y(1)*y(6) - par(2,1)*y(2) - par(3,1)*y(2) + par(4,1)*y(3)*y(7);
  19. dy(3)=par(3,1)*y(2) - par(4,1)*y(3)*y(7) - par(5,1)*y(3)*y(8) + par(6,1)*y(4) - par(9,1)*y(3) + par(10,1)*y(5);
  20. dy(4)=par(5,1)*y(3)*y(8) - par(6,1)*y(4) - par(7,1)*y(4) + par(8,1)*y(1)*y(9);
  21. dy(5)=par(9,1)*y(3) - par(10,1)*y(5) - par(11,1)*y(5);
  22. dy(6)=-par(1,1)*y(1)*y(6) + par(2,1)*y(2);
  23. dy(7)=par(3,1)*y(2) - par(4,1)*y(3)*y(7);
  24. dy(8)=-par(5,1)*y(3)*y(8) + par(6,1)*y(4);
  25. dy(9)=par(7,1)*y(4) - par(8,1)*y(1)*y(9);
  26. dy(10)=par(11,1)*y(5);

  27. %######################################################################################################
  28. %######################################################################################################
复制代码
回复
分享到:

使用道具 举报

发表于 2011-3-22 13:54 | 显示全部楼层
楼上的,很多初始条件不设定,跟你的程序会很累的,比如
  1. tspan=[t0:tau:t0+tw]; %#ok<NBRAK>
复制代码
 楼主| 发表于 2011-3-22 16:23 | 显示全部楼层
回复 2 # tenglang 的帖子

我还有一个程序文件忘了上传  抱歉!!  希望你闲暇时帮我看一下
  1. %######################################################################################################
  2. %######################################################################################################
  3. num=600; %the number of sampling

  4. %############## Simulation time points ##################################
  5. t0=0; %time when IKK is being introduced into the system
  6. tw=6000; %length of IKK stimulation
  7. tau=(tw-t0)/num; %defines the period (in seconds) in between to successive data points

  8. %############### Initial condition for total NF-kB ######################
  9. y0=zeros(1,10); %Initial condition set to zero for each reaction participant
  10. NF=0.9;
  11. EF=1.5e-5;
  12. SF=0.8;
  13. y0(8)=NF; %NF-kB is given in cytoplasm
  14. y0(1)=1.5e-5;
  15. y0(6)=0.8;
  16. Source=1;

  17. %############### Parametrization for system of ODE's ####################
  18. par=zeros(11,1);
  19. par(1,1)=100000;
  20. par(2,1)=1000;
  21. par(3,1)=100;
  22. par(4,1)=10000;
  23. par(5,1)=50000;
  24. par(6,1)=200;
  25. par(7,1)=1000;
  26. par(8,1)=20000;
  27. par(9,1)=5000;
  28. par(10,1)=100;
  29. par(11,1)=500;

  30. %######################################################################################################
  31. %######################################################################################################
复制代码
发表于 2011-3-22 21:17 | 显示全部楼层
这不是前几天的问题又发了个贴...
发表于 2011-3-23 00:10 | 显示全部楼层
怎LZ的帖都是这个样!?:@)
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-9 04:33 , Processed in 0.103486 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表