torabi

85 Reputation

3 Badges

9 years, 12 days

MaplePrimes Activity


These are questions asked by torabi

Hello,

do not work well and U functions are not replaced with series form.

Please see equation 5.

Also, How me can differential with respect to the constant Amnr], Bmnr], Cmnr] as shown in   attached figure?

For Differentiation I need a

Diff.pdf

How I can differential with respect to the constant Amnr], Bmnr], Cmnr]


 

e := mu*(((cosh(eta)-cos(theta))/a)^2*(diff(`U__η`(eta, `ϕ`, theta), eta, eta))+(1-cosh(eta)*cos(theta))*(cosh(eta)-cos(theta))*(diff(`U__η`(eta, `ϕ`, theta), eta))/(a^2*sinh(eta))+2*sinh(eta)*(cosh(eta)-cos(theta))*(diff(`U__θ`(eta, `ϕ`, theta), theta))/a^2)

T := proc () options operator, arrow; rho*omega^2*(int(int(int((u(eta, `ϕ`, theta)^2+v(eta, `ϕ`, theta)^2+w(eta, `ϕ`, theta)^2)*a^3*sinh(eta)/(cosh(eta)-cos(`ϕ`))^3, theta = a .. b), eta = c .. d), `ϕ` = e .. f)) end proc

u__trial := proc (eta, `ϕ`, theta, M, N) options operator, arrow; sum(sum(sum(A[m, n, r]*u[m, n, r](eta, `ϕ`, theta), n = 1 .. N), m = 1 .. M), r = 1 .. R) end proc; v__trial := proc (eta, `ϕ`, theta, M, N) options operator, arrow; sum(sum(sum(B[m, n, r]*v[m, n, r](eta, `ϕ`, theta), n = 1 .. N), m = 1 .. M), r = 1 .. R) end proc; w__trial := proc (eta, `ϕ`, theta, M, N) options operator, arrow; sum(sum(sum(C[m, n, r]*w[m, n, r](eta, `ϕ`, theta), n = 1 .. N), m = 1 .. M), r = 1 .. R) end proc

proc (eta, varphi, theta, M, N) options operator, arrow; sum(sum(sum(C[m, n, r]*w[m, n, r](eta, varphi, theta), n = 1 .. N), m = 1 .. M), r = 1 .. R) end proc

(1)

L := e-T()

"(∂)/(∂ A[m,n,r])L"

``

``

``

``

``

``

``

``


 

Download

 

Hello,

How can write a code for determination of Laplacian in a new form is introduced in maple code (First line).

Thank you.

FOR2
 

``

"L:=(∑)`e__i`/(`h__i`)*(∂)/(∂ `xi__i`).((∑)(∑)`e__k`/(`h__k`)((∂)/(∂ `xi__k`)`U__j`*`e__j`+`U__j`(∂)/( `xi__k`)`U__j`)):"

restart; with(VectorCalculus); with(LinearAlgebra); h__1 := VectorCalculus:-`*`(a, 1/cosh(r)); h__2 := VectorCalculus:-`*`(a, 1/cosh(r)); h__3 := VectorCalculus:-`*`(sinh(r), 1/cos(theta)); U__1 := u__r; U__2 := `u__θ`; U__3 := `u__φ`

"for i from 1 to 3 do  for j from 1 to 3 do  for k  from 1 to 3 do     if i=1 then   `h__i`:=a/(cosh(r)-cos(theta)); `U__i`:=`u__r`;`e__i`:=`e__r`:`xi__i`:=r:     else  if i=2 then  `h__i`:=a/(cosh(r)-cos(theta));`U__i`:=`u__theta`;`e__i`:=`e__theta`:`xi__i`:=theta:  else ;   `h__i`:=a/(cosh(r)-cos(theta));`U__i`:=`u__phi`;`e__i`:=`e__phi`:`xi__i`:=phi:  end if;          if  j=1 then ;  `h__j`:=a/(cosh(r)-cos(theta)); `U__j`:=`u__r`;`e__j`:=`e__r`:`xi__j`:=r:   else if  j=2 then;  `h__j`:=a/(cosh(r)-cos(theta));`U__j`:=`u__theta`;`e__j`:=`e__theta`:`xi__j`:=theta:  else ;   `h__j`:=a/(cosh(r)-cos(theta));`U__j`:=`u__phi`;`e__j`:=`e__phi`:`xi__j`:=phi:  end if;       if k=1 then   `h__k`:=a/(cosh(r)-cos(theta)); `U__k`:=`u__r`;`e__k`:=`e__r`:`xi__k`:=r:   else if i=2 then  `h__k`:=a/(cosh(r)-cos(theta));`U__k`:=`u__theta`;`e__k`:=`e__theta`:`xi__k`:=theta:  else     `h__k`:=a/(cosh(r)-cos(theta));`U__k`:=`u__phi`;`e__k`:=`e__phi`:`xi__k`:=phi:  end if;                   end ;  end ;         end ;               "

