Clear Filters
Clear Filters

Help in calculating the error.

2 views (last 30 days)
Haya Ali
Haya Ali on 18 May 2023
Answered: Steven Lord on 18 May 2023
I want to plot Error a Vs Data. where,
and graph should be in a decreasing trend like this
but I am getting graph like this.
Please help me to spot error in the code. Below is my code
clear all; close all; clc;
% value of constants%
G = 10;
dt = 0.01; % step size
%Oscillator 1%
a1=0.7; omega1=20; C1_2 =0; C1_3 =0; C1_4 =0.00101; C1_5 =0; C1_6 =0; C1_7 =0.00102; C1_8 =0; C1_9 =0; C1_10 =0; C1_11 =0; C1_12 =0.00103; C1_13 =0; C1_14 =0; C1_15 =0; C1_16 =0; C1_17 =0.00104; C1_18 =0; C1_19 =0; C1_20 =0;
%Oscillator 2%
a2 = 0.1; omega2 = 40; C2_1 =0.003; C2_3 =0; C2_4 =0.0031; C2_5 =0; C2_6 =0; C2_7 =0; C2_8 =0.0032; C2_9 =0; C2_10 =0; C2_11 =0; C2_12 =0.0033; C2_13 =0; C2_14 =0; C2_15 =0; C2_16 =0.0034; C2_17 =0; C2_18 =0; C2_19 =0; C2_20 =0.0035;
%Oscillator 3%
a3 = 0.8; omega3 = 30; C3_1 =0; C3_2 =0; C3_4 =0.0086; C3_5 =0.008; C3_6 =0; C3_7 =0; C3_8 =0.0081; C3_9 =0; C3_10 =0; C3_11 =0; C3_12 =0; C3_13 =0; C3_14 =0.0083; C3_15 =0; C3_16 =0; C3_17 =0.0084; C3_18 =0; C3_19 =0; C3_20 =0;
%Oscillator 4%
a4 = 0.5; omega4 = 60; C4_1 =0.005; C4_2 =0; C4_3 =0.0055; C4_5 =0; C4_6 =0; C4_7 =0; C4_8 =0; C4_9 =0.0051; C4_10 =0; C4_11 =0; C4_12 =0; C4_13 =0.0052; C4_14 =0; C4_15 =0; C4_16 =0; C4_17 =0.0053; C4_18 =0; C4_19 =0; C4_20 =0;
%Oscillator 5%
a5 = 0.6; omega5 = 80; C5_1 =0.006; C5_2 =0; C5_3 =0.0065; C5_4 =0; C5_6 =0; C5_7 =0; C5_8 =0; C5_9 =0; C5_10 =0; C5_11 =0.0062; C5_12 =0; C5_13 =0; C5_14 =0; C5_15 =0.0063; C5_16 =0; C5_17 =0; C5_18 =0; C5_19 =0.0064; C5_20 =0;
%Oscillator 6%
a6 = 0.1; omega6 = 50; C6_1 =0.01; C6_2 =0; C6_3 =0.015; C6_4 =0; C6_5 =0; C6_7 =0; C6_8 =0; C6_9 =0.012; C6_10 =0; C6_11 =0; C6_12 =0; C6_13 =0; C6_14 =0; C6_15 =0; C6_16 =0; C6_17 =0.013; C6_18 =0; C6_19 =0; C6_20 =0;
%Oscillator 7%
a7 = 0.5; omega7 = 20; C7_1 =0; C7_2 =0; C7_3 =0.0045; C7_4 =0.004; C7_5 =0; C7_6 =0; C7_8 =0; C7_9 =0.0042; C7_10 =0; C7_11 =0; C7_12 =0; C7_13 =0; C7_14 =0; C7_15 =0.0043; C7_16 =0; C7_17 =0; C7_18 =0; C7_19 =0.0044; C7_20 =0;
%Oscillator 8%
a8 = 0.2; omega8 = 70; C8_1 =0.002; C8_2 =0; C8_3 =0.0021; C8_4 =0; C8_5 =0; C8_6 =0; C8_7 =0; C8_9 =0; C8_10 =0.0021; C8_11 =0; C8_12 =0; C8_13 =0; C8_14 =0; C8_15 =0; C8_16 =0.0022; C8_17 =0; C8_18 =0; C8_19 =0; C8_20 =0.0023;
%Oscillator 9%
a9 = 0.7; omega9 = 60; C9_1 =0; C9_2 =0; C9_3 =0.0075; C9_4 =0; C9_5 =0.007; C9_6 =0; C9_7 =0; C9_8 =0; C9_10 =0.0071; C9_11 =0; C9_12 =0; C9_13 =0; C9_14 =0; C9_15 =0; C9_16 =0.0072; C9_17 =0; C9_18 =0.0073; C9_19 =0; C9_20 =0;
%Oscillator 10%
a10 = 0.3; omega10 = 50; C10_1 =0; C10_2 =0.009; C10_3 =0.0095; C10_4 =0; C10_5 =0; C10_6 =0; C10_7 =0; C10_8 =0.0091; C10_9 =0; C10_11 =0; C10_12 =0; C10_13 =0; C10_14 =0.0092; C10_15 =0; C10_16 =0; C10_17 =0; C10_18 =0.0093; C10_19 =0.0094; C10_20 =0;
%Oscillator 11%
a11 = 0.20; omega11 = 20; C11_1 =0.020; C11_2 =0; C11_3 =0.0205; C11_4 =0; C11_5 =0; C11_6 =0; C11_7 =0.0201; C11_8 =0; C11_9 =0; C11_10 =0; C11_12 =0; C11_13 =0; C11_14 =0; C11_15 =0; C11_16 =0; C11_17 =0.0202; C11_18 =0; C11_19 =0.0203; C11_20 =0;
%Oscillator 12%
a12 = 0.13; omega12 = 90; C12_1 =0.013; C12_2 =0; C12_3 =0.01315; C12_4 =0; C12_5 =0; C12_6 =0; C12_7 =0.0131; C12_8 =0; C12_9 =0; C12_10 =0; C12_11 =0; C12_13 =0; C12_14 =0; C12_15 =0.0132; C12_16 =0; C12_17 =0; C12_18 =0.0133; C12_19 =0; C12_20 =0;
%Oscillator 13%
a13 = 0.18; omega13 = 40; C13_1 =0; C13_2 =0; C13_3 =0.0185; C13_4 =0; C13_5 =0; C13_6 =0.018; C13_7 =0; C13_8 =0; C13_9 =0.0181; C13_10 =0; C13_11 =0; C13_12 =0; C13_14 =0; C13_15 =0.0182; C13_16 =0; C13_17 =0; C13_18 =0; C13_19 =0.0183; C13_20 =0;
%Oscillator 14%
a14 = 0.23; omega14 = 30; C14_1 =0.023; C14_2 =0; C14_3 =0.0235; C14_4 =0; C14_5 =0; C14_6 =0; C14_7 =0.0231; C14_8 =0; C14_9 =0; C14_10 =0.0232; C14_11 =0; C14_12 =0; C14_13 =0; C14_15 =0; C14_16 =0.0233; C14_17 =0; C14_18 =0; C14_19 =0; C14_20 =0.0234;
%Oscillator 15%
a15 = 0.22; omega15 = 60; C15_1 =0; C15_2 =0.022; C15_3 =0.0225; C15_4 =0; C15_5 =0; C15_6 =0; C15_7 =0; C15_8 =0.0221; C15_9 =0; C15_10 =0; C15_11 =0; C15_12 =0; C15_13 =0.0222; C15_14 =0; C15_16 =0; C15_17 =0; C15_18 =0.0223; C15_19 =0; C15_20 =0.0224;
%Oscillator 16%
a16 = 0.11; omega16 = 50; C16_1 =0; C16_2 =0.011; C16_3 =0.01115; C16_4 =0; C16_5 =0; C16_6 =0; C16_7 =0; C16_8 =0; C16_9 =0.0111; C16_10 =0; C16_11 =0; C16_12 =0; C16_13 =0; C16_14 =0.0112; C16_15 =0; C16_17 =0; C16_18 =0; C16_19 =0.0113; C16_20 =0;
%Oscillator 17%
a17 = 0.14; omega17 = 80; C17_1 =0.014; C17_2 =0; C17_3 =0.0145; C17_4 =0; C17_5 =0; C17_6 =0; C17_7 =0; C17_8 =0; C17_9=0.0141; C17_10 =0; C17_11 =0; C17_12 =0; C17_13 =0.0142; C17_14 =0; C17_15 =0; C17_16 =0; C17_18 =0; C17_19 =0.0143; C17_20 =0;
%Oscillator 18%
a18 = 0.21; omega18 = 70; C18_1 =0.021; C18_2 =0.0211; C18_3 =0.0215; C18_4 =0; C18_5 =0; C18_6 =0; C18_7 =0; C18_8 =0; C18_9 =0; C18_10 =0.0212; C18_11 =0; C18_12 =0; C18_13 =0; C18_14 =0; C18_15 =0; C18_16 =0.0213; C18_17 =0; C18_19 =0; C18_20 =0.0214;
%Oscillator 19%
a19 = 0.17; omega19 = 30; C19_1 =0; C19_2 =0.017; C19_3 =0.0175; C19_4 =0; C19_5 =0; C19_6 =0; C19_7 =0; C19_8 =0.0171; C19_9 =0; C19_10 =0; C19_11 =0.0172; C19_12 =0; C19_13 =0; C19_14 =0; C19_15 =0; C19_16 =0; C19_17 =0.0173; C19_18 =0; C19_20 =0;
%Oscillator 20%
a20 = 0.19; omega20 = 90; C20_1 =0; C20_2 =0; C20_3 =0.01915; C20_4 =0; C20_5 =0; C20_6 =0.0191; C20_7 =0; C20_8 =0; C20_9 =0; C20_10 =0; C20_11 =0; C20_12 =0.0192; C20_13 =0; C20_14 =0; C20_15 =0; C20_16 =0.0193; C20_17 =0; C20_18 =0.0194; C20_19 =0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
x1(1) = 0.5; y1(1) = 0.5; x2(1) = 0.5; y2(1) = 0.5; x3(1) = 0.5; y3(1) = 0.5; x4(1) = 0.5; y4(1) = 0.5; x5(1) = 0.5; y5(1) = 0.5; x6(1) = 0.5; y6(1) = 0.5; x7(1) = 0.5; y7(1) = 0.5; x8(1) = 0.5; y8(1) = 0.5; x9(1) = 0.5; y9(1) = 0.5; x10(1) = 0.5; y10(1) = 0.5; x11(1) = 0.5; y11(1) = 0.5; x12(1) = 0.5; y12(1) = 0.5; x13(1) = 0.5; y13(1) = 0.5; x14(1) = 0.5; y14(1) = 0.5; x15(1) = 0.5; y15(1) = 0.5; x16(1) = 0.5; y16(1) = 0.5; x17(1) = 0.5; y17(1) = 0.5; x18(1) = 0.5; y18(1) = 0.5; x19(1) = 0.5; y19(1) = 0.5; x20(1) = 0.5; y20(1) = 0.5;
for i = 2:1000
%Oscillator 1
x1(i) = x1(i-1) + ( ( a1 - x1(i-1)^2 - y1(i-1)^2 )*x1(i-1) - omega1*y1(i-1) + G*C1_2*( x2(i-1) - x1(i-1) ) + G*C1_3*( x3(i-1) - x1(i-1) ) + G*C1_4*( x4(i-1) - x1(i-1) ) + G*C1_5*( x5(i-1) - x1(i-1) ) + G*C1_6*( x6(i-1) - x1(i-1) ) + G*C1_7*( x7(i-1) - x1(i-1) ) + G*C1_8*( x8(i-1) - x1(i-1) ) + G*C1_9*( x9(i-1) - x1(i-1) ) + G*C1_10*( x10(i-1) - x1(i-1) ) + G*C1_11*( x11(i-1) - x1(i-1) ) + G*C1_12*( x12(i-1) - x1(i-1) ) + G*C1_13*( x13(i-1) - x1(i-1) ) + G*C1_14*( x14(i-1) - x1(i-1) ) + G*C1_15*( x15(i-1) - x1(i-1) ) + G*C1_16*( x16(i-1) - x1(i-1) ) + G*C1_17*( x17(i-1) - x1(i-1) ) + G*C1_18*( x18(i-1) - x1(i-1) ) + G*C1_19*( x19(i-1) - x1(i-1) ) + G*C1_20*( x20(i-1) - x1(i-1) ) )*dt;
y1(i) = y1(i-1) + ( ( a1 - x1(i-1)^2 - y1(i-1)^2 )*y1(i-1) + omega1*x1(i-1) + G*C1_2*( y2(i-1) - y1(i-1) ) + G*C1_3*( y3(i-1) - y1(i-1) ) + G*C1_4*( y4(i-1) - y1(i-1) ) + G*C1_5*( y5(i-1) - y1(i-1) ) + G*C1_6*( y6(i-1) - y1(i-1) ) + G*C1_7*( y7(i-1) - y1(i-1) ) + G*C1_8*( y8(i-1) - y1(i-1) ) + G*C1_9*( y9(i-1) - y1(i-1) ) + G*C1_10*( y10(i-1) - y1(i-1) ) + G*C1_11*( y11(i-1) - y1(i-1) ) + G*C1_12*( y12(i-1) - y1(i-1) ) + G*C1_13*( y13(i-1) - y1(i-1) ) + G*C1_14*( y14(i-1) - y1(i-1) ) + G*C1_15*( y15(i-1) - y1(i-1) ) + G*C1_16*( y16(i-1) - y1(i-1) ) + G*C1_17*( y17(i-1) - y1(i-1) ) + G*C1_18*( y18(i-1) - y1(i-1) ) + G*C1_19*( y19(i-1) - y1(i-1) ) + G*C1_20*( y20(i-1) - y1(i-1) ) )*dt;
%Oscillator 2
x2(i) = x2(i-1) + ( ( a2 - x2(i-1)^2 - y2(i-1)^2 )*x2(i-1) - omega2*y2(i-1) + G*C2_1*( x1(i-1) - x2(i-1) ) + G*C2_3*( x3(i-1) - x2(i-1) ) + G*C2_4*( x4(i-1) - x2(i-1) ) + G*C2_5*( x5(i-1) - x2(i-1) ) + G*C2_6*( x6(i-1) - x2(i-1) ) + G*C2_7*( x7(i-1) - x2(i-1) ) + G*C2_8*( x8(i-1) - x2(i-1) ) + G*C2_9*( x9(i-1) - x2(i-1) ) + G*C2_10*( x10(i-1) - x2(i-1) ) + G*C2_11*( x11(i-1) - x2(i-1) ) + G*C2_12*( x12(i-1) - x2(i-1) ) + G*C2_13*( x13(i-1) - x2(i-1) ) + G*C2_14*( x14(i-1) - x2(i-1) ) + G*C2_15*( x15(i-1) - x2(i-1) ) + G*C2_16*( x16(i-1) - x2(i-1) ) + G*C2_17*( x17(i-1) - x2(i-1) ) + G*C2_18*( x18(i-1) - x2(i-1) ) + G*C2_19*( x19(i-1) - x2(i-1) ) + G*C2_20*( x20(i-1) - x2(i-1) ) )*dt;
y2(i) = y2(i-1) + ( ( a2 - x2(i-1)^2 - y2(i-1)^2 )*y2(i-1) + omega2*x2(i-1) + G*C2_1*( y1(i-1) - y2(i-1) ) + G*C2_3*( y3(i-1) - y2(i-1) ) + G*C2_4*( y4(i-1) - y2(i-1) ) + G*C2_5*( y5(i-1) - y2(i-1) ) + G*C2_6*( y6(i-1) - y2(i-1) ) + G*C2_7*( y7(i-1) - y2(i-1) ) + G*C2_8*( y8(i-1) - y2(i-1) ) + G*C2_9*( y9(i-1) - y2(i-1) ) + G*C2_10*( y10(i-1) - y2(i-1) ) + G*C2_11*( y11(i-1) - y2(i-1) ) + G*C2_12*( y12(i-1) - y2(i-1) ) + G*C2_13*( y13(i-1) - y2(i-1) ) + G*C2_14*( y14(i-1) - y2(i-1) ) + G*C2_15*( y15(i-1) - y2(i-1) ) + G*C2_16*( y16(i-1) - y2(i-1) ) + G*C2_17*( y17(i-1) - y2(i-1) ) + G*C2_18*( y18(i-1) - y2(i-1) ) + G*C2_19*( y19(i-1) - y2(i-1) ) + G*C2_20*( y20(i-1) - y2(i-1) ) )*dt;
%Oscillator 3
x3(i) = x3(i-1) + ( ( a3 - x3(i-1)^2 - y3(i-1)^2 )*x3(i-1) - omega3*y3(i-1) + G*C3_1*( x1(i-1) - x3(i-1) ) + G*C3_2*( x2(i-1) - x3(i-1) ) + G*C3_4*( x4(i-1) - x3(i-1) ) + G*C3_5*( x5(i-1) - x3(i-1) ) + G*C3_6*( x6(i-1) - x3(i-1) ) + G*C3_7*( x7(i-1) - x3(i-1) ) + G*C3_8*( x8(i-1) - x3(i-1) ) + G*C3_9*( x9(i-1) - x3(i-1) ) + G*C3_10*( x10(i-1) - x3(i-1) ) + G*C3_11*( x11(i-1) - x3(i-1) ) + G*C3_12*( x12(i-1) - x3(i-1) ) + G*C3_13*( x13(i-1) - x3(i-1) ) + G*C3_14*( x14(i-1) - x3(i-1) ) + G*C3_15*( x15(i-1) - x3(i-1) ) + G*C3_16*( x16(i-1) - x3(i-1) ) + G*C3_17*( x17(i-1) - x3(i-1) ) + G*C3_18*( x18(i-1) - x3(i-1) ) + G*C3_19*( x19(i-1) - x3(i-1) ) + G*C3_20*( x20(i-1) - x3(i-1) ) )*dt;
y3(i) = y3(i-1) + ( ( a3 - x3(i-1)^2 - y3(i-1)^2 )*y3(i-1) + omega3*x3(i-1) + G*C3_1*( y1(i-1) - y3(i-1) ) + G*C3_2*( y2(i-1) - y3(i-1) ) + G*C3_4*( y4(i-1) - y3(i-1) ) + G*C3_5*( y5(i-1) - y3(i-1) ) + G*C3_6*( y6(i-1) - y3(i-1) ) + G*C3_7*( y7(i-1) - y3(i-1) ) + G*C3_8*( y8(i-1) - y3(i-1) ) + G*C3_9*( y9(i-1) - y3(i-1) ) + G*C3_10*( y10(i-1) - y3(i-1) ) + G*C3_11*( y11(i-1) - y3(i-1) ) + G*C3_12*( y12(i-1) - y3(i-1) ) + G*C3_13*( y13(i-1) - y3(i-1) ) + G*C3_14*( y14(i-1) - y3(i-1) ) + G*C3_15*( y15(i-1) - y3(i-1) ) + G*C3_16*( y16(i-1) - y3(i-1) ) + G*C3_17*( y17(i-1) - y3(i-1) ) + G*C3_18*( y18(i-1) - y3(i-1) ) + G*C3_19*( y19(i-1) - y3(i-1) ) + G*C3_20*( y20(i-1) - y3(i-1) ) )*dt;
%Oscillator 4
x4(i) = x4(i-1) + ( ( a4 - x4(i-1)^2 - y4(i-1)^2 )*x4(i-1) - omega4*y4(i-1) + G*C4_1*( x1(i-1) - x4(i-1) ) + G*C4_2*( x2(i-1) - x4(i-1) ) + G*C4_3*( x3(i-1) - x4(i-1) ) + G*C4_5*( x5(i-1) - x4(i-1) ) + G*C4_6*( x6(i-1) - x4(i-1) ) + G*C4_7*( x7(i-1) - x4(i-1) ) + G*C4_8*( x8(i-1) - x4(i-1) ) + G*C4_9*( x9(i-1) - x4(i-1) ) + G*C4_10*( x10(i-1) - x4(i-1) ) + G*C4_11*( x11(i-1) - x4(i-1) ) + G*C4_12*( x12(i-1) - x4(i-1) ) + G*C4_13*( x13(i-1) - x4(i-1) ) + G*C4_14*( x14(i-1) - x4(i-1) ) + G*C4_15*( x15(i-1) - x4(i-1) ) + G*C4_16*( x16(i-1) - x4(i-1) ) + G*C4_17*( x17(i-1) - x4(i-1) ) + G*C4_18*( x18(i-1) - x4(i-1) ) + G*C4_19*( x19(i-1) - x4(i-1) ) + G*C4_20*( x20(i-1) - x4(i-1) ) )*dt;
y4(i) = y4(i-1) + ( ( a4 - x4(i-1)^2 - y4(i-1)^2 )*y4(i-1) + omega4*x4(i-1) + G*C4_1*( y1(i-1) - y4(i-1) ) + G*C4_2*( y2(i-1) - y4(i-1) ) + G*C4_3*( y3(i-1) - y4(i-1) ) + G*C4_5*( y5(i-1) - y4(i-1) ) + G*C4_6*( y6(i-1) - y4(i-1) ) + G*C4_7*( y7(i-1) - y4(i-1) ) + G*C4_8*( y8(i-1) - y4(i-1) ) + G*C4_9*( y9(i-1) - y4(i-1) ) + G*C4_10*( y10(i-1) - y4(i-1) ) + G*C4_11*( y11(i-1) - y4(i-1) ) + G*C4_12*( y12(i-1) - y4(i-1) ) + G*C4_13*( y13(i-1) - y4(i-1) ) + G*C4_14*( y14(i-1) - y4(i-1) ) + G*C4_15*( y15(i-1) - y4(i-1) ) + G*C4_16*( y16(i-1) - y4(i-1) ) + G*C4_17*( y17(i-1) - y4(i-1) ) + G*C4_18*( y18(i-1) - y4(i-1) ) + G*C4_19*( y19(i-1) - y4(i-1) ) + G*C4_20*( y20(i-1) - y4(i-1) ) )*dt;
%Oscillator 5
x5(i) = x5(i-1) + ( ( a5 - x5(i-1)^2 - y5(i-1)^2 )*x5(i-1) - omega5*y5(i-1) + G*C5_1*( x1(i-1) - x5(i-1) ) + G*C5_2*( x2(i-1) - x5(i-1) ) + G*C5_3*( x3(i-1) - x5(i-1) ) + G*C5_4*( x4(i-1) - x5(i-1) ) + G*C5_6*( x6(i-1) - x5(i-1) ) + G*C5_7*( x7(i-1) - x5(i-1) ) + G*C5_8*( x8(i-1) - x5(i-1) ) + G*C5_9*( x9(i-1) - x5(i-1) ) + G*C5_10*( x10(i-1) - x5(i-1) ) + G*C5_11*( x11(i-1) - x5(i-1) ) + G*C5_12*( x12(i-1) - x5(i-1) ) + G*C5_13*( x13(i-1) - x5(i-1) ) + G*C5_14*( x14(i-1) - x5(i-1) ) + G*C5_15*( x15(i-1) - x5(i-1) ) + G*C5_16*( x16(i-1) - x5(i-1) ) + G*C5_17*( x17(i-1) - x5(i-1) ) + G*C5_18*( x18(i-1) - x5(i-1) ) + G*C5_19*( x19(i-1) - x5(i-1) ) + G*C5_20*( x20(i-1) - x5(i-1) ) )*dt;
y5(i) = y5(i-1) + ( ( a5 - x5(i-1)^2 - y5(i-1)^2 )*y5(i-1) + omega5*x5(i-1) + G*C5_1*( y1(i-1) - y5(i-1) ) + G*C5_2*( y2(i-1) - y5(i-1) ) + G*C5_3*( y3(i-1) - y5(i-1) ) + G*C5_4*( y4(i-1) - y5(i-1) ) + G*C5_6*( y6(i-1) - y5(i-1) ) + G*C5_7*( y7(i-1) - y5(i-1) ) + G*C5_8*( y8(i-1) - y5(i-1) ) + G*C5_9*( y9(i-1) - y5(i-1) ) + G*C5_10*( y10(i-1) - y5(i-1) ) + G*C5_11*( y11(i-1) - y5(i-1) ) + G*C5_12*( y12(i-1) - y5(i-1) ) + G*C5_13*( y13(i-1) - y5(i-1) ) + G*C5_14*( y14(i-1) - y5(i-1) ) + G*C5_15*( y15(i-1) - y5(i-1) ) + G*C5_16*( y16(i-1) - y5(i-1) ) + G*C5_17*( y17(i-1) - y5(i-1) ) + G*C5_18*( y18(i-1) - y5(i-1) ) + G*C5_19*( y19(i-1) - y5(i-1) ) + G*C5_20*( y20(i-1) - y5(i-1) ) )*dt;
%Oscillator 6
x6(i) = x6(i-1) + ( ( a6 - x6(i-1)^2 - y6(i-1)^2 )*x6(i-1) - omega6*y6(i-1) + G*C6_1*( x1(i-1) - x6(i-1) ) + G*C6_2*( x2(i-1) - x6(i-1) ) + G*C6_3*( x3(i-1) - x6(i-1) ) + G*C6_4*( x4(i-1) - x6(i-1) ) + G*C6_5*( x5(i-1) - x6(i-1) ) + G*C6_7*( x7(i-1) - x6(i-1) ) + G*C6_8*( x8(i-1) - x6(i-1) ) + G*C6_9*( x9(i-1) - x6(i-1) ) + G*C6_10*( x10(i-1) - x6(i-1) ) + G*C6_11*( x11(i-1) - x6(i-1) ) + G*C6_12*( x12(i-1) - x6(i-1) ) + G*C6_13*( x13(i-1) - x6(i-1) ) + G*C6_14*( x14(i-1) - x6(i-1) ) + G*C6_15*( x15(i-1) - x6(i-1) ) + G*C6_16*( x16(i-1) - x6(i-1) ) + G*C6_17*( x17(i-1) - x6(i-1) ) + G*C6_18*( x18(i-1) - x6(i-1) ) + G*C6_19*( x19(i-1) - x6(i-1) ) + G*C6_20*( x20(i-1) - x6(i-1) ) )*dt;
y6(i) = y6(i-1) + ( ( a6 - x6(i-1)^2 - y6(i-1)^2 )*y6(i-1) + omega6*x6(i-1) + G*C6_1*( y1(i-1) - y6(i-1) ) + G*C6_2*( y2(i-1) - y6(i-1) ) + G*C6_3*( y3(i-1) - y6(i-1) ) + G*C6_4*( y4(i-1) - y6(i-1) ) + G*C6_5*( y5(i-1) - y6(i-1) ) + G*C6_7*( y7(i-1) - y6(i-1) ) + G*C6_8*( y8(i-1) - y6(i-1) ) + G*C6_9*( y9(i-1) - y6(i-1) ) + G*C6_10*( y10(i-1) - y6(i-1) ) + G*C6_11*( y11(i-1) - y6(i-1) ) + G*C6_12*( y12(i-1) - y6(i-1) ) + G*C6_13*( y13(i-1) - y6(i-1) ) + G*C6_14*( y14(i-1) - y6(i-1) ) + G*C6_15*( y15(i-1) - y6(i-1) ) + G*C6_16*( y16(i-1) - y6(i-1) ) + G*C6_17*( y17(i-1) - y6(i-1) ) + G*C6_18*( y18(i-1) - y6(i-1) ) + G*C6_19*( y19(i-1) - y6(i-1) ) + G*C6_20*( y20(i-1) - y6(i-1) ) )*dt;
%Oscillator 7
x7(i) = x7(i-1) + ( ( a7 - x7(i-1)^2 - y7(i-1)^2 )*x7(i-1) - omega7*y7(i-1) + G*C7_1*( x1(i-1) - x7(i-1) ) + G*C7_2*( x2(i-1) - x7(i-1) ) + G*C7_3*( x3(i-1) - x7(i-1) ) + G*C7_4*( x4(i-1) - x7(i-1) ) + G*C7_5*( x5(i-1) - x7(i-1) ) + G*C7_6*( x6(i-1) - x7(i-1) ) + G*C7_8*( x8(i-1) - x7(i-1) ) + G*C7_9*( x9(i-1) - x7(i-1) ) + G*C7_10*( x10(i-1) - x7(i-1) ) + G*C7_11*( x11(i-1) - x7(i-1) ) + G*C7_12*( x12(i-1) - x7(i-1) ) + G*C7_13*( x13(i-1) - x7(i-1) ) + G*C7_14*( x14(i-1) - x7(i-1) ) + G*C7_15*( x15(i-1) - x7(i-1) ) + G*C7_16*( x16(i-1) - x7(i-1) ) + G*C7_17*( x17(i-1) - x7(i-1) ) + G*C7_18*( x18(i-1) - x7(i-1) ) + G*C7_19*( x19(i-1) - x7(i-1) ) + G*C7_20*( x20(i-1) - x7(i-1) ) )*dt;
y7(i) = y7(i-1) + ( ( a7 - x7(i-1)^2 - y7(i-1)^2 )*y7(i-1) + omega7*x7(i-1) + G*C7_1*( y1(i-1) - y7(i-1) ) + G*C7_2*( y2(i-1) - y7(i-1) ) + G*C7_3*( y3(i-1) - y7(i-1) ) + G*C7_4*( y4(i-1) - y7(i-1) ) + G*C7_5*( y5(i-1) - y7(i-1) ) + G*C7_6*( y6(i-1) - y7(i-1) ) + G*C7_8*( y8(i-1) - y7(i-1) ) + G*C7_9*( y9(i-1) - y7(i-1) ) + G*C7_10*( y10(i-1) - y7(i-1) ) + G*C7_11*( y11(i-1) - y7(i-1) ) + G*C7_12*( y12(i-1) - y7(i-1) ) + G*C7_13*( y13(i-1) - y7(i-1) ) + G*C7_14*( y14(i-1) - y7(i-1) ) + G*C7_15*( y15(i-1) - y7(i-1) ) + G*C7_16*( y16(i-1) - y7(i-1) ) + G*C7_17*( y17(i-1) - y7(i-1) ) + G*C7_18*( y18(i-1) - y7(i-1) ) + G*C7_19*( y19(i-1) - y7(i-1) ) + G*C7_20*( y20(i-1) - y7(i-1) ) )*dt;
%Oscillator 8
x8(i) = x8(i-1) + ( ( a8 - x8(i-1)^2 - y8(i-1)^2 )*x8(i-1) - omega8*y8(i-1) + G*C8_1*( x1(i-1) - x8(i-1) ) + G*C8_2*( x2(i-1) - x8(i-1) ) + G*C8_3*( x3(i-1) - x8(i-1) ) + G*C8_4*( x4(i-1) - x8(i-1) ) + G*C8_5*( x5(i-1) - x8(i-1) ) + G*C8_6*( x6(i-1) - x8(i-1) ) + G*C8_7*( x7(i-1) - x8(i-1) ) + G*C8_9*( x9(i-1) - x8(i-1) ) + G*C8_10*( x10(i-1) - x8(i-1) ) + G*C8_11*( x11(i-1) - x8(i-1) ) + G*C8_12*( x12(i-1) - x8(i-1) ) + G*C8_13*( x13(i-1) - x8(i-1) ) + G*C8_14*( x14(i-1) - x8(i-1) ) + G*C8_15*( x15(i-1) - x8(i-1) ) + G*C8_16*( x16(i-1) - x8(i-1) ) + G*C8_17*( x17(i-1) - x8(i-1) ) + G*C8_18*( x18(i-1) - x8(i-1) ) + G*C8_19*( x19(i-1) - x8(i-1) ) + G*C8_20*( x20(i-1) - x8(i-1) ) )*dt;
y8(i) = y8(i-1) + ( ( a8 - x8(i-1)^2 - y8(i-1)^2 )*y8(i-1) + omega8*x8(i-1) + G*C8_1*( y1(i-1) - y8(i-1) ) + G*C8_2*( y2(i-1) - y8(i-1) ) + G*C8_3*( y3(i-1) - y8(i-1) ) + G*C8_4*( y4(i-1) - y8(i-1) ) + G*C8_5*( y5(i-1) - y8(i-1) ) + G*C8_6*( y6(i-1) - y8(i-1) ) + G*C8_7*( y7(i-1) - y8(i-1) ) + G*C8_9*( y9(i-1) - y8(i-1) ) + G*C8_10*( y10(i-1) - y8(i-1) ) + G*C8_11*( y11(i-1) - y8(i-1) ) + G*C8_12*( y12(i-1) - y8(i-1) ) + G*C8_13*( y13(i-1) - y8(i-1) ) + G*C8_14*( y14(i-1) - y8(i-1) ) + G*C8_15*( y15(i-1) - y8(i-1) ) + G*C8_16*( y16(i-1) - y8(i-1) ) + G*C8_17*( y17(i-1) - y8(i-1) ) + G*C8_18*( y18(i-1) - y8(i-1) ) + G*C8_19*( y19(i-1) - y8(i-1) ) + G*C8_20*( y20(i-1) - y8(i-1) ) )*dt;
%Oscillator 9
x9(i) = x9(i-1) + ( ( a9 - x9(i-1)^2 - y9(i-1)^2 )*x9(i-1) - omega9*y9(i-1) + G*C9_1*( x1(i-1) - x9(i-1) ) + G*C9_2*( x2(i-1) - x9(i-1) ) + G*C9_3*( x3(i-1) - x9(i-1) ) + G*C9_4*( x4(i-1) - x9(i-1) ) + G*C9_5*( x5(i-1) - x9(i-1) ) + G*C9_6*( x6(i-1) - x9(i-1) ) + G*C9_7*( x7(i-1) - x9(i-1) ) + G*C9_8*( x8(i-1) - x9(i-1) ) + G*C9_10*( x10(i-1) - x9(i-1) ) + G*C9_11*( x11(i-1) - x9(i-1) ) + G*C9_12*( x12(i-1) - x9(i-1) ) + G*C9_13*( x13(i-1) - x9(i-1) ) + G*C9_14*( x14(i-1) - x9(i-1) ) + G*C9_15*( x15(i-1) - x9(i-1) ) + G*C9_16*( x16(i-1) - x9(i-1) ) + G*C9_17*( x17(i-1) - x9(i-1) ) + G*C9_18*( x18(i-1) - x9(i-1) ) + G*C9_19*( x19(i-1) - x9(i-1) ) + G*C9_20*( x20(i-1) - x9(i-1) ) )*dt;
y9(i) = y9(i-1) + ( ( a9 - x9(i-1)^2 - y9(i-1)^2 )*y9(i-1) + omega9*x9(i-1) + G*C9_1*( y1(i-1) - y9(i-1) ) + G*C9_2*( y2(i-1) - y9(i-1) ) + G*C9_3*( y3(i-1) - y9(i-1) ) + G*C9_4*( y4(i-1) - y9(i-1) ) + G*C9_5*( y5(i-1) - y9(i-1) ) + G*C9_6*( y6(i-1) - y9(i-1) ) + G*C9_7*( y7(i-1) - y9(i-1) ) + G*C9_8*( y8(i-1) - y9(i-1) ) + G*C9_10*( y10(i-1) - y9(i-1) ) + G*C9_11*( y11(i-1) - y9(i-1) ) + G*C9_12*( y12(i-1) - y9(i-1) ) + G*C9_13*( y13(i-1) - y9(i-1) ) + G*C9_14*( y14(i-1) - y9(i-1) ) + G*C9_15*( y15(i-1) - y9(i-1) ) + G*C9_16*( y16(i-1) - y9(i-1) ) + G*C9_17*( y17(i-1) - y9(i-1) ) + G*C9_18*( y18(i-1) - y9(i-1) ) + G*C9_19*( y19(i-1) - y9(i-1) ) + G*C9_20*( y20(i-1) - y9(i-1) ) )*dt;
%Oscillator 10
x10(i) = x10(i-1) + ( ( a10 - x10(i-1)^2 - y10(i-1)^2 )*x10(i-1) - omega10*y10(i-1) + G*C10_1*( x1(i-1) - x10(i-1) ) + G*C10_2*( x2(i-1) - x10(i-1) ) + G*C10_3*( x3(i-1) - x10(i-1) ) + G*C10_4*( x4(i-1) - x10(i-1) ) + G*C10_5*( x5(i-1) - x10(i-1) ) + G*C10_6*( x6(i-1) - x10(i-1) ) + G*C10_7*( x7(i-1) - x10(i-1) ) + G*C10_8*( x8(i-1) - x10(i-1) ) + G*C10_9*( x9(i-1) - x10(i-1) ) + G*C10_11*( x11(i-1) - x10(i-1) ) + G*C10_12*( x12(i-1) - x10(i-1) ) + G*C10_13*( x13(i-1) - x10(i-1) ) + G*C10_14*( x14(i-1) - x10(i-1) ) + G*C10_15*( x15(i-1) - x10(i-1) ) + G*C10_16*( x16(i-1) - x10(i-1) ) + G*C10_17*( x17(i-1) - x10(i-1) ) + G*C10_18*( x18(i-1) - x10(i-1) ) + G*C10_19*( x19(i-1) - x10(i-1) ) + G*C10_20*( x20(i-1) - x10(i-1) ) )*dt;
y10(i) = y10(i-1) + ( ( a10 - x10(i-1)^2 - y10(i-1)^2 )*y10(i-1) + omega10*x10(i-1) + G*C10_1*( y1(i-1) - y10(i-1) ) + G*C10_2*( y2(i-1) - y10(i-1) ) + G*C10_3*( y3(i-1) - y10(i-1) ) + G*C10_4*( y4(i-1) - y10(i-1) ) + G*C10_5*( y5(i-1) - y10(i-1) ) + G*C10_6*( y6(i-1) - y10(i-1) ) + G*C10_7*( y7(i-1) - y10(i-1) ) + G*C10_8*( y8(i-1) - y10(i-1) ) + G*C10_9*( y9(i-1) - y10(i-1) ) + G*C10_11*( y11(i-1) - y10(i-1) ) + G*C10_12*( y12(i-1) - y10(i-1) ) + G*C10_13*( y13(i-1) - y10(i-1) ) + G*C10_14*( y14(i-1) - y10(i-1) ) + G*C10_15*( y15(i-1) - y10(i-1) ) + G*C10_16*( y16(i-1) - y10(i-1) ) + G*C10_17*( y17(i-1) - y10(i-1) ) + G*C10_18*( y18(i-1) - y10(i-1) ) + G*C10_19*( y19(i-1) - y10(i-1) ) + G*C10_20*( y20(i-1) - y10(i-1) ) )*dt;
%Oscillator 11
x11(i) = x11(i-1) + ( ( a11 - x11(i-1)^2 - y11(i-1)^2 )*x11(i-1) - omega11*y11(i-1) + G*C11_1*( x1(i-1) - x11(i-1) ) + G*C11_2*( x2(i-1) - x11(i-1) ) + G*C11_3*( x3(i-1) - x11(i-1) ) + G*C11_4*( x4(i-1) - x11(i-1) ) + G*C11_5*( x5(i-1) - x11(i-1) ) + G*C11_6*( x6(i-1) - x11(i-1) ) + G*C11_7*( x7(i-1) - x11(i-1) ) + G*C11_8*( x8(i-1) - x11(i-1) ) + G*C11_9*( x9(i-1) - x11(i-1) ) + G*C11_10*( x10(i-1) - x11(i-1) ) + G*C11_12*( x12(i-1) - x11(i-1) ) + G*C11_13*( x13(i-1) - x11(i-1) ) + G*C11_14*( x14(i-1) - x11(i-1) ) + G*C11_15*( x15(i-1) - x11(i-1) ) + G*C11_16*( x16(i-1) - x11(i-1) ) + G*C11_17*( x17(i-1) - x11(i-1) ) + G*C11_18*( x18(i-1) - x11(i-1) ) + G*C11_19*( x19(i-1) - x11(i-1) ) + G*C11_20*( x20(i-1) - x11(i-1) ) )*dt;
y11(i) = y11(i-1) + ( ( a11 - x11(i-1)^2 - y11(i-1)^2 )*y11(i-1) + omega11*x11(i-1) + G*C11_1*( y1(i-1) - y11(i-1) ) + G*C11_2*( y2(i-1) - y11(i-1) ) + G*C11_3*( y3(i-1) - y11(i-1) ) + G*C11_4*( y4(i-1) - y11(i-1) ) + G*C11_5*( y5(i-1) - y11(i-1) ) + G*C11_6*( y6(i-1) - y11(i-1) ) + G*C11_7*( y7(i-1) - y11(i-1) ) + G*C11_8*( y8(i-1) - y11(i-1) ) + G*C11_9*( y9(i-1) - y11(i-1) ) + G*C11_10*( y10(i-1) - y11(i-1) ) + G*C11_12*( y12(i-1) - y11(i-1) ) + G*C11_13*( y13(i-1) - y11(i-1) ) + G*C11_14*( y14(i-1) - y11(i-1) ) + G*C11_15*( y15(i-1) - y11(i-1) ) + G*C11_16*( y16(i-1) - y11(i-1) ) + G*C11_17*( y17(i-1) - y11(i-1) ) + G*C11_18*( y18(i-1) - y11(i-1) ) + G*C11_19*( y19(i-1) - y11(i-1) ) + G*C11_20*( y20(i-1) - y11(i-1) ) )*dt;
%Oscillator 12
x12(i) = x12(i-1) + ( ( a12 - x12(i-1)^2 - y12(i-1)^2 )*x12(i-1) - omega12*y12(i-1) + G*C12_1*( x1(i-1) - x12(i-1) ) + G*C12_2*( x2(i-1) - x12(i-1) ) + G*C12_3*( x3(i-1) - x12(i-1) ) + G*C12_4*( x4(i-1) - x12(i-1) ) + G*C12_5*( x5(i-1) - x12(i-1) ) + G*C12_6*( x6(i-1) - x12(i-1) ) + G*C12_7*( x7(i-1) - x12(i-1) ) + G*C12_8*( x8(i-1) - x12(i-1) ) + G*C12_9*( x9(i-1) - x12(i-1) ) + G*C12_10*( x10(i-1) - x12(i-1) ) + G*C12_11*( x11(i-1) - x12(i-1) ) + G*C12_13*( x13(i-1) - x12(i-1) ) + G*C12_14*( x14(i-1) - x12(i-1) ) + G*C12_15*( x15(i-1) - x12(i-1) ) + G*C12_16*( x16(i-1) - x12(i-1) ) + G*C12_17*( x17(i-1) - x12(i-1) ) + G*C12_18*( x18(i-1) - x12(i-1) ) + G*C12_19*( x19(i-1) - x12(i-1) ) + G*C12_20*( x20(i-1) - x12(i-1) ) )*dt;
y12(i) = y12(i-1) + ( ( a12 - x12(i-1)^2 - y12(i-1)^2 )*y12(i-1) + omega12*x12(i-1) + G*C12_1*( y1(i-1) - y12(i-1) ) + G*C12_2*( y2(i-1) - y12(i-1) ) + G*C12_3*( y3(i-1) - y12(i-1) ) + G*C12_4*( y4(i-1) - y12(i-1) ) + G*C12_5*( y5(i-1) - y12(i-1) ) + G*C12_6*( y6(i-1) - y12(i-1) ) + G*C12_7*( y7(i-1) - y12(i-1) ) + G*C12_8*( y8(i-1) - y12(i-1) ) + G*C12_9*( y9(i-1) - y12(i-1) ) + G*C12_10*( y10(i-1) - y12(i-1) ) + G*C12_11*( y11(i-1) - y12(i-1) ) + G*C12_13*( y13(i-1) - y12(i-1) ) + G*C12_14*( y14(i-1) - y12(i-1) ) + G*C12_15*( y15(i-1) - y12(i-1) ) + G*C12_16*( y16(i-1) - y12(i-1) ) + G*C12_17*( y17(i-1) - y12(i-1) ) + G*C12_18*( y18(i-1) - y12(i-1) ) + G*C12_19*( y19(i-1) - y12(i-1) ) + G*C12_20*( y20(i-1) - y12(i-1) ) )*dt;
%Oscillator 13
x13(i) = x13(i-1) + ( ( a13 - x13(i-1)^2 - y13(i-1)^2 )*x13(i-1) - omega13*y13(i-1) + G*C13_1*( x1(i-1) - x13(i-1) ) + G*C13_2*( x2(i-1) - x13(i-1) ) + G*C13_3*( x3(i-1) - x13(i-1) ) + G*C13_4*( x4(i-1) - x13(i-1) ) + G*C13_5*( x5(i-1) - x13(i-1) ) + G*C13_6*( x6(i-1) - x13(i-1) ) + G*C13_7*( x7(i-1) - x13(i-1) ) + G*C13_8*( x8(i-1) - x13(i-1) ) + G*C13_9*( x9(i-1) - x13(i-1) ) + G*C13_10*( x10(i-1) - x13(i-1) ) + G*C13_11*( x11(i-1) - x13(i-1) ) + G*C13_12*( x12(i-1) - x13(i-1) ) + G*C13_14*( x14(i-1) - x13(i-1) ) + G*C13_15*( x15(i-1) - x13(i-1) ) + G*C13_16*( x16(i-1) - x13(i-1) ) + G*C13_17*( x17(i-1) - x13(i-1) ) + G*C13_18*( x18(i-1) - x13(i-1) ) + G*C13_19*( x19(i-1) - x13(i-1) ) + G*C13_20*( x20(i-1) - x13(i-1) ) )*dt;
y13(i) = y13(i-1) + ( ( a13 - x13(i-1)^2 - y13(i-1)^2 )*y13(i-1) + omega13*x13(i-1) + G*C13_1*( y1(i-1) - y13(i-1) ) + G*C13_2*( y2(i-1) - y13(i-1) ) + G*C13_3*( y3(i-1) - y13(i-1) ) + G*C13_4*( y4(i-1) - y13(i-1) ) + G*C13_5*( y5(i-1) - y13(i-1) ) + G*C13_6*( y6(i-1) - y13(i-1) ) + G*C13_7*( y7(i-1) - y13(i-1) ) + G*C13_8*( y8(i-1) - y13(i-1) ) + G*C13_9*( y9(i-1) - y13(i-1) ) + G*C13_10*( y10(i-1) - y13(i-1) ) + G*C13_11*( y11(i-1) - y13(i-1) ) + G*C13_12*( y12(i-1) - y13(i-1) ) + G*C13_14*( y14(i-1) - y13(i-1) ) + G*C13_15*( y15(i-1) - y13(i-1) ) + G*C13_16*( y16(i-1) - y13(i-1) ) + G*C13_17*( y17(i-1) - y13(i-1) ) + G*C13_18*( y18(i-1) - y13(i-1) ) + G*C13_19*( y19(i-1) - y13(i-1) ) + G*C13_20*( y20(i-1) - y13(i-1) ) )*dt;
%Oscillator 14
x14(i) = x14(i-1) + ( ( a14 - x14(i-1)^2 - y14(i-1)^2 )*x14(i-1) - omega14*y14(i-1) + G*C14_1*( x1(i-1) - x14(i-1) ) + G*C14_2*( x2(i-1) - x14(i-1) ) + G*C14_3*( x3(i-1) - x14(i-1) ) + G*C14_4*( x4(i-1) - x14(i-1) ) + G*C14_5*( x5(i-1) - x14(i-1) ) + G*C14_6*( x6(i-1) - x14(i-1) ) + G*C14_7*( x7(i-1) - x14(i-1) ) + G*C14_8*( x8(i-1) - x14(i-1) ) + G*C14_9*( x9(i-1) - x14(i-1) ) + G*C14_10*( x10(i-1) - x14(i-1) ) + G*C14_11*( x11(i-1) - x14(i-1) ) + G*C14_12*( x12(i-1) - x14(i-1) ) + G*C14_13*( x13(i-1) - x14(i-1) ) + G*C14_15*( x15(i-1) - x14(i-1) ) + G*C14_16*( x16(i-1) - x14(i-1) ) + G*C14_17*( x17(i-1) - x14(i-1) ) + G*C14_18*( x18(i-1) - x14(i-1) ) + G*C14_19*( x19(i-1) - x14(i-1) ) + G*C14_20*( x20(i-1) - x14(i-1) ) )*dt;
y14(i) = y14(i-1) + ( ( a14 - x14(i-1)^2 - y14(i-1)^2 )*y14(i-1) + omega14*x14(i-1) + G*C14_1*( y1(i-1) - y14(i-1) ) + G*C14_2*( y2(i-1) - y14(i-1) ) + G*C14_3*( y3(i-1) - y14(i-1) ) + G*C14_4*( y4(i-1) - y14(i-1) ) + G*C14_5*( y5(i-1) - y14(i-1) ) + G*C14_6*( y6(i-1) - y14(i-1) ) + G*C14_7*( y7(i-1) - y14(i-1) ) + G*C14_8*( y8(i-1) - y14(i-1) ) + G*C14_9*( y9(i-1) - y14(i-1) ) + G*C14_10*( y10(i-1) - y14(i-1) ) + G*C14_11*( y11(i-1) - y14(i-1) ) + G*C14_12*( y12(i-1) - y14(i-1) ) + G*C14_13*( y13(i-1) - y14(i-1) ) + G*C14_15*( y15(i-1) - y14(i-1) ) + G*C14_16*( y16(i-1) - y14(i-1) ) + G*C14_17*( y17(i-1) - y14(i-1) ) + G*C14_18*( y18(i-1) - y14(i-1) ) + G*C14_19*( y19(i-1) - y14(i-1) ) + G*C14_20*( y20(i-1) - y14(i-1) ) )*dt;
%Oscillator 15
x15(i) = x15(i-1) + ( ( a15 - x15(i-1)^2 - y15(i-1)^2 )*x15(i-1) - omega15*y15(i-1) + G*C15_1*( x1(i-1) - x15(i-1) ) + G*C15_2*( x2(i-1) - x15(i-1) ) + G*C15_3*( x3(i-1) - x15(i-1) ) + G*C15_4*( x4(i-1) - x15(i-1) ) + G*C15_5*( x5(i-1) - x15(i-1) ) + G*C15_6*( x6(i-1) - x15(i-1) ) + G*C15_7*( x7(i-1) - x15(i-1) ) + G*C15_8*( x8(i-1) - x15(i-1) ) + G*C15_9*( x9(i-1) - x15(i-1) ) + G*C15_10*( x10(i-1) - x15(i-1) ) + G*C15_11*( x11(i-1) - x15(i-1) ) + G*C15_12*( x12(i-1) - x15(i-1) ) + G*C15_13*( x13(i-1) - x15(i-1) ) + G*C15_14*( x14(i-1) - x15(i-1) ) + G*C15_16*( x16(i-1) - x15(i-1) ) + G*C15_17*( x17(i-1) - x15(i-1) ) + G*C15_18*( x18(i-1) - x15(i-1) ) + G*C15_19*( x19(i-1) - x15(i-1) ) + G*C15_20*( x20(i-1) - x15(i-1) ) )*dt;
y15(i) = y15(i-1) + ( ( a15 - x15(i-1)^2 - y15(i-1)^2 )*y15(i-1) + omega15*x15(i-1) + G*C15_1*( y1(i-1) - y15(i-1) ) + G*C15_2*( y2(i-1) - y15(i-1) ) + G*C15_3*( y3(i-1) - y15(i-1) ) + G*C15_4*( y4(i-1) - y15(i-1) ) + G*C15_5*( y5(i-1) - y15(i-1) ) + G*C15_6*( y6(i-1) - y15(i-1) ) + G*C15_7*( y7(i-1) - y15(i-1) ) + G*C15_8*( y8(i-1) - y15(i-1) ) + G*C15_9*( y9(i-1) - y15(i-1) ) + G*C15_10*( y10(i-1) - y15(i-1) ) + G*C15_11*( y11(i-1) - y15(i-1) ) + G*C15_12*( y12(i-1) - y15(i-1) ) + G*C15_13*( y13(i-1) - y15(i-1) ) + G*C15_14*( y14(i-1) - y15(i-1) ) + G*C15_16*( y16(i-1) - y15(i-1) ) + G*C15_17*( y17(i-1) - y15(i-1) ) + G*C15_18*( y18(i-1) - y15(i-1) ) + G*C15_19*( y19(i-1) - y15(i-1) ) + G*C15_20*( y20(i-1) - y15(i-1) ) )*dt;
%Oscillator 16
x16(i) = x16(i-1) + ( ( a16 - x16(i-1)^2 - y16(i-1)^2 )*x16(i-1) - omega16*y16(i-1) + G*C16_1*( x1(i-1) - x16(i-1) ) + G*C16_2*( x2(i-1) - x16(i-1) ) + G*C16_3*( x3(i-1) - x16(i-1) ) + G*C16_4*( x4(i-1) - x16(i-1) ) + G*C16_5*( x5(i-1) - x16(i-1) ) + G*C16_6*( x6(i-1) - x16(i-1) ) + G*C16_7*( x7(i-1) - x16(i-1) ) + G*C16_8*( x8(i-1) - x16(i-1) ) + G*C16_9*( x9(i-1) - x16(i-1) ) + G*C16_10*( x10(i-1) - x16(i-1) ) + G*C16_11*( x11(i-1) - x16(i-1) ) + G*C16_12*( x12(i-1) - x16(i-1) ) + G*C16_13*( x13(i-1) - x16(i-1) ) + G*C16_14*( x14(i-1) - x16(i-1) ) + G*C16_15*( x15(i-1) - x16(i-1) ) + G*C16_17*( x17(i-1) - x16(i-1) ) + G*C16_18*( x18(i-1) - x16(i-1) ) + G*C16_19*( x19(i-1) - x16(i-1) ) + G*C16_20*( x20(i-1) - x16(i-1) ) )*dt;
y16(i) = y16(i-1) + ( ( a16 - x16(i-1)^2 - y16(i-1)^2 )*y16(i-1) + omega16*x16(i-1) + G*C16_1*( y1(i-1) - y16(i-1) ) + G*C16_2*( y2(i-1) - y16(i-1) ) + G*C16_3*( y3(i-1) - y16(i-1) ) + G*C16_4*( y4(i-1) - y16(i-1) ) + G*C16_5*( y5(i-1) - y16(i-1) ) + G*C16_6*( y6(i-1) - y16(i-1) ) + G*C16_7*( y7(i-1) - y16(i-1) ) + G*C16_8*( y8(i-1) - y16(i-1) ) + G*C16_9*( y9(i-1) - y16(i-1) ) + G*C16_10*( y10(i-1) - y16(i-1) ) + G*C16_11*( y11(i-1) - y16(i-1) ) + G*C16_12*( y12(i-1) - y16(i-1) ) + G*C16_13*( y13(i-1) - y16(i-1) ) + G*C16_14*( y14(i-1) - y16(i-1) ) + G*C16_15*( y15(i-1) - y16(i-1) ) + G*C16_17*( y17(i-1) - y16(i-1) ) + G*C16_18*( y18(i-1) - y16(i-1) ) + G*C16_19*( y19(i-1) - y16(i-1) ) + G*C16_20*( y20(i-1) - y16(i-1) ) )*dt;
%Oscillator 17
x17(i) = x17(i-1) + ( ( a17 - x17(i-1)^2 - y17(i-1)^2 )*x17(i-1) - omega17*y17(i-1) + G*C17_1*( x1(i-1) - x17(i-1) ) + G*C17_2*( x2(i-1) - x17(i-1) ) + G*C17_3*( x3(i-1) - x17(i-1) ) + G*C17_4*( x4(i-1) - x17(i-1) ) + G*C17_5*( x5(i-1) - x17(i-1) ) + G*C17_6*( x6(i-1) - x17(i-1) ) + G*C17_7*( x7(i-1) - x17(i-1) ) + G*C17_8*( x8(i-1) - x17(i-1) ) + G*C17_9*( x9(i-1) - x17(i-1) ) + G*C17_10*( x10(i-1) - x17(i-1) ) + G*C17_11*( x11(i-1) - x17(i-1) ) + G*C17_12*( x12(i-1) - x17(i-1) ) + G*C17_13*( x13(i-1) - x17(i-1) ) + G*C17_14*( x14(i-1) - x17(i-1) ) + G*C17_15*( x15(i-1) - x17(i-1) ) + G*C17_16*( x16(i-1) - x17(i-1) ) + G*C17_18*( x18(i-1) - x17(i-1) ) + G*C17_19*( x19(i-1) - x17(i-1) ) + G*C17_20*( x20(i-1) - x17(i-1) ) )*dt;
y17(i) = y17(i-1) + ( ( a17 - x17(i-1)^2 - y17(i-1)^2 )*y17(i-1) + omega17*x17(i-1) + G*C17_1*( y1(i-1) - y17(i-1) ) + G*C17_2*( y2(i-1) - y17(i-1) ) + G*C17_3*( y3(i-1) - y17(i-1) ) + G*C17_4*( y4(i-1) - y17(i-1) ) + G*C17_5*( y5(i-1) - y17(i-1) ) + G*C17_6*( y6(i-1) - y17(i-1) ) + G*C17_7*( y7(i-1) - y17(i-1) ) + G*C17_8*( y8(i-1) - y17(i-1) ) + G*C17_9*( y9(i-1) - y17(i-1) ) + G*C17_10*( y10(i-1) - y17(i-1) ) + G*C17_11*( y11(i-1) - y17(i-1) ) + G*C17_12*( y12(i-1) - y17(i-1) ) + G*C17_13*( y13(i-1) - y17(i-1) ) + G*C17_14*( y14(i-1) - y17(i-1) ) + G*C17_15*( y15(i-1) - y17(i-1) ) + G*C17_16*( y16(i-1) - y17(i-1) ) + G*C17_18*( y18(i-1) - y17(i-1) ) + G*C17_19*( y19(i-1) - y17(i-1) ) + G*C17_20*( y20(i-1) - y17(i-1) ) )*dt;
%Oscillator 18
x18(i) = x18(i-1) + ( ( a18 - x18(i-1)^2 - y18(i-1)^2 )*x18(i-1) - omega18*y18(i-1) + G*C18_1*( x1(i-1) - x18(i-1) ) + G*C18_2*( x2(i-1) - x18(i-1) ) + G*C18_3*( x3(i-1) - x18(i-1) ) + G*C18_4*( x4(i-1) - x18(i-1) ) + G*C18_5*( x5(i-1) - x18(i-1) ) + G*C18_6*( x6(i-1) - x18(i-1) ) + G*C18_7*( x7(i-1) - x18(i-1) ) + G*C18_8*( x8(i-1) - x18(i-1) ) + G*C18_9*( x9(i-1) - x18(i-1) ) + G*C18_10*( x10(i-1) - x18(i-1) ) + G*C18_11*( x11(i-1) - x18(i-1) ) + G*C18_12*( x12(i-1) - x18(i-1) ) + G*C18_13*( x13(i-1) - x18(i-1) ) + G*C18_14*( x14(i-1) - x18(i-1) ) + G*C18_15*( x15(i-1) - x18(i-1) ) + G*C18_16*( x16(i-1) - x18(i-1) ) + G*C18_17*( x17(i-1) - x18(i-1) ) + G*C18_19*( x19(i-1) - x18(i-1) ) + G*C18_20*( x20(i-1) - x18(i-1) ) )*dt;
y18(i) = y18(i-1) + ( ( a18 - x18(i-1)^2 - y18(i-1)^2 )*y18(i-1) + omega18*x18(i-1) + G*C18_1*( y1(i-1) - y18(i-1) ) + G*C18_2*( y2(i-1) - y18(i-1) ) + G*C18_3*( y3(i-1) - y18(i-1) ) + G*C18_4*( y4(i-1) - y18(i-1) ) + G*C18_5*( y5(i-1) - y18(i-1) ) + G*C18_6*( y6(i-1) - y18(i-1) ) + G*C18_7*( y7(i-1) - y18(i-1) ) + G*C18_8*( y8(i-1) - y18(i-1) ) + G*C18_9*( y9(i-1) - y18(i-1) ) + G*C18_10*( y10(i-1) - y18(i-1) ) + G*C18_11*( y11(i-1) - y18(i-1) ) + G*C18_12*( y12(i-1) - y18(i-1) ) + G*C18_13*( y13(i-1) - y18(i-1) ) + G*C18_14*( y14(i-1) - y18(i-1) ) + G*C18_15*( y15(i-1) - y18(i-1) ) + G*C18_16*( y16(i-1) - y18(i-1) ) + G*C18_17*( y17(i-1) - y18(i-1) ) + G*C18_19*( y19(i-1) - y18(i-1) ) + G*C18_20*( y20(i-1) - y18(i-1) ) )*dt;
%Oscillator 19
x19(i) = x19(i-1) + ( ( a19 - x19(i-1)^2 - y19(i-1)^2 )*x19(i-1) - omega19*y19(i-1) + G*C19_1*( x1(i-1) - x19(i-1) ) + G*C19_2*( x2(i-1) - x19(i-1) ) + G*C19_3*( x3(i-1) - x19(i-1) ) + G*C19_4*( x4(i-1) - x19(i-1) ) + G*C19_5*( x5(i-1) - x19(i-1) ) + G*C19_6*( x6(i-1) - x19(i-1) ) + G*C19_7*( x7(i-1) - x19(i-1) ) + G*C19_8*( x8(i-1) - x19(i-1) ) + G*C19_9*( x9(i-1) - x19(i-1) ) + G*C19_10*( x10(i-1) - x19(i-1) ) + G*C19_11*( x11(i-1) - x19(i-1) ) + G*C19_12*( x12(i-1) - x19(i-1) ) + G*C19_13*( x13(i-1) - x19(i-1) ) + G*C19_14*( x14(i-1) - x19(i-1) ) + G*C19_15*( x15(i-1) - x19(i-1) ) + G*C19_16*( x16(i-1) - x19(i-1) ) + G*C19_17*( x17(i-1) - x19(i-1) ) + G*C19_18*( x18(i-1) - x19(i-1) ) + G*C19_20*( x20(i-1) - x19(i-1) ) )*dt;
y19(i) = y19(i-1) + ( ( a19 - x19(i-1)^2 - y19(i-1)^2 )*y19(i-1) + omega19*x19(i-1) + G*C19_1*( y1(i-1) - y19(i-1) ) + G*C19_2*( y2(i-1) - y19(i-1) ) + G*C19_3*( y3(i-1) - y19(i-1) ) + G*C19_4*( y4(i-1) - y19(i-1) ) + G*C19_5*( y5(i-1) - y19(i-1) ) + G*C19_6*( y6(i-1) - y19(i-1) ) + G*C19_7*( y7(i-1) - y19(i-1) ) + G*C19_8*( y8(i-1) - y19(i-1) ) + G*C19_9*( y9(i-1) - y19(i-1) ) + G*C19_10*( y10(i-1) - y19(i-1) ) + G*C19_11*( y11(i-1) - y19(i-1) ) + G*C19_12*( y12(i-1) - y19(i-1) ) + G*C19_13*( y13(i-1) - y19(i-1) ) + G*C19_14*( y14(i-1) - y19(i-1) ) + G*C19_15*( y15(i-1) - y19(i-1) ) + G*C19_16*( y16(i-1) - y19(i-1) ) + G*C19_17*( y17(i-1) - y19(i-1) ) + G*C19_18*( y18(i-1) - y19(i-1) ) + G*C19_20*( y20(i-1) - y19(i-1) ) )*dt;
%Oscillator 20
x20(i) = x20(i-1) + ( ( a20 - x20(i-1)^2 - y20(i-1)^2 )*x20(i-1) - omega20*y20(i-1) + G*C20_1*( x1(i-1) - x20(i-1) ) + G*C20_2*( x2(i-1) - x20(i-1) ) + G*C20_3*( x3(i-1) - x20(i-1) ) + G*C20_4*( x4(i-1) - x20(i-1) ) + G*C20_5*( x5(i-1) - x20(i-1) ) + G*C20_6*( x6(i-1) - x20(i-1) ) + G*C20_7*( x7(i-1) - x20(i-1) ) + G*C20_8*( x8(i-1) - x20(i-1) ) + G*C20_9*( x9(i-1) - x20(i-1) ) + G*C20_10*( x10(i-1) - x20(i-1) ) + G*C20_11*( x11(i-1) - x20(i-1) ) + G*C20_12*( x12(i-1) - x20(i-1) ) + G*C20_13*( x13(i-1) - x20(i-1) ) + G*C20_14*( x14(i-1) - x20(i-1) ) + G*C20_15*( x15(i-1) - x20(i-1) ) + G*C20_16*( x16(i-1) - x20(i-1) ) + G*C20_17*( x17(i-1) - x20(i-1) ) + G*C20_18*( x18(i-1) - x20(i-1) ) + G*C20_19*( x19(i-1) - x20(i-1) ) )*dt;
y20(i) = y20(i-1) + ( ( a20 - x20(i-1)^2 - y20(i-1)^2 )*y20(i-1) + omega20*x20(i-1) + G*C20_1*( y1(i-1) - y20(i-1) ) + G*C20_2*( y2(i-1) - y20(i-1) ) + G*C20_3*( y3(i-1) - y20(i-1) ) + G*C20_4*( y4(i-1) - y20(i-1) ) + G*C20_5*( y5(i-1) - y20(i-1) ) + G*C20_6*( y6(i-1) - y20(i-1) ) + G*C20_7*( y7(i-1) - y20(i-1) ) + G*C20_8*( y8(i-1) - y20(i-1) ) + G*C20_9*( y9(i-1) - y20(i-1) ) + G*C20_10*( y10(i-1) - y20(i-1) ) + G*C20_11*( y11(i-1) - y20(i-1) ) + G*C20_12*( y12(i-1) - y20(i-1) ) + G*C20_13*( y13(i-1) - y20(i-1) ) + G*C20_14*( y14(i-1) - y20(i-1) ) + G*C20_15*( y15(i-1) - y20(i-1) ) + G*C20_16*( y16(i-1) - y20(i-1) ) + G*C20_17*( y17(i-1) - y20(i-1) ) + G*C20_18*( y18(i-1) - y20(i-1) ) + G*C20_19*( y19(i-1) - y20(i-1) ) )*dt;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ksaix1_real=[a1; -omega1; G*C1_2; G*C1_3; G*C1_4; G*C1_5; G*C1_6; G*C1_7; G*C1_8; G*C1_9; G*C1_10; G*C1_11; G*C1_12; G*C1_13; G*C1_14; G*C1_15; G*C1_16; G*C1_17; G*C1_18; G*C1_19; G*C1_20;];
ksaix2_real=[a2; -omega2; G*C2_1; G*C2_3; G*C2_4; G*C2_5; G*C2_6; G*C2_7; G*C2_8; G*C2_9; G*C2_10; G*C2_11; G*C2_12; G*C2_13; G*C2_14; G*C2_15; G*C2_16; G*C2_17; G*C2_18; G*C2_19; G*C2_20;];
ksaix3_real=[a3; -omega3; G*C3_1; G*C3_2; G*C3_4; G*C3_5; G*C3_6; G*C3_7; G*C3_8; G*C3_9; G*C3_10; G*C3_11; G*C3_12; G*C3_13; G*C3_14; G*C3_15; G*C3_16; G*C3_17; G*C3_18; G*C3_19; G*C3_20;];
ksaix4_real= [a4; -omega4; G*C4_1; G*C4_2; G*C4_3; G*C4_5; G*C4_6; G*C4_7; G*C4_8; G*C4_9; G*C4_10; G*C4_11; G*C4_12; G*C4_13; G*C4_14; G*C4_15; G*C4_16; G*C4_17; G*C4_18; G*C4_19; G*C4_20;];
ksaix5_real= [a5; -omega5; G*C5_1; G*C5_2; G*C5_3; G*C5_4; G*C5_6; G*C5_7; G*C5_8; G*C5_9; G*C5_10; G*C5_11; G*C5_12; G*C5_13; G*C5_14; G*C5_15; G*C5_16; G*C5_17; G*C5_18; G*C5_19; G*C5_20;];
ksaix6_real= [a6; -omega6; G*C6_1; G*C6_2; G*C6_3; G*C6_4; G*C6_5; G*C6_7; G*C6_8; G*C6_9; G*C6_10; G*C6_11; G*C6_12; G*C6_13; G*C6_14; G*C6_15; G*C6_16; G*C6_17; G*C6_18; G*C6_19; G*C6_20;];
ksaix7_real= [a7; -omega7; G*C7_1; G*C7_2; G*C7_3; G*C7_4; G*C7_5; G*C7_6; G*C7_8; G*C7_9; G*C7_10; G*C7_11; G*C7_12; G*C7_13; G*C7_14; G*C7_15; G*C7_16; G*C7_17; G*C7_18; G*C7_19; G*C7_20;];
ksaix8_real= [a8; -omega8; G*C8_1; G*C8_2; G*C8_3; G*C8_4; G*C8_5; G*C8_6; G*C8_7; G*C8_9; G*C8_10; G*C8_11; G*C8_12; G*C8_13; G*C8_14; G*C8_15; G*C8_16; G*C8_17; G*C8_18; G*C8_19; G*C8_20;];
ksaix9_real= [a9; -omega9; G*C9_1; G*C9_2; G*C9_3; G*C9_4; G*C9_5; G*C9_6; G*C9_7; G*C9_8; G*C9_10; G*C9_11; G*C9_12; G*C9_13; G*C9_14; G*C9_15; G*C9_16; G*C9_17; G*C9_18; G*C9_19; G*C9_20;];
ksaix10_real= [a10; -omega10; G*C10_1; G*C10_2; G*C10_3; G*C10_4; G*C10_5; G*C10_6; G*C10_7; G*C10_8; G*C10_9; G*C10_11; G*C10_12; G*C10_13; G*C10_14; G*C10_15; G*C10_16; G*C10_17; G*C10_18; G*C10_19; G*C10_20;];
ksaix11_real= [a11; -omega11; G*C11_1; G*C11_2; G*C11_3; G*C11_4; G*C11_5; G*C11_6; G*C11_7; G*C11_8; G*C11_9; G*C11_10; G*C11_12; G*C11_13; G*C11_14; G*C11_15; G*C11_16; G*C11_17; G*C11_18; G*C11_19; G*C11_20;];
ksaix12_real= [a12; -omega12; G*C12_1; G*C12_2; G*C12_3; G*C12_4; G*C12_5; G*C12_6; G*C12_7; G*C12_8; G*C12_9; G*C12_10; G*C12_11; G*C12_13; G*C12_14; G*C12_15; G*C12_16; G*C12_17; G*C12_18; G*C12_19; G*C12_20;];
ksaix13_real= [a13; -omega13; G*C13_1; G*C13_2; G*C13_3; G*C13_4; G*C13_5; G*C13_6; G*C13_7; G*C13_8; G*C13_9; G*C13_10; G*C13_11; G*C13_12; G*C13_14; G*C13_15; G*C13_16; G*C13_17; G*C13_18; G*C13_19; G*C13_20;];
ksaix14_real= [a14; -omega14; G*C14_1; G*C14_2; G*C14_3; G*C14_4; G*C14_5; G*C14_6; G*C14_7; G*C14_8; G*C14_9; G*C14_10; G*C14_11; G*C14_12; G*C14_13; G*C14_15; G*C14_16; G*C14_17; G*C14_18; G*C14_19; G*C14_20;];
ksaix15_real= [a15; -omega15; G*C15_1; G*C15_2; G*C15_3; G*C15_4; G*C15_5; G*C15_6; G*C15_7; G*C15_8; G*C15_9; G*C15_10; G*C15_11; G*C15_12; G*C15_13; G*C15_14; G*C15_16; G*C15_17; G*C15_18; G*C15_19; G*C15_20;];
ksaix16_real= [a16; -omega16; G*C16_1; G*C16_2; G*C16_3; G*C16_4; G*C16_5; G*C16_6; G*C16_7; G*C16_8; G*C16_9; G*C16_10; G*C16_11; G*C16_12; G*C16_13; G*C16_14; G*C16_15; G*C16_17; G*C16_18; G*C16_19; G*C16_20;];
ksaix17_real= [a17; -omega17; G*C17_1; G*C17_2; G*C17_3; G*C17_4; G*C17_5; G*C17_6; G*C17_7; G*C17_8; G*C17_9; G*C17_10; G*C17_11; G*C17_12; G*C17_13; G*C17_14; G*C17_15; G*C17_16; G*C17_18; G*C17_19; G*C17_20;];
ksaix18_real= [a18; -omega18; G*C18_1; G*C18_2; G*C18_3; G*C18_4; G*C18_5; G*C18_6; G*C18_7; G*C18_8; G*C18_9; G*C18_10; G*C18_11; G*C18_12; G*C18_13; G*C18_14; G*C18_15; G*C18_16; G*C18_17; G*C18_19; G*C18_20;];
ksaix19_real= [a19; -omega19; G*C19_1; G*C19_2; G*C19_3; G*C19_4; G*C19_5; G*C19_6; G*C19_7; G*C19_8; G*C19_9; G*C19_10; G*C19_11; G*C19_12; G*C19_13; G*C19_14; G*C19_15; G*C19_16; G*C19_17; G*C19_18; G*C19_20;];
ksaix20_real= [a20; -omega20; G*C20_1; G*C20_2; G*C20_3; G*C20_4; G*C20_5; G*C20_6; G*C20_7; G*C20_8; G*C20_9; G*C20_10; G*C20_11; G*C20_12; G*C20_13; G*C20_14; G*C20_15; G*C20_16; G*C20_17; G*C20_18; G*C20_19;];
ksaix1 = [0.7000; -20.000; -0.0000; 0.0000; 0.0101; 0.0000; 0.0000; 0.0102; -0.0000; 0.0000; -0.0000; 0.0000; 0.0103; 0.0000; -0.0000; -0.0000; 0.0000; 0.0104; 0.0000; 0.0000; 0.0000;];
ksaix2 = [0.1000; -40.0000; 0.0300; 0.0000; 0.0310; 0.0000; -0.0000; 0.0000; 0.0320; 0.0000; 0.0000; 0.0000; 0.0330; 0.0000; 0.0000; 0.0000; 0.0340; -0.0000; -0.0000; -0.0000; 0.0350;];
ksaix3 = [0.8000; -30.0000; -0.0000; 0.0000; 0.0860; 0.0800; -0.0000; 0.0000; 0.0810; 0.0000; -0.0000; -0.0000; 0.0000; -0.0000; 0.0830; 0.0000; 0.0000; 0.0840; 0.0000; -0.0000; -0.0000;];
ksaix4 = [0.5000 ;-60.0000; 0.0500; 0.0000; 0.0550; 0.0000; -0.0000; 0.0000; 0.0000; 0.0510; -0.0000; -0.0000; 0.0000; 0.0520; -0.0000; -0.0000; 0.0000; 0.0530; -0.0000; -0.0000; -0.0000;];
ksaix5 = [0.6000; -80.0000; 0.0600; 0.0000; 0.0650; 0.0000; -0.0000; 0.0000; -0.0000; -0.0000; -0.0000; 0.0620; -0.0000; -0.0000; -0.0000; 0.0630; 0.0000; -0.0000; 0.0000; 0.0640; 0.0000;];
ksaix6 = [0.1000; -50.0000; 0.1000; -0.0000; 0.1500; 0.0000; -0.0000; 0.0000; -0.0000; 0.1200; -0.0000; -0.0000; -0.0000; 0.0000; -0.0000; 0.0000; 0.0000; 0.1300; 0.0000; 0.0000; 0.0000;];
ksaix7 = [0.5000; -20.0000; 0.0000; 0.0000; 0.0450; 0.0400; -0.0000; 0.0000; 0.0000; 0.0420; 0.0000; 0.0000; -0.0000; -0.0000; 0.0000; 0.0430; -0.0000; 0.0000; -0.0000; 0.0440; 0.0000;];
ksaix8 = [0.2000; -70.0000; 0.0200; -0.0000; 0.0210; 0.0000; -0.0000; 0.0000; 0.0000; -0.0000; 0.0210; -0.0000; 0.0000; 0.0000; -0.0000; 0.0000; 0.0220; 0.0000; 0.0000; 0.0000; 0.0230;];
ksaix9 = [0.7000; -60.0000; 0.0000; -0.0000; 0.0750; -0.0000; 0.0700; 0.0000; -0.0000; 0.0000; 0.0710; -0.0000; -0.0000; 0.0000; 0.0000; -0.0000; 0.0720; 0.0000; 0.0730; 0.0000; 0.0000;];
ksaix10 =[0.3000; -50.0000; 0.0000; 0.0900; 0.0950; 0.0000; -0.0000; -0.0000; 0.0000; 0.0910; -0.0000; -0.0000; 0.0000; 0.0000; 0.0920; 0.0000; 0.0000; 0.0000; 0.0930; 0.0940; -0.0000;];
ksaix11 =[0.2000; -20.0000; 0.2000; -0.0000; 0.2050; -0.0000; 0.0000; 0.0000; 0.2010; 0.0000; 0.0000; 0.0000; -0.0000; 0.0000; 0.0000; -0.0000; -0.0000; 0.2020; -0.0000; 0.2030; 0.0000;];
ksaix12 =[0.1300; -90.0000; 0.1300; -0.0000; 0.1315; -0.0000; 0.0000; 0.0000; 0.1310; 0.0000; 0.0000; 0.0000; 0.0000; 0.0000; 0.0000; 0.1320; -0.0000; -0.0000; 0.1330; 0.0000; -0.0000;];
ksaix13 =[0.1800; -40.0000; 0.0000; 0.0000; 0.1850; 0.0000; 0.0000; 0.1800; -0.0000; -0.0000; 0.1810; 0.0000; 0.0000; -0.0000; 0.0000; 0.1820; -0.0000; -0.0000; 0.0000; 0.1830; 0.0000;];
ksaix14 =[0.2300; -30.0000; 0.2300; -0.0000; 0.2350; -0.0000; 0.0000; 0.0000; 0.2310; 0.0000; 0.0000; 0.2320; 0.0000; 0.0000; 0.0000; -0.0000; 0.2330; -0.0000; -0.0000; -0.0000; 0.2340;];
ksaix15 =[0.2200; -60.0000; 0.0000; 0.2200; 0.2250; 0.0000; 0.0000; 0.0000; -0.0000; 0.2210; -0.0000; 0.0000; -0.0000; 0.0000; 0.2220; 0.0000; -0.0000; -0.0000; 0.2230; 0.0000; 0.2240;];
ksaix16 =[0.1100; -50.0000; 0.0000; 0.1100; 0.1115; 0.0000; -0.0000; -0.0000; -0.0000; 0.0000; 0.1110; 0.0000; -0.0000; -0.0000; 0.000; 0.1120; 0.0000; 0.0000; -0.0000; 0.1130; 0.0000;];
ksaix17 =[0.1400; -80.0000; 0.1400; 0.0000; 0.1450; 0.0000; -0.0000; -0.0000; 0.0000; -0.0000; 0.1410; 0.0000; -0.0000; -0.0000; 0.1420; -0.0000; -0.0000; -0.0000; 0.0000; 0.1430; 0.0000;];
ksaix18 =[0.2100; -70.0000; 0.2100; 0.2110; 0.2150; 0.0000; -0.0000; 0.0000; 0.0000; -0.0000; -0.0000; 0.2120; -0.0000; 0.0000; 0.0000; 0.0000; 0.0000; 0.2130; 0.0000; 0.0000; 0.2140;];
ksaix19 =[0.1700; -30.0000; 0.0000; 0.1700; 0.1750; 0.0000; -0.0000; 0.0000; 0.0000; 0.1710; -0.0000; -0.0000; 0.1720; 0.0000; 0.0000; -0.0000; 0.0000; 0.0000; 0.1730; 0.0000; -0.0000;];
ksaix20 =[0.1900; -90.0000; 0.0000; -0.0000; 0.1915; 0.0000; -0.0000; 0.1910; -0.0000; 0.0000; -0.0000; 0.0000; 0.0000; 0.1920; 0.0000; 0.0000; -0.0000; 0.1930; 0.0000; 0.1940; 0.0000;];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Reconstruction Error-a %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
count=0;
for N_m=1:21
count=count+1;
N_measurements=N_m;
N_basis=21;
Error_nonzero_a(count)=0;%initialization
Norm_a(count)=0;%initialization
for n=1:21
if n==1
Error_nonzero_a(count)=Error_nonzero_a(count)+(ksaix1(n)-ksaix1_real(n)+ksaix2(n)-ksaix2_real(n)+ksaix3(n)-ksaix3_real(n)+ksaix4(n)-ksaix4_real(n)+ksaix5(n)-ksaix5_real(n)+ksaix6(n)-ksaix6_real(n)+ksaix7(n)-ksaix7_real(n)+ksaix8(n)-ksaix8_real(n)+ksaix9(n)-ksaix9_real(n)+ksaix10(n)-ksaix10_real(n)+ksaix11(n)-ksaix11_real(n)+ksaix12(n)-ksaix12_real(n)+ksaix13(n)-ksaix13_real(n)+ksaix14(n)-ksaix14_real(n)+ksaix15(n)-ksaix15_real(n)+ksaix16(n)-ksaix16_real(n)+ksaix17(n)-ksaix17_real(n)+ksaix18(n)-ksaix18_real(n)+ksaix19(n)-ksaix19_real(n)+ksaix20(n)-ksaix20_real(n));
Norm_a(count)= Norm_a(count)+ksaix1_real(n)+ksaix2_real(n)+ksaix3_real(n)+ksaix4_real(n)+ksaix5_real(n)+ksaix6_real(n)+ksaix7_real(n)+ksaix8_real(n)+ksaix9_real(n)+ksaix10_real(n)+ksaix11_real(n)+ksaix12_real(n)+ksaix13_real(n)+ksaix14_real(n)+ksaix15_real(n)+ksaix16_real(n)+ksaix17_real(n)+ksaix18_real(n)+ksaix19_real(n)+ksaix20_real(n);
end
end
%Error_nonzero_a=(ksaix1(1)-ksaix1_real(1)+ksaix2(1)-ksaix2_real(1)+ksaix3(1)-ksaix3_real(1)+ksaix4(1)-ksaix4_real(1)+ksaix5(1)-ksaix5_real(1)+ksaix6(1)-ksaix6_real(1)+ksaix7(1)-ksaix7_real(1)+ksaix8(1)-ksaix8_real(1)+ksaix9(1)-ksaix9_real(1)+ksaix10(1)-ksaix10_real(1)+ksaix11(1)-ksaix11_real(1)+ksaix12(1)-ksaix12_real(1)+ksaix13(1)-ksaix13_real(1)+ksaix14(1)-ksaix14_real(1)+ksaix15(1)-ksaix15_real(1)+ksaix16(1)-ksaix16_real(1)+ksaix17(1)-ksaix17_real(1)+ksaix18(1)-ksaix18_real(1)+ksaix19(1)-ksaix19_real(1)+ksaix20(1)-ksaix20_real(1));
%Norm_a=ksaix1_real(1)+ksaix2_real(1)+ksaix3_real(1)+ksaix4_real(1)+ksaix5_real(1)+ksaix6_real(1)+ksaix7_real(1)+ksaix8_real(1)+ksaix9_real(1)+ksaix10_real(1)+ksaix11_real(1)+ksaix12_real(1)+ksaix13_real(1)+ksaix14_real(1)+ksaix15_real(1)+ksaix16_real(1)+ksaix17_real(1)+ksaix18_real(1)+ksaix19_real(1)+ksaix20_real(1);
RecError_nonzero_a(count)=mean((Error_nonzero_a(count)))/norm(Norm_a);
Data(count)=N_measurements/N_basis;
end
plot (Data,RecError_nonzero_a,'o-r')

Accepted Answer

Steven Lord
Steven Lord on 18 May 2023
Can you use variables with numbered names like a1, a2, a3, etc.? Yes.
Should you do this? The general consensus is no. That Answers post explains why this is generally discouraged and offers several alternative approaches.
I would store that data in vectors or matrices instead of many individual variables. This would reduce your code duplication significantly. Consider: would you want to use your approach if you had 200 or 2000 data points instead of just 20? I wouldn't. Too much risk of making a mistake in the copy-paste-modify workflow.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!