I would like to change existing values of parameters

2 views (last 30 days)
Hello I am using ode15s to solve my set of differential equations. I want to see graphs with changing the original value of parameter by taking one parameter at a time and all the parameters remain same.

Answers (2)

Smith
Smith on 30 Oct 2016
If you just need to get a graph, this will help you
function plotgraph
y0 = 0:10; % Initial values
for n = 1:length(y0)
% Just copy corresponding codes to here, including complete process to get results T and Y
[T,Y] = solver(odefun,tspan,y0(n),options); % y0(n)
% end of coping
plot(T,Y);hold on
clear T Y
end
hold off

Zamra Sajid
Zamra Sajid on 31 Oct 2016
Here is my code it is taken from three files. Acutually I want to take 50% of one parameter at a time and obtain its figure. It is calculating the value but does not aply it on figure
Parameters2; % loads parameter values from parameters.m pars = [rx ax ry ay dx0 dy0 dx1 dy1 cx cy ea es rs rya ryq rm A k];
% Define parameters
% rx = pars( 1);
% ax = pars( 2); % ry = pars( 3);
% ay = pars( 4);
% dx0 = pars( 5);
% dy0 = pars( 6);
% dx1 = pars( 7);
% dy1 = pars( 8);
% cx = pars( 9);
% cy = pars(10);
% ea = pars(11);
% es = pars(12);
% rs = pars(13);
% rya = pars(14);
% ryq = pars(15);
% rm = pars(16);
% A = pars(17);
% k = pars(18); %Scaling factor
%% Initial values
Init = [x0I, x1I, y0I, y1I, aI, sI, yqI, xmI]; % loads initial values from parameters.m
prompt ='which parameter';
parsv=input(prompt)
p=parsv+(parsv*0.5)
nn=numel(parsv);
% x0I = c(1);
% x1I = c(2);
% y0I = c(3);
% y1I = c(4);
% aI = c(5);
% sI = c(6);
% ydI = c(7);
% xmI = c(8);
%% Solve ODE's the usual way
options = odeset('RelTol',1e-4,'AbsTol',1e-8); % Tolerances
for i=1:nn
v(i)=parsv(i);
p=parsv(i);
[ts, cs] = ode15s(@Cancer_eqs,tspan,Init,options,pars); % Solve ODE's
end
save results.mat ts cs;
%% Figures
Driver_Cancer_Figures
end

Community Treasure Hunt

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

Start Hunting!