Error, unterminated loop

"for i from 1 to 3 do  for j from 1 to 3 do  for k  from 1 to 3 do    if i=1 then `h__i`:=a/(cosh(r)-cos(theta)); `U__i`:=`u__r`;`e__i`:=`e__r`:xi__i:=r:     else  if i=2 then  `h__i`:=a/(cosh(r)-cos(theta));`U__i`:=`u__theta`;`e__i`:=`e__theta`:xi__i:=theta:  else ;   `h__i`:=a/(cosh(r)-cos(theta));`U__i`:=`u__phi`;`e__i`:=`e__phi`:xi__i:=phi:  end if;       if j=1 then ;  `h__j`:=a/(cosh(r)-cos(theta)); `U__j`:=`u__r`;`e__j`:=`e__r`:xi__j:=r:   else if j=2 then;  `h__j`:=a/(cosh(r)-cos(theta));`U__j`:=`u__theta`;`e__j`:=`e__theta`:xi__j:=theta:  else ;   `h__j`:=a/(cosh(r)-cos(theta));`U__j`:=`u__phi`;`e__j`:=`e__phi`:xi__j:=phi:  end if;     if k=1 then `h__k`:=a/(cosh(r)-cos(theta)); `U__k`:=`u__r`;`e__k`:=`e__r`:xi__k:=r:   else if i=2 then  `h__k`:=a/(cosh(r)-cos(theta));`U__k`:=`u__theta`;`e__k`:=`e__theta`:xi__k:=theta:  else `h__k`:=a/(cosh(r)-cos(theta));`U__k`:=`u__phi`;`e__k`:=`e__phi`:xi__k:=phi:  end if;           end ;  end ;     end ;               "

 

i

i

(1)

j

j

(2)

``


 

Download FOR2

 

 

Hello,

How I can remove some problems in my code.

I wrote it before in  software, but in some lines, I have some problems with it.

How I can change it in maple to run well?


 

restart

M := 2; B := 1; C := 3; K := 6; f := 2*exp(-t); q0 := 1; qd0 := -1; qd20 := 1; alpha := 1/2; beta := 1/12; gammaa := 1/4; h := .1; Tf := 2

"N:=size(M,1)  T:=0:h:Tf;  lt:=length(T);  F:=subs(f,t,T);  F:=subs(t=T,f);    qd30:=M\(F(1)-B*qd20-C*qd0-K*q0);   q:=zeros(N,lt)  qd:=zeros(N,lt)  qd2:=zeros(N,lt);  qd3:=zeros(N,lt);  q(:,1):=q0  qd(:,1):=qd0  qd2(:,1):=qd20  qd3(:,1):=qd30"

Error, invalid function arguments

"N:=size(M,1)  T:=0:h:Tf;  lt:=length(T);  F:=subs(f,t,T);  F:=subs(t=T,f);    qd30:=M\(F(1)-B*qd20-C*qd0-K*q0);  q:=zeros(N,lt)  qd:=zeros(N,lt)  qd2:=zeros(N,lt);  qd3:=zeros(N,lt);  q(:,1):=q0  qd(:,1):=qd0  qd2(:,1):=qd20  qd3(:,1):=qd30"

 

"A:=M+alpha*h*B+gammaa*(h^2)*C+beta*(h^3)*K;  for n:=1:lt-1 do      D:=F(n+1)-B*(qd2(:,n)+(1-alpha)*h*qd3(:,n))-...          C*(qd(:,n)+h*qd2(:,n)+(0.5-gammaa)*(h^2)*qd3(:,n))-...          K*(q(:,n)+h*qd(:,n)+(h^2)/2*qd2(:,n)+(1/6-beta)*(h^3)*qd3(:,n));      qd3(:,n+1):=A\D;      qd2(:,n+1):=qd2(:,n)+(1-alpha)*h*qd3(:,n)+alpha*h*qd3(:,n+1);      qd(:,n+1):=qd(:,n)+h*qd2(:,n)+(0.5-gammaa)*(h^2)*qd3(:,n)+gammaa*(h^2)*qd3(:,n+1);      q(:,n+1):=q(:,n)+h*qd(:,n)+(h^2)/2*qd2(:,n)+(1/6-beta)*(h^3)*qd3(:,n)+...          beta*(h^3)*qd3(:,n+1);  end do"

