Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

Worksheet: mw.mw

Animation extracted fron worksheet mw.mw. The triangle marks the osculating plane. The red dot marks the center of curvature.

I don't have MapleSim but the animation can be produced quite easily in Maple; see the attached worksheet. Here is a sample demonstration where the left end is clamped and the right end is hinged, but you may change the boundary conditions in the worksheet as you wish.

Worksheet: animate-beam.mw

 

This should be self-explanatory:

restart;

solve(sin(Pi*t/T), t);

0

(1)

solve(sin(Pi*t/T), t, allsolutions);

_Z1*T

(2)

about(_Z1);

Originally _Z1, renamed _Z1~:
  is assumed to be: integer

 

 

 

Download mw.mw

 

I find your question quite vague, so here is my attempt to figure out what it is asking.  The calculation that follows is inconclusive.  You need to state more clearly what you have in mind.

Let's look at the PDE:

pde := a*diff(u(x,y,z),x,x) + b*diff(u(x,y,z),y,y) + c*diff(u(x,y,z),z,z) = 1;

a*(diff(diff(u(x, y, z), x), x))+b*(diff(diff(u(x, y, z), y), y))+c*(diff(diff(u(x, y, z), z), z)) = 1

(1)

Try a solution of the form u = f(x-2*y+z)

eval(pde, u(x,y,z)=f(x-2*y+z));

a*((D@@2)(f))(x-2*y+z)+4*b*((D@@2)(f))(x-2*y+z)+c*((D@@2)(f))(x-2*y+z) = 1

(2)

This is to hold for all x, y, z.  Let w = x-2*y+z

eval((2), x-2*y+z=w);

a*((D@@2)(f))(w)+4*b*((D@@2)(f))(w)+c*((D@@2)(f))(w) = 1

(3)

This is an ordinary differential equation for f(w).  Solve it:

dsolve((3), f(w));

f(w) = (1/2)*w^2/(a+4*b+c)+_C1*w+_C2

(4)

Restore the x, y, z variables:

u(x,y,z) = eval(rhs((4)), w=x+2*y+z);

u(x, y, z) = (1/2)*(x+2*y+z)^2/(a+4*b+c)+_C1*(x+2*y+z)+_C2

(5)

Let's verify that what we have obtained is indeed a solution of the PDE:

pdetest((5), pde);

0

(6)

So yes, what we have obtained is a solution.

 

Conclusion: We see that a solution of the form u = f(x-2*y+z) exists for
any choice of the coefficients a, b, c.  That is, requiring a solution of that form
does not determine the coefficients at all!

Here it is:

Worksheet: mw.mw

You did not provide your equations in the Maple input form, so I retyped them. I don't guarantee that I have made no mistakes. Check!

restart;

interface(imaginaryunit = IMunit):  # free the symbol I to use as a variable

fS := (1-p)*pi+phi*V+delta*R-(mu+lambda+theta)*S;
fV := p*pi+theta*S-(mu+epsilon*lambda+phi)*V;
fC := rho*lambda*S+rho*epsilon*lambda*V+(1-q)*eta*I-(mu+beta+chi)*C;
fI := (1-rho)*lambda*S+(1-rho)*epsilon*lambda*V+chi*C-(mu+alpha+eta)*I;
fR := beta*C+q*eta*I-(mu+delta)*R;

(1-p)*pi+phi*V+delta*R-(mu+lambda+theta)*S

 

p*pi+theta*S-(epsilon*lambda+mu+phi)*V

 

rho*lambda*S+rho*epsilon*lambda*V+(1-q)*eta*I-(mu+beta+chi)*C

 

(1-rho)*lambda*S+(1-rho)*epsilon*lambda*V+chi*C-(mu+alpha+eta)*I

 

beta*C+q*eta*I-(mu+delta)*R

(1)

endemic := solve({ fS, fV, fC, fI, fR },  { S, V, C, I, R } ):

Here is what S looks like.  Replace S by any of V, C, I, R to see the other four.

eval(S, endemic);

