delvin

35 Reputation

5 Badges

2 years, 347 days

MaplePrimes Activity


These are replies submitted by delvin

@tomleslie 

  

  Thank you for taking time out of your busy day.
   Sincerely,

   delvin

@rcorless 

   The equation is correct, but I didn't pay attention, I wrote some in my own language,sorry.

@Rouben Rostamian  

   Sorry, I was not paying attention.

      Thanks ocean.

@tomleslie 

 Ok, I want to check the different solutions of the equation.

 

  Thanks a million, You made my day.

 

@tomleslie 

   Thank osean very much for your time.

 "Because the answers are not what I want , The answers obtained are obvious."

m4.mw

@Joe Riel 

This is the code I wrote, but it didn't get a good answer

restart

with(student)

U := a[0]+sum(-a[i]*tanh(xi[n])^i, i = 1 .. 1)+sum(-b[i]*tanh(xi[n])^(-i), i = 1 .. 1)

a[0]-a[1]*tanh(xi[n])-b[1]/tanh(xi[n])

(1)

u(xi[n+1]) := a[0]-a[1]*(tanh(xi[n])+tanh(d))/(1+tanh(xi[n])*tanh(d))-b[1]*(1+tanh(xi[n])*tanh(d))/(tanh(xi[n])+tanh(d))

a[0]-a[1]*(tanh(xi[n])+tanh(d))/(1+tanh(xi[n])*tanh(d))-b[1]*(1+tanh(xi[n])*tanh(d))/(tanh(xi[n])+tanh(d))

(2)

u(xi[n-1]) := a[0]-a[1]*(tanh(xi[n])-tanh(d))/(1+tanh(xi[n])*tanh(d))-b[1]*(1+tanh(xi[n])*tanh(d))/(tanh(xi[n])-tanh(d))

a[0]-a[1]*(tanh(xi[n])-tanh(d))/(1+tanh(xi[n])*tanh(d))-b[1]*(1+tanh(xi[n])*tanh(d))/(tanh(xi[n])-tanh(d))

(3)

eq := c*(diff(U, xi))-(U^2+U*beta+alpha)*(u(xi[n+1])-u(xi[n-1]))

-((a[0]-a[1]*tanh(xi[n])-b[1]/tanh(xi[n]))^2+(a[0]-a[1]*tanh(xi[n])-b[1]/tanh(xi[n]))*beta+alpha)*(-a[1]*(tanh(xi[n])+tanh(d))/(1+tanh(xi[n])*tanh(d))-b[1]*(1+tanh(xi[n])*tanh(d))/(tanh(xi[n])+tanh(d))+a[1]*(tanh(xi[n])-tanh(d))/(1+tanh(xi[n])*tanh(d))+b[1]*(1+tanh(xi[n])*tanh(d))/(tanh(xi[n])-tanh(d)))

(4)

U := a[0]-a[1]*tanh(xi[n])-b[1]/tanh(xi[n])

a[0]-a[1]*tanh(xi[n])-b[1]/tanh(xi[n])

(5)

simplify(eq); fin1 := simplify(numer(%))

-2*(tanh(xi[n])^4*a[1]^2-a[1]*(beta+2*a[0])*tanh(xi[n])^3+(beta*a[0]+a[0]^2+2*a[1]*b[1]+alpha)*tanh(xi[n])^2-b[1]*(beta+2*a[0])*tanh(xi[n])+b[1]^2)*tanh(d)*((b[1]*tanh(d)^2-a[1])*tanh(xi[n])^2+2*tanh(xi[n])*tanh(d)*b[1]+tanh(d)^2*a[1]+b[1])

(6)

subs(tanh(xi[n]) = Psi, fin1); fin := simplify(%)

2*(Psi^4*a[1]^2-a[1]*(beta+2*a[0])*Psi^3+(beta*a[0]+a[0]^2+2*a[1]*b[1]+alpha)*Psi^2-b[1]*(beta+2*a[0])*Psi+b[1]^2)*((-Psi^2*b[1]-a[1])*tanh(d)^2-2*Psi*tanh(d)*b[1]+Psi^2*a[1]-b[1])*tanh(d)

(7)

for i from 0 to degree(fin, Psi) do EQ[i] := simplify(coeff(fin, Psi, i)) end do

2*a[1]^2*(-b[1]*tanh(d)^2+a[1])*tanh(d)

(8)

Eqs := {seq(EQ[i], i = 0 .. 6)}

Sol := solve(Eqs, {c, a[1], b[1]})

{c = c, a[1] = 0, b[1] = 0}

(9)

 

Download m3.mw

@acer 

okey

@dharr thanks an ocean

@dharr Thanks

NULL

restart;
with(PDEtools):


pde2:=-lambda*diff(y(xi),xi)+y(xi)*diff(y(xi),xi)+diff(y(xi),xi$2)=0;

-lambda*(diff(y(xi), xi))+y(xi)*(diff(y(xi), xi))+diff(diff(y(xi), xi), xi) = 0

(1)

 

NULL