Error, invalid function arguments

"A:=M+alpha*h*B+gammaa*(h^2)*C+beta*(h^3)*K;  for n:=1:lt-1 do      D:=F(n+1)-B*(qd2(:,n)+(1-alpha)*h*qd3(:,n))-...          C*(qd(:,n)+h*qd2(:,n)+(0.5-gammaa)*(h^2)*qd3(:,n))-...          K*(q(:,n)+h*qd(:,n)+(h^2)/2*qd2(:,n)+(1/6-beta)*(h^3)*qd3(:,n));      qd3(:,n+1):=A\D;      qd2(:,n+1):=qd2(:,n)+(1-alpha)*h*qd3(:,n)+alpha*h*qd3(:,n+1);      qd(:,n+1):=qd(:,n)+h*qd2(:,n)+(0.5-gammaa)*(h^2)*qd3(:,n)+gammaa*(h^2)*qd3(:,n+1);      q(:,n+1):=q(:,n)+h*qd(:,n)+(h^2)/2*qd2(:,n)+(1/6-beta)*(h^3)*qd3(:,n)+...          beta*(h^3)*qd3(:,n+1);  end do"

 

plot(T, q, 'r-o', 'linewidth', 1.5)

Error, (in plot) unexpected options: [r-o, , 1.5]

 

``


 

Download

 

Please help me for removing an error in my code.

Thank you


 

"   restart:     NL:=960:    LL:=4:      BB:=0.6 :  T:=16:    MM:=NL*(LL+1):          for  NC  from 0 by 1 to MM-1  do       S:=BB+(2*Pi*NC/T)*I;          powerFactor := 0.05 * (sqrt(2.0) - 1.202081528);     powerTerm := sqrt(S)*sqrt(49*S^(2)+280*S+800)/sqrt(S+4);       preFactor := 1/((exp(sqrt(2.0)*powerTerm/10.0)-1.0)*S);       XS(NC+1):= preFactor * ((-exp(-powerFactor*powerTerm) + exp(powerFactor*powerTerm)) * exp(sqrt(2.0)*powerTerm/20.0));    end  do;    for  timeCounter from 0 by 1 to  NL-1  do     totalTerm:=0;     for KK from 0 to NL-1 do        for L from 0 to LL do           Term1:=Re(XS(KK+L*NL+1))+I*(Im(XS(KK+L*NL+1)));           Term2:=exp((timeCounter*KK*2*Pi/NL)*I);           totalTerm:=totalTerm+Term1*Term2;        end do     end do     XT(timeCounter+1):=((2.0/T)*exp(BB*timeCounter*T/NL)*(-0.5*Re(XS(1))+Re(totalTerm)));     TT(timeCounter+1):=(timeCounter*T)/NL;         end do    "

Error, invalid loop statement termination

"   restart:    NL:=960:  LL:=4:  BB:=0.6 :  T:=16:    MM:=NL*(LL+1):       for NC  from 0 by 1 to MM-1  do     S:=BB+(2*Pi*NC/T)*I;    powerFactor := 0.05 * (sqrt(2.0) - 1.202081528);   powerTerm := sqrt(S)*sqrt(49*S^2+280*S+800)/sqrt(S+4);    preFactor := 1/((exp(sqrt(2.0)*powerTerm/10.0)-1.0)*S);     XS(NC+1):= preFactor * ((-exp(-powerFactor*powerTerm) + exp(powerFactor*powerTerm)) * exp(sqrt(2.0)*powerTerm/20.0));    end  do;    for timeCounter from 0 by 1 to NL-1  do  totalTerm:=0;     for KK from 0 to NL-1 do        for L from 0 to LL do  Term1:=Re(XS(KK+L*NL+1))+I*(Im(XS(KK+L*NL+1)));  Term2:=exp((timeCounter*KK*2*Pi/NL)*I);  totalTerm:=totalTerm+Term1*Term2;        end do     end do   XT(timeCounter+1):=((2.0/T)*exp(BB*timeCounter*T/NL)*(-0.5*Re(XS(1))+Re(totalTerm)));   TT(timeCounter+1):=(timeCounter*T)/NL;      end do    "

 

``

``


 

Download

 

1 2 3 4 5 6 7 Last Page 1 of 19