% initn.m % Used to enter RHS and necessary information for 1st order ODEs that % will be solved via Euler's Method and/or RK4. Needed by EULPLOT.M % RK4PLOT.M, NUMPLOT.M N=20; ftx='2*t*x'; % Enter ODE as string variable; e.g., '2*t*x' eulerfcn='x+h*(2*t*x)'; % RHS for Euler's method hvec=[.5,.25,.1,.01]; % Vector of step sizes to investigate %hvec=10; [minh,minhindex]=min(hvec); % ID of min step size and location in hvec t0=-2; tf=2; x0=1; % Initial values/conditions t=tf; x=x0; h=max(hvec); % Initializations to determine starting initax xmin=min([x0,eval(eulerfcn)]); xmax=max([x0,eval(eulerfcn)]); initax=[t0,tf,xmin,xmax]; % To set reasonable starting window ax=initax;