Hello all,
I used the same method. However I can not multiply my cell array of coefficients (AB) into the cell array of symbolic functions (T, Tm). In the following is the abstract of my code:
T=cell(4*n,1);
Tm=cell(6*n,1);
AB=cell(4*n,6*n);
GF=cell(4*n,1);
for i=1:n
AB, Tm an GF (using your comments) and the relation between them are defined here
end
odes=diff(T)==AB*Tm+GF
or
(odes=diff(T)==AB.*Tm+GF;)
errors:
Undefined operator '*' for input arguments of type 'cell'.
(Undefined operator '.*' for input arguments of type 'cell'.)
Also I tried to use matrix instead as follow:
T=sym(zeros(4*n,1));
Tm=sym(zeros(6*n,1));
for i=1:n
AB, Tm an GF using your comments as matrices and the relation between them are defined here
end
odes=diff(T)==AB*Tm+GF;
[VF,Subs] = odeToVectorField(odes);
Sys = matlabFunction(VF,'Vars',{'t','Y'});
Y0(1:4*n,1)=14.7;
[T,Y] = ode45(Sys, [0 5], Y0);
and here is the error:
Error using mupadengine/feval (line 163)
Cannot convert the initial value problem to an equivalent dynamical system. Either the differential equations cannot be solved for the highest derivatives or
inappropriate initial conditions were specified.
Error in odeToVectorField>mupadOdeToVectorField (line 177)
T = feval(symengine,'symobj::odeToVectorField',sys,x,stringInput);
Error in odeToVectorField (line 126)
sol = mupadOdeToVectorField(varargin);
Error in Fb1 (line 154)
[VF,Subs] = odeToVectorField(odes);
Thanks in advance for your reply!