Hi everyone, I need to write a function to solve this system:
Until now all I can came up with was:
function dz = control1(v,z,parameters)% gammaT=parameters(1);
phi_0=parameters(2);psi_0=parameters(3);psi_c0=parameters(4);B=parameters(5);Lc=parameters(6);W=parameters(7);H=parameters(8);C = 0;gammaT_max = 0.9;gammaT_min = 0.61;A = (gammaT_max - gammaT_min)/2; %amplitude
b = gammaT_max - ((gammaT_max - gammaT_min)/2);hertz = 50;w=hertz*2*pi;gammaT = @(t) A*sin(w*t)+b dz = zeros(2,1);dz(1)=(1/(4*B*B*Lc))*(z(2)-gammaT(v)*(z(1))^0.5);psi_c=psi_c0+H*(1+1.5*(z(2)/W-1)-0.5*(z(2)/W-1).^3);dz(2) =(1/Lc)*(psi_c-z(1)); end
which is obviously wrong since gammaT = @(t) A*sin(w*t)+b shoouldn't be define this way.
I think gammaT should be written in that way but the time in the argument of the sin should be rearranged in some way I don't know
Best Answer