필터 지우기
필터 지우기

iterating over an ode solver

조회 수: 2 (최근 30일)
Romio
Romio 2019년 4월 1일
댓글: Star Strider 2019년 4월 1일
Hi there,
I am writing a program to solve an ode system multiple times with different parameter values. I added the two parameters decay and peak to the ode function Full_Model, and created a loop over the ode solver.
However, when I store the responses in a 3d matrix, STORE, I get the same results. In other words, X = Y = Z
I think I am missing some kind an index to allow the storage of the new response but could not find it
here is my script (don't worry about other parameters, they already have been defined)
Thanks in advance.
options = odeset('AbsTol', 10^-6, 'RelTol', 10^-6, 'MaxStep', 0.1);
peak =0.1:0.1:0.3;
decay =0.1:0.1:0.3;
STORE = zeros(30001,4,length(peak));
for i = 1:length(peak)
for j = 1:length(decay)
[sim_t,response] = ode15s(@Full_Model, t, init_cond, options,peak(i),decay(j));
STORE(:,:,i)= response;
end
end
X=STORE(:,:,1);
Y=STORE(:,:,2);
Z=STORE(:,:,3);
  댓글 수: 1
Star Strider
Star Strider 2019년 4월 1일
You are apparently not passing your parameters to your functions. See the documentation on Parameterizing Functions (link).

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by