merging two ode graphs

3 views (last 30 days)
Susmita Panda
Susmita Panda on 6 May 2021
Commented: Susmita Panda on 16 May 2021
I tried to merge two ode function but getting an error. The first ode ranges upto T and thereafter I want result of other ode.

Accepted Answer

Alan Stevens
Alan Stevens on 8 May 2021
Your testode2 function must return a column vector. Try
function dy = testode2(~,y) %%% Must return a column vector
j=1;beta=0.025;k=j^4;c=2*j^2*beta;m=1;
f=zeros(2,1);
dy = [y(2);
(-k*y(1)/m-c*y(2)/m)];
end
  4 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!