phi(xi):=(p[1]*exp(q[1]*xi)+p[2]*exp(q[2]*xi))/(p[3]*exp(q[3]*xi)+p[4]*exp(q[4]*xi));
eval(phi(xi),[p[1]=I,p[2]=-I,p[3]=1,p[4]=1,q[1]=I,q[2]=-I,q[3]=I,q[4]=-I]);
simplify(%);
phi(xi):=%;
U(xi):=A[0]+sum(A[d]*phi(xi)^d,d=1)+sum(B[d]*phi(xi)^(-d),d=1);

(p[1]*exp(q[1]*xi)+p[2]*exp(q[2]*xi))/(p[3]*exp(q[3]*xi)+p[4]*exp(q[4]*xi))

 

(I*exp(I*xi)-I*exp(-I*xi))/(exp(I*xi)+exp(-I*xi))

 

-sin(xi)/cos(xi)

 

-sin(xi)/cos(xi)

 

A[0]-A[1]*sin(xi)/cos(xi)-B[1]*cos(xi)/sin(xi)

(2)

subs(y(xi)=U(xi),pde2);

-lambda*(diff(A[0]-A[1]*sin(xi)/cos(xi)-B[1]*cos(xi)/sin(xi), xi))+(A[0]-A[1]*sin(xi)/cos(xi)-B[1]*cos(xi)/sin(xi))*(diff(A[0]-A[1]*sin(xi)/cos(xi)-B[1]*cos(xi)/sin(xi), xi))+diff(diff(A[0]-A[1]*sin(xi)/cos(xi)-B[1]*cos(xi)/sin(xi), xi), xi) = 0

(3)
 

 

Download test1.mw

@Rouben Rostamian

Thanks an ocean

@Rouben Rostamian 

 

Dear Rouben Rostamian,

thank you for your explanation. You can see where this last part of the code is wrong. It is for balancing and obtaining the balance number.

@Rouben Rostamian  

hi,thank you

 

Thank you very much for your help
Where is this code wrong?


>
Error, `>` unexpected
restart;
with(PDEtools):
#local gamma:
get_order:=proc(expr,fun,var)
  local the_list,i;
  the_list := convert( indets(expr, function),list);
  PDETools:-difforder(select( i-> has(i, diff(fun,var)),the_list))
end proc:
DGP:=proc(ff,var) local ee;
  ee:=combine(frontend(expand,[ff]),':-power');
  max(map(proc(u,v)
      if u::`*` then
        op(2,combine(select(type,u,
                            identical(v)^anything),
                     ':-power'));
      else
        if type(u,identical(v)^anything) then
          op(2,u);
        else return FAIL end if;
      end if;
    end proc,
    [`if`(ee::`+`,op(ee),ee)],var));
end proc:
  	

fracdiff(u(x,t), x, alpha) assuming alpha > 0, alpha < 1:
FPDE := % + u(x,t)*diff(u(x,t),x) + diff(u(x,t),x,x) = 0;

    /   /         (-alpha) /  d            \              \\
    |   |(x - tau)         |----- u(tau, t)|              ||
    |   |                  \ dtau          /              ||
    |int|-----------------------------------, tau = 0 .. x||
    \   \         GAMMA(1 - alpha)                        //

                 / d         \   / d  / d         \\    
       + u(x, t) |--- u(x, t)| + |--- |--- u(x, t)|| = 0
                 \ dx        /   \ dx \ dx        //    
pde1 := D^alpha*u(x,y,t)+u(x,y,t)*diff(u(x,y,t),x)+diff(u(x,y,t),x$2)=0; 	

tr1 := {u(x,t) = y(xi),  xi = x - v*t^alpha,  v = lambda*t^alpha / GAMMA(alpha+1)};

         alpha                         / d            \
        D      u(x, y, t) + u(x, y, t) |--- u(x, y, t)|
                                       \ dx           /

             / d  / d            \\    
           + |--- |--- u(x, y, t)|| = 0
             \ dx \ dx           //    
   /             alpha                                      \ 
   |     lambda t                     alpha                 | 
  < v = ----------------, xi = x - v t     , u(x, t) = y(xi) >
   |    GAMMA(alpha + 1)                                    | 
   \                                                        / 
 	

pde2:=diff(y(xi), xi, xi) + y(xi)*diff(y(xi),xi) - lambda*diff(y(xi),xi) = 0;

/ d   / d        \\         / d        \          / d        \    
|---- |---- y(xi)|| + y(xi) |---- y(xi)| - lambda |---- y(xi)| = 0
\ dxi \ dxi      //         \ dxi      /          \ dxi      /    
n[1]:=get_order(pde2, U(xi),xi);
el1:=select(has, expand(lhs(pde2)), diff(U(xi), xi$n[1]));
n[2]:=degree(expand(eval(lhs(pde2),diff=0)),U(xi));
el2:=select(has, expand(lhs(pde2)), U(xi)^(n[2]));
eq3:=expand(eval(el1,[U(xi)=a[h]*xi^(-h)]));
eq4:=expand(eval(el2,[U(xi)=a[h]*xi^h]));
d1:=DGP(eq3, xi) assuming h>0;
d2:=DGP(eq4, xi) assuming h>0;
assign(solve(-d1=d2,{h}));
print("N"=h);
                               0
Error, invalid input: diff expects 2 or more arguments, but received 1
                           -infinity
                               0
                              el1
                               0
                              FAIL
                              FAIL
                            "N" = h

 

5 6 7 Page 7 of 7