-pi*(-delta*epsilon*eta*lambda*mu*p*q*rho+alpha*beta*delta*epsilon*lambda*p*rho+beta*delta*epsilon*lambda*mu*p*rho-chi*epsilon*eta*lambda*mu*p*q+delta*epsilon*eta*lambda*mu*p*q-alpha*beta*delta*epsilon*lambda*p-alpha*beta*epsilon*lambda*mu*p-alpha*chi*delta*epsilon*lambda*p-alpha*chi*epsilon*lambda*mu*p-alpha*delta*epsilon*lambda*mu*p-alpha*epsilon*lambda*mu^2*p-beta*delta*epsilon*lambda*mu*p-beta*epsilon*eta*lambda*mu*p-beta*epsilon*lambda*mu^2*p+chi*delta*epsilon*eta*lambda*q-chi*delta*epsilon*lambda*mu*p-chi*delta*eta*mu*p*q+chi*epsilon*eta*lambda*mu*q-chi*epsilon*lambda*mu^2*p-chi*eta*mu^2*p*q-delta*epsilon*eta*lambda*mu*p-delta*epsilon*lambda*mu^2*p-epsilon*eta*lambda*mu^2*p-epsilon*lambda*mu^3*p+alpha*beta*delta*epsilon*lambda-alpha*beta*delta*mu*p+alpha*beta*epsilon*lambda*mu-alpha*beta*mu^2*p+alpha*chi*delta*epsilon*lambda-alpha*chi*delta*mu*p+alpha*chi*epsilon*lambda*mu-alpha*chi*mu^2*p+alpha*delta*epsilon*lambda*mu-alpha*delta*mu^2*p+alpha*epsilon*lambda*mu^2-alpha*mu^3*p+beta*delta*epsilon*eta*lambda+beta*delta*epsilon*lambda*mu-beta*delta*eta*mu*p-beta*delta*mu^2*p+beta*epsilon*eta*lambda*mu+beta*epsilon*lambda*mu^2-beta*eta*mu^2*p-beta*mu^3*p+chi*delta*epsilon*lambda*mu+chi*delta*eta*mu*q+chi*delta*eta*phi*q-chi*delta*mu^2*p+chi*epsilon*lambda*mu^2+chi*eta*mu^2*q+chi*eta*mu*phi*q-chi*mu^3*p+delta*epsilon*eta*lambda*mu+delta*epsilon*lambda*mu^2-delta*eta*mu^2*p-delta*mu^3*p+epsilon*eta*lambda*mu^2+epsilon*lambda*mu^3-eta*mu^3*p-mu^4*p+alpha*beta*delta*mu+alpha*beta*delta*phi+alpha*beta*mu^2+alpha*beta*mu*phi+alpha*chi*delta*mu+alpha*chi*delta*phi+alpha*chi*mu^2+alpha*chi*mu*phi+alpha*delta*mu^2+alpha*delta*mu*phi+alpha*mu^3+alpha*mu^2*phi+beta*delta*eta*mu+beta*delta*eta*phi+beta*delta*mu^2+beta*delta*mu*phi+beta*eta*mu^2+beta*eta*mu*phi+beta*mu^3+beta*mu^2*phi+chi*delta*mu^2+chi*delta*mu*phi+chi*mu^3+chi*mu^2*phi+delta*eta*mu^2+delta*eta*mu*phi+delta*mu^3+delta*mu^2*phi+eta*mu^3+eta*mu^2*phi+mu^4+mu^3*phi)/(-delta*epsilon*eta*lambda^2*mu*q*rho-delta*epsilon*eta*lambda*mu*q*rho*theta+alpha*beta*delta*epsilon*lambda^2*rho+alpha*beta*delta*epsilon*lambda*rho*theta+beta*delta*epsilon*lambda^2*mu*rho+beta*delta*epsilon*lambda*mu*rho*theta-chi*delta*epsilon*eta*lambda*mu*q-chi*epsilon*eta*lambda^2*mu*q-chi*epsilon*eta*lambda*mu^2*q-chi*epsilon*eta*lambda*mu*q*theta+delta*epsilon*eta*lambda^2*mu*q+delta*epsilon*eta*lambda*mu*q*theta-delta*eta*lambda*mu^2*q*rho-delta*eta*lambda*mu*phi*q*rho-alpha*beta*delta*epsilon*lambda^2-alpha*beta*delta*epsilon*lambda*mu-alpha*beta*delta*epsilon*lambda*theta+alpha*beta*delta*lambda*mu*rho+alpha*beta*delta*lambda*phi*rho-alpha*beta*epsilon*lambda^2*mu-alpha*beta*epsilon*lambda*mu^2-alpha*beta*epsilon*lambda*mu*theta-alpha*chi*delta*epsilon*lambda^2-alpha*chi*delta*epsilon*lambda*mu-alpha*chi*delta*epsilon*lambda*theta-alpha*chi*epsilon*lambda^2*mu-alpha*chi*epsilon*lambda*mu^2-alpha*chi*epsilon*lambda*mu*theta-alpha*delta*epsilon*lambda^2*mu-alpha*delta*epsilon*lambda*mu^2-alpha*delta*epsilon*lambda*mu*theta-alpha*epsilon*lambda^2*mu^2-alpha*epsilon*lambda*mu^3-alpha*epsilon*lambda*mu^2*theta-beta*delta*epsilon*eta*lambda*mu-beta*delta*epsilon*lambda^2*mu-beta*delta*epsilon*lambda*mu^2-beta*delta*epsilon*lambda*mu*theta+beta*delta*lambda*mu^2*rho+beta*delta*lambda*mu*phi*rho-beta*epsilon*eta*lambda^2*mu-beta*epsilon*eta*lambda*mu^2-beta*epsilon*eta*lambda*mu*theta-beta*epsilon*lambda^2*mu^2-beta*epsilon*lambda*mu^3-beta*epsilon*lambda*mu^2*theta-chi*delta*epsilon*lambda^2*mu-chi*delta*epsilon*lambda*mu^2-chi*delta*epsilon*lambda*mu*theta-chi*delta*eta*mu^2*q-chi*delta*eta*mu*phi*q-chi*delta*eta*mu*q*theta-chi*epsilon*lambda^2*mu^2-chi*epsilon*lambda*mu^3-chi*epsilon*lambda*mu^2*theta-chi*eta*lambda*mu^2*q-chi*eta*lambda*mu*phi*q-chi*eta*mu^3*q-chi*eta*mu^2*phi*q-chi*eta*mu^2*q*theta-delta*epsilon*eta*lambda^2*mu-delta*epsilon*eta*lambda*mu^2-delta*epsilon*eta*lambda*mu*theta-delta*epsilon*lambda^2*mu^2-delta*epsilon*lambda*mu^3-delta*epsilon*lambda*mu^2*theta+delta*eta*lambda*mu^2*q+delta*eta*lambda*mu*phi*q-epsilon*eta*lambda^2*mu^2-epsilon*eta*lambda*mu^3-epsilon*eta*lambda*mu^2*theta-epsilon*lambda^2*mu^3-epsilon*lambda*mu^4-epsilon*lambda*mu^3*theta-alpha*beta*delta*lambda*mu-alpha*beta*delta*lambda*phi-alpha*beta*delta*mu^2-alpha*beta*delta*mu*phi-alpha*beta*delta*mu*theta-alpha*beta*lambda*mu^2-alpha*beta*lambda*mu*phi-alpha*beta*mu^3-alpha*beta*mu^2*phi-alpha*beta*mu^2*theta-alpha*chi*delta*lambda*mu-alpha*chi*delta*lambda*phi-alpha*chi*delta*mu^2-alpha*chi*delta*mu*phi-alpha*chi*delta*mu*theta-alpha*chi*lambda*mu^2-alpha*chi*lambda*mu*phi-alpha*chi*mu^3-alpha*chi*mu^2*phi-alpha*chi*mu^2*theta-alpha*delta*lambda*mu^2-alpha*delta*lambda*mu*phi-alpha*delta*mu^3-alpha*delta*mu^2*phi-alpha*delta*mu^2*theta-alpha*lambda*mu^3-alpha*lambda*mu^2*phi-alpha*mu^4-alpha*mu^3*phi-alpha*mu^3*theta-beta*delta*eta*mu^2-beta*delta*eta*mu*phi-beta*delta*eta*mu*theta-beta*delta*lambda*mu^2-beta*delta*lambda*mu*phi-beta*delta*mu^3-beta*delta*mu^2*phi-beta*delta*mu^2*theta-beta*eta*lambda*mu^2-beta*eta*lambda*mu*phi-beta*eta*mu^3-beta*eta*mu^2*phi-beta*eta*mu^2*theta-beta*lambda*mu^3-beta*lambda*mu^2*phi-beta*mu^4-beta*mu^3*phi-beta*mu^3*theta-chi*delta*lambda*mu^2-chi*delta*lambda*mu*phi-chi*delta*mu^3-chi*delta*mu^2*phi-chi*delta*mu^2*theta-chi*lambda*mu^3-chi*lambda*mu^2*phi-chi*mu^4-chi*mu^3*phi-chi*mu^3*theta-delta*eta*lambda*mu^2-delta*eta*lambda*mu*phi-delta*eta*mu^3-delta*eta*mu^2*phi-delta*eta*mu^2*theta-delta*lambda*mu^3-delta*lambda*mu^2*phi-delta*mu^4-delta*mu^3*phi-delta*mu^3*theta-eta*lambda*mu^3-eta*lambda*mu^2*phi-eta*mu^4-eta*mu^3*phi-eta*mu^3*theta-lambda*mu^4-lambda*mu^3*phi-mu^5-mu^4*phi-mu^4*theta)

