Hey, I'm trying to solve the following differential equation with an ode solver:
tspan = [ta te];
ic = 1;
opts = odeset('RelTol',1e-2,'AbsTol',1e-4);
[t,u]=ode113(@(t,u) fu1_SS(t,u,u0,Pt,A,zusFG),[ta te],u0,opts);
function u=fu1_SS(t,u,u0,Pt,A,zusFG)
A=A.';
A = interp1(Pt,A,t); % Interpolate the data set (P,A) at time t
A=A.';
u=zeros((nodes*ld+3*zusFG)*2,1); % 1:nodes*ld Displacement, nodes*ld+1:nodes*ld*2 Velocity
du=zeros((nodes*ld+3*zusFG)*2,1); % 1:nodes*ld Velocity, nodes*ld+1:nodes*ld*2 Acceleration
du(1:nodes*ld+3*zusFG,1)=u(nodes*ld+3*zusFG+1:(nodes*ld+3*zusFG)*2,1); % du(1)=u(2)
u(1:nodes*ld+3*zusFG,1)=K\(A-M*du(nodes*ld+3*zusFG+1:(nodes*ld+3*zusFG)*2,1)-C*u(nodes*ld+3*zusFG+1:(nodes*ld+3*zusFG)*2,1)); %Displacement u(1)=K\(P-M*du(2)-C*u(2))
end
nodes are the Nodes of the wind turbine, ld are the degrees of freedom, zusFG are additional degrees of freedom of the soil. M, C and K are matrices which declare the system (mass, damping and stiffness). Pt is the time vector to interpolate A. A is the wind load, which consists out of a load vector for every node. The Problem is, that the displacement is becoming larger and larger instead of oscillating about one constant value...
Does anybody have an idea where the problem is?
Thanks for you help in advance!

 채택된 답변

Torsten
Torsten 2016년 7월 26일

0 개 추천

I don't understand this line in your code.
u(1:nodes*ld+3*zusFG,1)=K\(A-M*du(nodes*ld+3*zusFG+1:(nodes*ld+3*zusFG)*2,1)-C*u(nodes*ld+3*zusFG+1:(nodes*ld+3*zusFG)*2,1)); %Displacement u(1)=K\(P-M*du(2)-C*u(2))
u is the solution variable - you can't determine or prescribe it here. You will have to prescribe velocity in
du(1:nodes*ld+3*zusFG)
and acceleration in
du( nodes*ld+3*zusFG+1:(nodes*ld+3*zusFG)*2)
if your function has the form
function du=fu1_SS(t,u,u0,Pt,A,zusFG)
Best wishes
Torsten.

댓글 수: 1

Hey Torsten, thanks again, that did already help!! Only problem is now, that even if I'm using an stiff ode solver (ode15s), matlab interrupts the calculation at t approximately equal to 0.27s, although my tspan is 45s... and now my deflections become so small, the output vector is only giving out zeros... do you have a suggestion which ode solver I could use? I'll send you the code again:
tspan = [ta te];
opts = odeset('RelTol',1e-2,'AbsTol',1e-4);
[t,u]=ode15s(@(t,u) fu1_SS(t,u,Pt,A,zusFG),[ta te],u0,opts);
function du=fu1_SS(t,u,Pt,A,zusFG)
A=A.';
A = interp1(Pt,A,t); % Interpolate the data set (P,A) at time t
A=A.';
du(1:nodes*ld+3*zusFG,1)=u(nodes*ld+3*zusFG+1:(nodes*ld+3*zusFG)*2,1); % du(1)=u(2)
du(nodes*ld+1+3*zusFG:(nodes*ld+3*zusFG)*2,1)=M\(A-K*u(1:nodes*ld+3*zusFG,1)-C*u(nodes*ld+3*zusFG+1:(nodes*ld+3*zusFG)*2,1)); %Acceleration %du(2)=M\(P-K*u(1)-C*u(2))
end
Thank you again!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by