Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

Answer to question number 1: End each equation with a semicolon.

Answer to question number 2: Write the equations side-by-side, separate them with commas.

Do this:

sol := rsolve({f(n)=f(n-1)+10*f(n-2), f(1)=1, f(2)=2},f(k));
simplify([seq(sol, k=1..10)]);


The result is
[1, 2, 12, 32, 152, 472, 1992, 6712, 26632, 93752]

Solve the PDE numerically:
restart;
pde := diff(u(t,x),t)=diff(u(t,x),x,x);
ic := u(0,x)=sin(x);
bc := D[2](u)(t,-1)=0, D[2](u)(t,1)=0;
pdsol := pdsolve(pde, {ic, bc}, numeric);

Plot the solution at time t=0.2:
pdsol:-plot(t=0.2);

Animate the solution for a sequence of times:
plots:-animate(pdsol:-plot, [t=time], time=0..2,
   font=[Times,20], axesfont=[Default,12], axes=normal);

 

You should end every statement in Maple with a semicolon.  That includes compound statements with "if", as in:
if a > 1 then
  some statement;
  another statement;
end if;     # note the terminating semicolon of the "if" statement

In certain cases the semicolon may be optionally omitted but you don't have to.  Always terminate your statements with semicolons and you will be alright.



 

I can't tell what the inner workings of Maple may be on this, but there seems to be some good excuse to justify its behavior.

Maple has no trouble in solving that implicit solution for y(x):
solve(sol, y(x));

However, the structure of the solution is displayed much more clearly if we specify an initial condition:
sol := dsolve({ode, y(0)=1}, y(x));
plot(rhs~([sol]), x=0..4);


We see that the initial value problem is ill-posed—the initial condition does not determine the solution uniquely!  The y(0)=1 is not significant; any initial condition (other than y(0)=0) leads to non-unique solutions.  Thus, asking for a solution y(x) is not a meaningful request, and that's perhaps the reason why Maple stays on the cautious side.

This worksheet mw.mw shows how.  In it I have corrected a typo (a missing negative sign) in your calculations.

That said, it's not clear to me why you bother with Rayleigh-Ritz which was invented way back when, before the age of computers.  A modern numerical solver can obtain a more accurate solution, more easily.

I don't know what the azimuth and polar angles are.  In the attached worksheet I have used the longitude and colatitude angles which are normally used in spherical coordinates.  Perhaps they mean the same thing.

spherical-cap.mw

 

The problem with your plot command is that it does not refer to sol which contains the numerical solution of the differential equation. What you want is
   
or equivalently
   

You may add time range and color options, as needed.

One solves an equation.  One evaluates an expression.  I think you mean evaluate, not solve.

Anyway, here it is:

evalf(BesselI(0, 0.012*(-1)^(1/4)*sqrt(1000)));
        

I am guessing that you encoded ϕc as ϕ[c]. That's the source of your trouble. Instead, encode it as ϕ__c, that is, ϕ, followed by two underscores, followed by c.

Since you have not specified the parameter values, I will take your inequality to be:

and let q = 3.

restart;
eq := 1 + 2*q - 2*K*(1+q)/N;
q := 3;
tmp := plot3d(eq, K=0..1, N=0..1, view=0..8,
   axes=boxed, labels=[K, N, Gamma],
   filled=[style=surface, transparency=0.2]);
plots:-display(tmp, view=0.01..8);

Your worksheet is presented as a horrible mess.  I did not not have the courage to wade through it completely.  It appears that it is suffering from the 2Dmath-hormone-imbalance-syndrome.  I suggest that you consider switching to 1D input, as described in Configureing Maple, although this may be too late for you since you need to start from a fresh worksheet—I don't know how to rescue an existing worksheet.

Anyway, here is the substitution that you are looking for:

subs(
    x__s_dot(t)=diff(x__s(t),t),
    y__s_dot(t)=diff(y__s(t),t),
    ...
    u__2_dot(t)=diff(u__2(t),t),
  xEQNS):

I have shown only three of the fifteen substitutions here.  You may add the missing twelve yourself.

 

As we see in mehdi jafari's response, the exact solution is too complicated to be useful.  A numeric solition is more useful in this case, but for that you need to specify initial conditions, such as:

ic := A1(0)=1, D(A1)(0)=2, A2(0)=3, D(A2)(0)=4, A3(0)=5, D(A3)(0)=6;
sol := dsolve({eq1, eq2, eq3, ic}, numeric);
plots:-odeplot(sol, [[t, A1(t)],[t, A2(t)],[t, A3(t)]], t=0..6, color=[red, green, blue]);

 

 

 

 

By using textplot(), you may place a text anywhere you want.  For example:

restart;
with(plots):
myfont := [Times,24]:
p1 := plot(x^2, x=-1..1);
p2 := textplot([-0.2, 0.8, typeset(y=x^2)], align=left, font=myfont);
display([p1,p2], labelfont=myfont);

 

I can't tell what you did to get to what you have shown.  Copy and paste the following into Maple—it should do what you want:
PDE := diff(u(x,t),t) = diff(u(x,t),x,x) + 2*u(x,t)^2*(1 - u(x,t));

 

First 39 40 41 42 43 44 45 Last Page 41 of 53