how to solve this error? and why there is error?

A11 = diff(A1,1)
A12 = diff(A1,2)
A21 = diff(A2,1)
A22 = diff(A2,2)
S2 = diff(S,2)
X2 = diff(x,2)
Eq1 = X2 == (14.344*A1)- (((3*0.3)+(-1.6)+(21*0.3)))/(((21+0.5))*A12 -(((3*0.5)/(21+3))*A22));
Eq2 = Cl == ((((0.5*0.106)*(21+3))+(((0.42*(0.106^2))+1.5)/0.106))*X2)+(((0.44*((0.42*(0.106^2))+0.42))/2*0.106)*S2)+((0.5*0.106*0.3*(21+3))*A11)+(0.5*3*0.106*0.5*A22);
Eq3 = Cr == ((((0.5*0.106)*(21+3))+(((0.42*(0.106^2))+1.5)/0.106))*X2)-(((0.44*((0.42*(0.106^2))+0.42))/2*0.106)*S2)+((0.5*0.106*0.3*(21+3))*A11)+(0.5*3*0.106*0.5*A22);
Eq4 = S2 == (Cl-((((0.5*1.06)*(21+3))+(((0.42*(1.06^2))+1.5)/1.06))*X2)-((0.5*1.06*0.3*(21+3))*A11)-(0.5*3*1.06*0.5*A22))/(((0.44*((0.42*(1.06^2))+1.5))/2*1.06));
Eq5 = X2 == (-0.552*A2) - (2*0.3*A12) - ((((3*(0.5)^2)+10.66)/(3*0.5))*A22);
Eq6 = A12 == (-56.419*A1)-(((2*0.3*(21+3))/((4*3*(0.3^2))-1.6+(21*(0.3^2))))*X2)-(((2*3*0.3*0.5)/((4*3*(0.3^2))-1.6+(21*(0.3^2))))*A22);
Eq7 = A12 == (0.579*A2)-((1/(2*0.3))*X2)-((((3*(0.5^2))+10.66)/(2*3*0.3*0.5))*A22);
Eq8 = A22 == (29.262*A1)-(((2*0.3*(21+3))/(2*3*0.3*0.5))*X2)-((((0.3*3*(0.3^2))-1.6+(21*(0.3^2)))/(2*3*0.3*0.5))*A12);
Eq9 = A22 == (6.466*A1)-(((3*0.5)/((3*(0.5^2))+10.66))*X2)-((((0.3*3*(0.3^2))-1.6+(21*(0.3^2)))/(2*3*0.3*0.5))*A12);
Eq10 = S2 == (Cr-((((0.5*1.06)*(21+3))+(((0.42*(1.06^2))+1.5)/1.06))*X2)-((0.5*1.06*0.3*(21+3))*A11)-(0.5*3*1.06*0.5*A22))/-((((2*1.06)/(0.44*((0.42*(1.06^2))+1.5)))));
[VF,Sbs] = odeToVectorField(Eq1,Eq2,Eq3,Eq4,Eq5,Eq5,Eq6,Eq7,Eq8,Eq9,Eq10)
coupled_vanderpol = matlabFunction(VF, 'Vars',{T,Y})
%x0 x. A1 A1. A2 A2. S S.
t0 = [-0.1,0,0,0.03,0,0,0];
tspan = [0,10];
[t,v_z] = ode45(@(T,Y)coupled_vanderpol(T,Y),tspan,t0);
figure
plot(t, v_z)
grid

1 Comment

Minor detail - you forget to say what the error is. Please copy/paste the entire error message (all the red text) here.
And you haven't defined A1, so we can't even run the code you shared.

Sign in to comment.

Answers (0)

Categories

Asked:

on 4 Jan 2021

Edited:

on 5 Jan 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!