Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Applying higher value of input parameter for some interval input variable in ODE.

1 visualización (últimos 30 días)
Dharma
Dharma el 10 de Abr. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
N=10;
k=zeros(N,1);
r=zeros(N,1);
t=zeros(N,1);
k1=1;k(1)=1;t(1)=0;dt=0.05;
for i=2:N
t(i)=t(i-1)+dt;
k(i)=k1;
r(i)=r(i-1)*dt+k(i);
if r(i)<5
% I want to apply higher value of k i.e. k1+1 for some
% interval of time before and after t(i) at which r(i) is equal to 0.5.
% For example if t(i)=10 for r(i)=0.5, then
% I want to use higher value of k in the time range of 5 to 15.
k(i)=k1+1;
r(i)=r(i-1)*dt+k(i);
end
end
plot(t,r)

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by