Xucu

15 Reputation

5 Badges

13 years, 108 days

MaplePrimes Activity


These are replies submitted by Xucu

Hello,

I used your method to get the solution for the second derivative, and it works.

Unfortunatley in my particular case the PDE is equated to a piecewise function, which seems to yield 0 for the the second derivative, on the domain on which the piecewise function was defined.

Any suggestions on why this could happen and how I can remedy the that.

Thank you

restart; alias(H = Heaviside);

ibc := {w(0, t) = 0, w(1, t) = 0, w(x, 0) = 0, (D[2](w))(x, 0) = 0, (D[1, 1](w))(0, t) = 0, (D[1, 1](w))(1, t) = 0}; pde4 := {diff(w(x, t), t, t)+v(x, t)+b(x, t) = piecewise(0 <= t and t <= 1, sin(t)*(H(x-0.1e-3-t)-H(x-0.1e-3-t+.1))), diff(w(x, t), t) = v(x, t), diff(w(x, t), `$`(x, 4)) = b(x, t)};

res4 := evalf(pdsolve(pde4, ibc, time = t, numeric, spacestep = 1/10, timestep = 1/10));

res4:-plot([25*w(x, t), [25*v(x, t), color = blue], [b(x, t), color = green]], x = 1/2, t = 0 .. 45);

res4:-plot(piecewise(0 <= t and t <= 1, sin(t)*(H(x-0.1e-3-t)-H(x-0.1e-3-t+.1)))-v(x, t)-b(x, t), x = 1/2, t = 0 .. 3*Pi);

Hello,

I used your method to get the solution for the second derivative, and it works.

Unfortunatley in my particular case the PDE is equated to a piecewise function, which seems to yield 0 for the the second derivative, on the domain on which the piecewise function was defined.

Any suggestions on why this could happen and how I can remedy the that.

Thank you

restart; alias(H = Heaviside);

ibc := {w(0, t) = 0, w(1, t) = 0, w(x, 0) = 0, (D[2](w))(x, 0) = 0, (D[1, 1](w))(0, t) = 0, (D[1, 1](w))(1, t) = 0}; pde4 := {diff(w(x, t), t, t)+v(x, t)+b(x, t) = piecewise(0 <= t and t <= 1, sin(t)*(H(x-0.1e-3-t)-H(x-0.1e-3-t+.1))), diff(w(x, t), t) = v(x, t), diff(w(x, t), `$`(x, 4)) = b(x, t)};

res4 := evalf(pdsolve(pde4, ibc, time = t, numeric, spacestep = 1/10, timestep = 1/10));

res4:-plot([25*w(x, t), [25*v(x, t), color = blue], [b(x, t), color = green]], x = 1/2, t = 0 .. 45);

res4:-plot(piecewise(0 <= t and t <= 1, sin(t)*(H(x-0.1e-3-t)-H(x-0.1e-3-t+.1)))-v(x, t)-b(x, t), x = 1/2, t = 0 .. 3*Pi);

Thank you for the elaborate answer, unfortunatley it yields 0 for my particular problem.

Thank you for the elaborate answer, unfortunatley it yields 0 for my particular problem.

@Carl Love do you think the second derivative of the solution should have a different formulation than the first derivative?

Do you have any hints on how the solution could converge faster?

Thanks!!

ptr_mplprims.mw

this is the worksheet that I have been working on, sorry for not uploading it the first time.

@PatrickT  I looked over them, the examples and explanations there really gave me insights on the events command, as much as I could understand, tough, as my programming skills are very low.

@Preben Alsholm  Thank you,  this is much more efficient than making a sequence for u(t)!

@Preben Alsholm  Thank you,  this is much more efficient than making a sequence for u(t)!

Thank you,

is it possible to change the sign for each timestep of the event, I was thinking of making a sequence...

eq:=diff(y(t),t,t)+u(t)-y(t)=0);
res:=dsolve({eq,y(0)=0,D(y)(0)=1,u(0)=0},numeric,output=listprocedure,
  discrete_variables=[u(t)::float,n(t)::float],
  events=[[t=0,u(t)=y(t)+diff(y(t),t)+0.02],[t=5,u(t)=y(t)+diff(y(t),t)-0.02],[t=10,u(t)=y(t)+diff(y(t),t)+0.02],[t=15,u(t)=y(t)+diff(y(t),t)-0.02],[t=[0,1/2]]);
plots:-odeplot(res,[[t,y(t)],[t,u(t)]],0..20);

 

Thank you,

is it possible to change the sign for each timestep of the event, I was thinking of making a sequence...

eq:=diff(y(t),t,t)+u(t)-y(t)=0);
res:=dsolve({eq,y(0)=0,D(y)(0)=1,u(0)=0},numeric,output=listprocedure,
  discrete_variables=[u(t)::float,n(t)::float],
  events=[[t=0,u(t)=y(t)+diff(y(t),t)+0.02],[t=5,u(t)=y(t)+diff(y(t),t)-0.02],[t=10,u(t)=y(t)+diff(y(t),t)+0.02],[t=15,u(t)=y(t)+diff(y(t),t)-0.02],[t=[0,1/2]]);
plots:-odeplot(res,[[t,y(t)],[t,u(t)]],0..20);

 

thank you a lot, this really speeds things up.

thank you a lot, this really speeds things up.

@Carl Love g=9.81. Thanks for answering.

 

Page 1 of 1