Solving system of simultanous ODE equations with Multiple Initial conditions
1 view (last 30 days)
I have a system of 3 simultaneous equations (equilibrium reactions). I am trying to solve for the concentrations of three species (CA, CB and CC) which they have multiple initials. So, I have created column vector for each species as shown below
0.00790127173623856;0.198232538062387;3.80176746193761]; %infinite supply of A
CB0=ones(12,1); %local sites (finite)
t=0.1; %longer as possible
[t, y]= ode15s('kinatic3',tspan, [CA0 CB0 CC0], option);
and my functions file
function fnc=kinatic3(t, y)
So I run the file and get this graph which tells me that nothing happened. I am not sure where the problem is located. I am assuming that the functions should be in a vector form, maybe? I really appreciate your help. Thanks in advance.
Alan Stevens on 6 May 2021
You could try something like:
for i = 1:numel(CA0)
[t, y]= ode15s(@kinatic3,tspan, [CA0(i) CB0(i) CC0(i)], option);
However, note that you have
These two are identical. Did you mean them to be?