Hy
I have a column vector called theRas. It represents the Reduced Adjoint system in an Optimal Control problem. It is a [10 * 1] Column vector. It is of the form theRas(z1, z2, z3, z4, z5, lam1, lam2, lam3, lam4, lam5) =......
It is basically 10 SYMBOLIC differential equation in the form
z1dot = ...
z2dot = ...
.
.
lam5dot = ...
It is really large that's why I'm trying to explain it rather than just post it.
So now Iv not the initial values of all 10 variables and I want to solve it using ode45. This is the function where I'm trying to do that:
function [errorP] = p(lamda1,lamda2,lamda3,lamda4,lamda5)
initValues = [0 0 0 0 0 lamda1 lamda2 lamda3 lamda4 lamda5]
theRas = ras()
[t,xa] = ode45(theRas,[0 3.14],initValues) %this does not work
m = size(t)
z1final = z1(t)
z2final = z2(t)
z3final = z3(t)
z4final = z4(t)
z5final = z5(t)
errorP = (3.14-z1final).^2 + (0-z2final).^2 + (0-z3final).^2 + (0-z4final).^2 + (0-z5final).^2
It gives me the error:
Error in MuPAD command: The operand is invalid. [_mult]
I have a feeling the way I'm defining my function in ode45 is wrong but I don't know how to fix it. Any help would be appreciated.