roussea18u

10 Reputation

2 Badges

8 years, 50 days

MaplePrimes Activity


These are replies submitted by roussea18u

Thanks a lot for your answer.

But how can I declare the arrays ? If I use z[t+1]:=array(1..N, datatype=float), is it correct ?

 

Sorry. Actually, it's easier with the code as text.

 

Newmark.mw

with(plots);

Newmark = proc (z0, u0, F0) local gam, beta, dt, c, kg, a, b, N, i, dF, dz, du, dw, T, m, k; dt := 0.1e-1; T := 4; N := T/dt; gam := .5; beta := .25; m := .320; k := 435; c := 2; z(0) := z0; u(0) := u0; F(0) := F0; w(0) := (F0-k*z0-c*u0)/m; t = linalg:-vector(i, 1); t[1, 1] = 0; for i from 2 to N do t(i, 1) = t(i-1, 1)+dt end do; kg := k+gam*c/(beta*dt)+m/(beta*dt*dt); a := m/(beta*dt)+gam*c/beta; b := .5*m/beta+dt*(.5*gam/beta-1)*c; for i from 2 to N do dF := proc (i) options operator, arrow; diff(F, t)+a*u(i)+b*w(i) end proc; dz := proc (i) options operator, arrow; dF(i)/kg end proc; du := proc (i) options operator, arrow; gam*dz(i)/(beta*dt)-gam*u(i-1)/beta+dt*(1-(1/2)*gam/beta)*w(i-1) end proc; dw := proc (i) options operator, arrow; du(i)/(beta*dt*dt)-u(i-1)/(beta*dt)-(1/2)*w(i-1)/beta end proc; z(i+1) = dz(i)+z(i); u(i+1) := du(i)+u(i); w(i+1) := dw(i)+w(i) end do; plot([z(i), u(i), w(i)], x = 0 .. 50, y = -50 .. 50) end proc

(1)

Newmark(2, 1, 0);

Newmark(2, 1, 0)

(2)

``

   

``

``

 

NULL

 

Page 1 of 1