(2)

 

Download mw.mw

As to your question "Or solve by hand?": I don't think you would want to do that.

General advice: It is important to distinguish between the assignment operator ":=" and the equality operator "=".  The primary purpose of the assignment operator ":=",, is to define labels for expressions to make it easier to refer to them later.  Clearly you don't intend ω as a mere label, rather, you intend ω to enter as a variable in your equations.

So this is what you need to do:

rels1 := diff(phi(t),t) + diff(beta(t),t) = omega(t);
rels2 := diff(rels1, t);
simplify(myvector, {rels1, rels2});

Note how rels1 and rels2 serve as labels for their respective equations.

 

Let's begin by looking at the expression which is being summed:

1/r*sin(r*Pi*x/2)*exp(-lambda^2*t);

sin((1/2)*r*Pi*x)*exp(-lambda^2*t)/r

(1)

What is lambda?  I suppose that you know enough about the heat equation to know

that lambda is supposed to be Pi*r/2, so let's fix it:

subs(lambda=Pi*r/2, (1));

sin((1/2)*r*Pi*x)*exp(-(1/4)*Pi^2*r^2*t)/r

(2)

But r is supposed to range over the odd integers, therefore we replace it by 2*r-1:

subs(r=2*r-1, (2));

sin((1/2)*(2*r-1)*Pi*x)*exp(-(1/4)*Pi^2*(2*r-1)^2*t)/(2*r-1)

