Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

@Aminaple The idea suggested by Dr. Venkat Subramanian is quite good and I like it better than the solution that I presented earlier.  Here are the details of this alternative approach.

restart;

We convert the 2nd order differential equation to a system of 1st order differential
equations by introducing y(t) as the derivative of x(t)

de1 := diff(x(t),t)=y(t);

diff(x(t), t) = y(t)

Then replace "x ' (t) " and x*''*t with y(t) and "y ' (t)" in the differential equation and rearrange:

diff(y(t),t) + 2/25*y(t) + 4*x(t) = (1/25*diff(y(t),t) + 2/3*y(t) + 5/2*x(t)) * x(t-d):
isolate(%, diff(y(t),t)):
de_tmp1 := collect(%, x(t-d));

diff(y(t), t) = (((2/3)*y(t)+(5/2)*x(t))*x(t-d)-(2/25)*y(t)-4*x(t))/(1-(1/25)*x(t-d))

When t < d, the term x(t-d) picks up its values from the history, let call it "h(t)," so the differential

equation really has the form

de_tmp0 := subs(x(t-d)=h(t-d), de_tmp1);

diff(y(t), t) = (((2/3)*y(t)+(5/2)*x(t))*h(t-d)-(2/25)*y(t)-4*x(t))/(1-(1/25)*h(t-d))

Furthermore, when t < 0, we want y(t) to conform to the history, that is,  "y(t)=h ' (t)"  Therefore
"y ' (t) = h ' ' (t)."   We combine the three cases into a single differential equation:

de2 := diff(y(t),t) = piecewise(t<0, (D@@2)(h)(t), t<d, rhs(de_tmp0), rhs(de_tmp1));

de2 := diff(y(t), t) = piecewise(t < 0, ((D@@2)(h))(t), t < d, ((2*y(t)*(1/3)+5*x(t)*(1/2))*h(t-d)-2*y(t)*(1/25)-4*x(t))/(1-(1/25)*h(t-d)), ((2*y(t)*(1/3)+5*x(t)*(1/2))*x(t-d)-2*y(t)*(1/25)-4*x(t))/(1-(1/25)*x(t-d)))

The initial conditions at t = -d  are determined by the history function:

ic := x(-d) = h(-d), y(-d) = D(h)(-d);

x(-d) = h(-d), y(-d) = (D(h))(-d)

It's time to introduce the history function and the delay:

params := { h = cos,  d = 6/7 };

{d = 6/7, h = cos}

So our system looks like this:

sys := eval({de1, de2, ic}, params);

sys := {diff(x(t), t) = y(t), diff(y(t), t) = piecewise(t < 0, -cos(t), t < 6/7, ((2*y(t)*(1/3)+5*x(t)*(1/2))*cos(t-6/7)-2*y(t)*(1/25)-4*x(t))/(1-(1/25)*cos(t-6/7)), ((2*y(t)*(1/3)+5*x(t)*(1/2))*x(t-6/7)-2*y(t)*(1/25)-4*x(t))/(1-(1/25)*x(t-6/7))), x(-6/7) = cos(6/7), y(-6/7) = sin(6/7)}

We solve the system and plot the result

dsol := dsolve(sys, numeric):

plots:-odeplot(dsol, [t,x(t)], t=-eval(d, params)..12);

The graph agrees with what I had obtained with the earlier method.

 

Download mw2.mw

 

 

@Neel 

In the forced case you will have
"((&PartialD;)^2w)/((&PartialD;)^( )t^2)+1/(c^(2))((&PartialD;)^(4)w)/((&PartialD;)^( )x^(4))=f(x,t)".

To solve, express both w(x, t) and f(x, t) in terms of the modal functions

"w(x,t)=(&sum;)`alpha__j`(t)*`u__j`(x),  f(x,t)=(&sum;)`beta__j`(t)*`u__j`(x),"

where the coefficients `&beta;__j`(t) are known but `&alpha;__j`(t) are unknown.

