MATLAB: System of differential equations

differential equations

Hi to all! I am a beginner with Matlab, i would need to solve this set of differential equations.
eq1.jpg
eq2.jpg
eq3.jpg
eq4.jpg
My parameters are:
gamma=1.3; alfa=0.2;
beta=1.5; Tw=1.2;
C0=0.8; wge=200;
tetaS=-40; tetaD=40;
rc=10;
My initials conditions are: P=1; W=0; Qloss=0; m=1.
Thank you all!

Best Answer

Hi,
in this lines you use x (which is a vector with 6 elements) instead of x(i) - which is a scalar:
xdot(5)=(sin(x)*(1/rc-1/2))/rc;
xdot(6)=-4*exp(-((tetaS-x)/tetaD)*((tetaS-x)^3/(tetaD)^4));
Correct ist to whatever correct is - for example:
sin(x(1))*...
so that you calculate a scalar not a vector. In the lines for xdot(1)...xdot(4) you did it properly.
Best regards
Stephan