(3)

Now we form the desired sum (note the cappital letter S):

40/Pi * Sum((3), r=1..infinity);

40*(Sum(sin((1/2)*(2*r-1)*Pi*x)*exp(-(1/4)*Pi^2*(2*r-1)^2*t)/(2*r-1), r = 1 .. infinity))/Pi

(4)

This is what you wish to call u(x,t), so let's do it:

u := unapply((4), [x,t]);

proc (x, t) options operator, arrow; 40*(Sum(sin((1/2)*(2*r-1)*Pi*x)*exp(-(1/4)*Pi^2*(2*r-1)^2*t)/(2*r-1), r = 1 .. infinity))/Pi end proc

(5)

To plot u(x,t), we limit the summation to N terms:

N := 50: eval(u(x,t), infinity=N);

40*(Sum(sin((1/2)*(2*r-1)*Pi*x)*exp(-(1/4)*Pi^2*(2*r-1)^2*t)/(2*r-1), r = 1 .. 50))/Pi

(6)

Now we are ready to plot:

plot3d((6), x=0..2, t=0..1, style=patchcontour);

 

 

 

 

Download mw.mw

restart;
f:=n->piecewise(n=0,1,n>=1,sum('f(k)',k=0..n-1));
seq(f(i), i=0..10);
        1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512

You have

plot(l, ....);

What is l? It is not defined as far as I can tell.  Perhaps you wanted to say

plot(x[1], ....);

I may not be understanding your question correctly, but perhaps the following can help.

restart;

Consider the function  u(x) defined on the interval "-Pi < x < Pi." Its Fourier series is given by

Sum(Int(exp(I*n*x)*u(x), x=-Pi..Pi)*exp(-I*n*x), n=-infinity..infinity) / (2*Pi);

(1/2)*(Sum((Int(exp(I*n*x)*u(x), x = -Pi .. Pi))*exp(-I*n*x), n = -infinity .. infinity))/Pi