Plug this into the PDE, and equate the coefficients of u__j(x).

That will give you an ODE of the form "`alpha__j`' ' + `h__j`*`alpha__j`=`beta__j`" for each j.
Solve those ODEs for `&alpha;__j`(t) and plug the result in the expression

w(x, t) given above.

 

 

 

@Neel What are the boundary condtions?  I cannot tell by reading through your worksheet.

@janhardo Your interpretation of my calculations is quite correct.  Well done!

@AHSAN Even after changing q(y)=j to u(y)=j the problem still makes no sense.  The "bc" and "bc1" in your formulation stand for "boundary condition" but you have not said where the boundaries are.

Go to where you found the problem, read it carefully, then come back with the correct statement.

 

I looked through your worksheets but was unable to understand them.  It will be very helpful to your readers to have some verbal description of the purpose of the worksheets.  You may want to supply the following information:

  1. It appears that you are solving the PDE 

    with the initial conditions u=(x,0)=sin(Pi*x), diff(u(x,t),t)=0 on the interval (0.1).  Is that correct?
  2. You state the boundary conditions as
    bc1:=u(x,t):        bc2:=u(x,t):
    I don't know that those mean.  Explain.
  3. It appears that you discretize the equation through centered finite differencing in the x direction. Is that correct?
  4. Then you discretize the equations in the time direction in some way.  That does not seem to be consistent with your stated objective of applying the method of lines, which approaches the problem through solving a system of ODEs, but perhaps I have misunderstood.  Explain.
  5. What is the idea behind your non-classical method?
  6. You write "I need to compare the result of the method with the exact solution".  What is the exact solution?
  7. You must know that you may solve your PDE with Maple's pdsolve() (numerically).  You are aware of that, aren't you?
  8. Why have you posted two worksheets?  What is the purpose of each?  Provide a guide.

 

@janhardo There are neither double integrals nor polar coordinates there.  The area is calculated by simple integration in Cartesian coordinates.

@AHSAN Your bc says q(y) = 0.  Your bc1 says q(y) = j .  Do you want both?

 

@Fancypants Yes, equation (20) looks good.

@Fancypants Okay, that's better.  Now you have an ODE for S[y](t).  The ODE involves phi(t), psi(t), theta(t), f(t), etc., with various subscripts.  Are those known/given functions?  If so, then your equation (13) is a simple second order linear ODE which is trivial to solve.  On the other hand, if you expect to determine the functions phi(t), psi(t), theta(t), f(t), etc,, then you need to provide additional equations.  In general, you need the number of equations to be equal to the numbers of unknowns.

 

 

 

 

@Fancypants In the worksheet you say that you expect partial_py1 to have terms involving the derivatives of S[y](t) with respect to py1.  But Maple hasn't been told that S[y](t) depends on py1, therefore it sets all those derivatives to zero.

There may be other errors in the worksheet but I don't quite see the aim of your calculations, and therefore I cannot suggest a remedy.

 

@spinoza Are you going to pass the solutions that you have obtained here as your own?  Or are you going to tell your teacher that Carl/Kitonum solved them for you?

@Subhan331 I ask again: Why do you need Maple code for an algorithm that produces nonsense?  I wouldn't waste my time on that, and nor should you.

As a student and a beginner, you should spend your time on more productive pursuits.

 

 

I have no problem with "with(combinat)" in Maple2017 and Maple2020 on Linux.  I suspect that you have typed something incorrectly.  Post your worksheet so that people can examine the source of the error.

To post a worksheet, reply to this message, and note the big fat green arrow in the toolbar of the window where you compose your reply.  Click on that arrow to upload your worksheet.

 

@Subhan331 Doing the exercise that I noted takes just a few lines of simple calculations by hand.  What's the point of writing Maple code if the algorithm produces nonsense?

As to fractional order derivatives, isn't is too soon to jump into that?  See if you can make sense of the algorithm applied to traditional PDEs first.

 

First 36 37 38 39 40 41 42 Last Page 38 of 99