Home > other >  Dear teacher, I want to take advantage of MATLAB consult a solution based on the ground motion excit
Dear teacher, I want to take advantage of MATLAB consult a solution based on the ground motion excit

Time:10-06

Myfun2 below and the main function, to realize the ug in equation form into a set of ground motion acceleration are applied to solve the incentive form
I do not know how should would impose the ground motion equation, also hope that teachers can guide, the younger brother thanked here: D


myfun2 function part of writing is as follows:
The function of dy=myfun2 (t, y, x1, x2, g, H, alpha)
B=tan (alpha) * H;
R=SQRT (B ^ 2 + H ^ 2);
P=SQRT (3 */4 g/R);
Wp=x1 * p;
Ap=x2 * g * tan (alpha);
Phi=asin (alpha * g/ap);
Ug=ap * cos (wp * t). * (t<=2);
Dy=zeros (2, 1);
Dy (1)=y (2);
Dy (2)=- p ^ 2 * (sin (alpha * sign (y) (1) - (1) y) + ug/g * cos (alpha * sign (y (1)) - y (1)));
End




main function part is as follows:
The clear
CLC
Close all
G=9.8;
H=7.11;
Alpha=15/180 * PI;
B=tan (alpha) * H;
R=SQRT (B ^ 2 + H ^ 2);
P=SQRT (3 */4 g/R);
T=0-0. 0001:10;
X1=PI/p;
X2=0.53/tan (alpha);
Aa=0;
Cc=0;
Theta=[];
T_new=T;
While length (T_new)
/t, y=ode23s (@ (t, y) myfun2 (t, y, x1, x2, g, H, alpha), T_new, [aa, cc]);
The index=find (sign (y (1: end - 1, 1)). * sign (y (2: end, 1))==1);
If isempty (index)
Theta=[is] y;
break;
The else
Theta=[theta, y (1: index (1) - 1, :)];
T_new=T_new (index (1) : end);
Aa=y (index (1) + 1, 1);
Cc=y (index (1), 2) * (1 - l * (sin (alpha)) ^ 2);
End
End
Wp=x1 * p;
Ap=x2 * g * tan (alpha);
Phi=asin (alpha * g/ap);
Ug=ap * cos (wp * T). * (T<=2);
Subplot (3,1,1)
The plot (T (1, 1: length (ug) ', ug/g)
The axis ([0, 10, 0.5, 0.5])
Subplot (3,1,2)
The plot (T, theta (:, 1)/alpha)
The axis ([0, 10, 1.5, 1.5])
Subplot (3,1,3)
The plot (T, theta (:, 2)/p)
The axis ([0, 10, 0.5, 0.5])