(1)

Example: Let's calculate the Fourier series of the function

f := piecewise(x<0, 0, x);

f := piecewise(x < 0, 0, x)

(2)

subs(u(x)=f, (1)):
value(%);

(1/2)*(sum(-(I*exp(I*Pi*n)*Pi*n-exp(I*Pi*n)+1)*exp(-I*n*x)/n^2, n = -infinity .. infinity))/Pi

(3)

As you have noted, there is an n in the denominator, but Maple is smart enough to handle it correctly as we see here where we sum over "n=-1, 0, 1," so we need not worry about it:

eval((3), infinity=1):
evalc(%);

(-2*cos(x)+Pi*sin(x)+(1/4)*Pi^2)/Pi

(4)

Of course, that's too few terms.  By taking a larger number of terms we get a pretty good approximation:

eval((3), infinity=20):
evalc(%);

(-2*cos(x)+(1/4)*Pi^2+Pi*sin(x)-(2/81)*cos(9*x)-(2/49)*cos(7*x)-(2/25)*cos(5*x)-(2/9)*cos(3*x)-(2/289)*cos(17*x)+(1/9)*Pi*sin(9*x)+(1/5)*Pi*sin(5*x)+(1/7)*Pi*sin(7*x)+(1/3)*Pi*sin(3*x)+(1/17)*Pi*sin(17*x)+(1/13)*Pi*sin(13*x)+(1/15)*Pi*sin(15*x)+(1/11)*Pi*sin(11*x)+(1/19)*Pi*sin(19*x)-(2/225)*cos(15*x)-(2/169)*cos(13*x)-(2/121)*cos(11*x)-(2/361)*cos(19*x)-(1/4)*Pi*sin(4*x)-(1/6)*Pi*sin(6*x)-(1/10)*Pi*sin(10*x)-(1/2)*Pi*sin(2*x)-(1/12)*Pi*sin(12*x)-(1/8)*Pi*sin(8*x)-(1/14)*Pi*sin(14*x)-(1/16)*Pi*sin(16*x)-(1/20)*Pi*sin(20*x)-(1/18)*Pi*sin(18*x))/Pi

(5)

Here are the graphs of the original function (in red) and its Fourier series representation (in blue).

plot([(5),f], x=-Pi..Pi, thickness=2, color=[blue, red], legend=[Fourier_Series, u(x)=f]);

 
 

 

Download FourierSeries.mw

Solving this PDE is a textbook example an application of the Fourier series.  Tomleslie has already sketched the first half of the process.  In the attached worksheet I have carried it out all the way to the end.  There is one correction, however.  Tomleslie's calculations end up with X(x) expressed as an exponential function and Y(y) as a trigonometric function.  That won't work.  It should be the other way around in order to satisfy the boundary conditions bc[3] and bc[4].  The solution turns out to be

u(x, y) = Sum(4*((-1)^n-1)*sin(Pi*n*x)*cosh(n*Pi*y)/(n^3*Pi^3*cosh(n*Pi)), n = 1 .. infinity)

 

which agrees with what Maple 2017's pdsolve() produces, as shown by Kitonum.

Here's what the solution looks like:

Worksheet:   mw.mw

Update: The previous worksheet had a couple of careless typos, although the final solution was correct.  In this new version I have fixed the typos.

Worksheet ver 2: mw-ver2.mw

 

@Bendesarts After fixing the brackets issue we can make some progress but the results are not very encouraging.  Let's assume all variables other than g are positive:

indets(TableauRouth) minus {g}:
(x -> x>0)~(%):
rels := %[]
;

                  rels := 0 < ca, 0 < ka, 0 < keqc, 0 < ma, 0 < meqc, 0 < p

and then try the easier task of solving the equality TableauRouth[4,1]=0 for g:

solve(TableauRouth[4,1]=0, g) assuming rels;

If you try that, you will see that Maple does succeed in solving the equation but the result is so huge as to being useless. This tells us that there is no simple necessary and sufficient condition in terms of g for the stability of your system.

 

You should refer to matrix entries through square brackets, not parentheses.

Change TableauRouth(2,1)  to TableauRouth[2,1] to fix the Maple coding problem.  After that you will have to deal with the mathematics of your question, and that may not be very easy.

 

First 35 36 37 38 39 40 41 Last Page 37 of 53