Maple 2022 Questions and Posts

These are Posts and Questions associated with the product, Maple 2022

How to evaluate the right eigenvector of a given matrix in maple?

For t not equal to nT,   

dS/dt = delta- mu*S+ omega*V; 

 dV/dt = -(omega+mu)*V

For t=nT, 

 S(nT+)=(1-gamma) S(nT);

V(nT+)=V(nT)+ gamma* S(nT),

with the initial conditions  S(0+)=s0

V(0+)=v0

    how to plot the graph with this system of equations,impulsive points and initial conditions  

I want a maple code to solve the caputo fabrizio differential equations using Runge Kutta method with implicit functions and impulsive conditions in maple. Is there any code structure for that. 

restart;
with(Student[NumericalAnalysis]);
with(plots);
with(DEtools);
f := proc(u, r) local res; res := 1/25*r^2 + (sin(u(r)) + sin(diff(u(r), [r $ 1/5])))/(r^2 + 47); return res; end proc;


RK4 := proc(f, u0, r0, h, n) local u, r, i, k1, k2, k3, k4; u := Vector(n + 1); r := Vector(n + 1); u[1] := u0; r[1] := r0; for i to n do k1 := f(u[i], t[i]); k2 := f(u[i] + 1/2*h*k1, r[i] + 1/2*h); k3 := f(u[i] + 1/2*h*k2, r[i] + 1/2*h); k4 := f(u[i] + h*k3, r[i] + h); u[i + 1] := u[i] + 1/6*h*(k1 + 2*k2 + 2*k3 + k4); r[i + 1] := r[i] + h; end do; return [u, r]; end proc;
RK4 := proc (f, u0, r0, h, n) local u, r, i, k1, k2, k3, k4; u 

   := Vector(n+1); r := Vector(n+1); u[1] := u0; r[1] := r0; 

   for i to n do k1 := f(u[i], t[i]); k2 := f(u[i]+(1/2)*h*k1, 

   r[i]+(1/2)*h); k3 := f(u[i]+(1/2)*h*k2, r[i]+(1/2)*h); k4 := 

   f(u[i]+h*k3, r[i]+h); u[i+1] := u[i]+(1/6)*h*(k1+2*k2+2*k3+k4\

  ); r[i+1] := r[i]+h end do; return [u, r] end proc


u0 := cos(abs(0.9))/15;
                      u0 := 0.04144066455

r0 := 0;
                            r0 := 0

h := 0.1;
                            h := 0.1

n := 100;
                            n := 100

solution := RK4(f, u0, r0, h, n)

u := solution[1];
r := solution[2];
plot(u, r, style = line, color = blue, labels = ["Time (r)", "Solution (u)"]);
 is this correct to solve the implicit fractional differential equations using 4th order Runge-Kutta Method. will fsolve command  solve the fractional differential equations ?

I am trying to draw the streamline for my coupled system but do not get the outcome. Could anyone please help in this regard?

Detail: My system contains x and y;  Regrading x=0, if I do not assign it to zero, do not get the results. Otherwise, there is no need to put x=0 because I am interested in plotting stream plots between y and x (y on the vertical axis and x on the horizontal axis). Besides this, I solved this system analytically, then considered the stream function, did some steps, and plotted the streamline. It is different from the stream function, which has been obtained directly by using the numeric method. I have assigned the values to the parameters that I used during the analytical plot. I put x=0 and did not get the answer. Besides,  I am uploading the graph as a reference, which I have obtained by considering the stream function. This plot is similar to my flow direction, and I expect the same results from the numeric method.

streamline_Help.mw

I am trying to find the value of y4 at t=infinity and t=-infinity when lambda1>lambda2 or lambda1<lambda2. But every time I got the same answer. For example, if we do it by hand then the terms which are responsible for making the indeterminate form can be extracted and canceled (see Fig.). 

But in limit.mw y4 is too lengthy-expression and very difficult to do it manually.

As I assumed 'n' and 'm' are real, eta is complex. But still, there is a bar on these discrete independent variables. Secondly, the substitution of (8) applies in some terms of 'r2', and the remaining terms remain as is it.

restart

with(LinearAlgebra); with(PDEtools); with(plots); with(LREtools)

setup(mathematicalnotation = true)

setup(mathematicalnotation = true)

(1)

assume(n::real); assume(m::real)

A := proc (n, m) options operator, arrow; Matrix([[eta*phi(n, m), conjugate(eta)*conjugate(psi(n, m))], [phi(n, m), conjugate(psi(n, m))]]) end proc; Adet := Determinant(A(n, m))

eta*phi(n, m)*conjugate(psi(n, m))-conjugate(eta)*conjugate(psi(n, m))*phi(n, m)

(2)

B := proc (n, m) options operator, arrow; Matrix([[phi(n, m), conjugate(psi(n, m))], [-psi(n, m), conjugate(phi(n, m))]]) end proc; Bdet := Determinant(B(n, m))

phi(n, m)*conjugate(phi(n, m))+conjugate(psi(n, m))*psi(n, m)

(3)

r := Adet/Bdet

(eta*phi(n, m)*conjugate(psi(n, m))-conjugate(eta)*conjugate(psi(n, m))*phi(n, m))/(phi(n, m)*conjugate(phi(n, m))+conjugate(psi(n, m))*psi(n, m))

(4)

p := {eta = 1+I, phi(n, m) = (1+I*a*eta)^n*(1+I*b*eta^2)^m, psi(n, m) = (1-I*a*eta)^n*(1-I*b*eta^2)^m, conjugate(eta) = 1-I, conjugate(phi(n, m)) = (1-I*a*conjugate(eta))^n*(1-I*b*conjugate(eta)^2)^m, conjugate(phi(n, m)) = (1+I*a*conjugate(eta))^n*(1+I*b*conjugate(eta)^2)^m}

{eta = 1+I, phi(n, m) = (1+I*a*eta)^n*(1+I*b*eta^2)^m, psi(n, m) = (1-I*a*eta)^n*(1-I*b*eta^2)^m, conjugate(eta) = 1-I, conjugate(phi(n, m)) = (1-I*a*conjugate(eta))^n*(1-I*b*conjugate(eta)^2)^m, conjugate(phi(n, m)) = (1+I*a*conjugate(eta))^n*(1+I*b*conjugate(eta)^2)^m}

(5)

r1 := simplify(subs(p, r))

(2*I)*(1+I*a*eta)^n*(1+I*b*eta^2)^m*conjugate((1-I*a*eta)^n*(1-I*b*eta^2)^m)/((1+I*a*eta)^n*(1+I*b*eta^2)^m*(1-I*a*conjugate(eta))^n*(1-I*b*conjugate(eta)^2)^m+abs(-1+I*a*eta)^(2*n)*abs(I*b*eta^2-1)^(2*m))

(6)

r2 := 1-I*delta(r1, n)

1-I*((2*I)*(1+I*a*eta)^(n+1)*(1+I*b*eta^2)^m*conjugate((1-I*a*eta)^(n+1)*(1-I*b*eta^2)^m)/((1+I*a*eta)^(n+1)*(1+I*b*eta^2)^m*(1-I*a*conjugate(eta))^(n+1)*(1-I*b*conjugate(eta)^2)^m+abs(-1+I*a*eta)^(2*n+2)*abs(I*b*eta^2-1)^(2*m))-(2*I)*(1+I*a*eta)^n*(1+I*b*eta^2)^m*conjugate((1-I*a*eta)^n*(1-I*b*eta^2)^m)/((1+I*a*eta)^n*(1+I*b*eta^2)^m*(1-I*a*conjugate(eta))^n*(1-I*b*conjugate(eta)^2)^m+abs(-1+I*a*eta)^(2*n)*abs(I*b*eta^2-1)^(2*m)))

(7)

exp_expr := subs({(1+I*b*eta^2)^m = exp(I*eta^2*t)}, r2)

1-I*((2*I)*(1+I*a*eta)^(n+1)*exp(I*eta^2*t)*conjugate((1-I*a*eta)^(n+1)*(1-I*b*eta^2)^m)/((1+I*a*eta)^(n+1)*exp(I*eta^2*t)*(1-I*a*conjugate(eta))^(n+1)*(1-I*b*conjugate(eta)^2)^m+abs(-1+I*a*eta)^(2*n+2)*abs(I*b*eta^2-1)^(2*m))-(2*I)*(1+I*a*eta)^n*exp(I*eta^2*t)*conjugate((1-I*a*eta)^n*(1-I*b*eta^2)^m)/((1+I*a*eta)^n*exp(I*eta^2*t)*(1-I*a*conjugate(eta))^n*(1-I*b*conjugate(eta)^2)^m+abs(-1+I*a*eta)^(2*n)*abs(I*b*eta^2-1)^(2*m)))

(8)

``

NULL

NULL

NULL

plot3d(abs(exp_expr), n = -5 .. 5, t = -5 .. 5, eta = 1+I)

Error, (in plot3d) unexpected option: eta = 1+I

 
 

Download soldis.mw

I would like to take advantage from the powerful command "SSTransformation" of the DynamicSystems package to reuse the corresponding output.

For example, if we use the following shape:

         > SSTransformation( Amat, Bmat, Cmat, Dmat, form = ModalCanon, output=['A','B','C','D','T'] );

How to do to assign names to the outputs A,B,C,D and T to subsequently reuse them?

Maple 2022.2

> restart
> expr = x^4-10*x^2+1
> plot(expr)

produces an error message:
com.maplesoft.maplets.ComponentAccessException: not a valid plot structure

plot(expr, x) works Ok.

Tom Dean

restart

V := m^4*(1-(varphi/mu)^p);

m^4*(1-(varphi/mu)^p)

(1)

V1 := diff(V, varphi);

-m^4*(varphi/mu)^p*p/varphi

(2)

V2 := diff(V1, varphi);

-m^4*(varphi/mu)^p*p^2/varphi^2+m^4*(varphi/mu)^p*p/varphi^2

(3)

f := Zeta * (varphi^2);

Zeta*varphi^2

(4)

f1 := diff(f, varphi);

2*Zeta*varphi

(5)

f2 := diff(f1, varphi);

2*Zeta

(6)

R:= simplify(((V/3-f1*V1/(3*V))/((1-kappa^2*f)/(12*kappa^2)+f1/V)));

4*kappa^2*m^4*(-3*(varphi/mu)^(2*p)*m^4+(varphi/mu)^(3*p)*m^4+3*(varphi/mu)^p*m^4-m^4-2*Zeta*(varphi/mu)^p*p+2*Zeta*(varphi/mu)^(2*p)*p)/((m^4*(Zeta*kappa^2*varphi^2-1)*(varphi/mu)^p+(-Zeta*kappa^2*varphi^2+1)*m^4+24*Zeta*varphi*kappa^2)*(-1+(varphi/mu)^p))

(7)

N:=evalf(int((3*V1*kappa^2*((2*V*V1)/3 - f1^2*V1*R/(3*V) - f1*V1^2/(3*V))/(V*(-f*kappa^2 + 1)*(-R*f1 - 2*V1))),varphi=varphi__hc..varphi__end)assuming varphi__hc > 0, varphi__hc > varphi__end);

-1.*(int(-3.*(varphi/mu)^p*p*kappa^2*(-.6666666667*m^8*(1.-1.*(varphi/mu)^p)*(varphi/mu)^p*p/varphi+5.333333333*Zeta^2*varphi*m^4*(varphi/mu)^p*p*kappa^2*(-3.*(varphi/mu)^(2.*p)*m^4+(varphi/mu)^(3.*p)*m^4+3.*(varphi/mu)^p*m^4-1.*m^4-2.*Zeta*(varphi/mu)^p*p+2.*Zeta*(varphi/mu)^(2.*p)*p)/((m^4*(Zeta*kappa^2*varphi^2-1.)*(varphi/mu)^p+(-1.*Zeta*kappa^2*varphi^2+1.)*m^4+24.*Zeta*varphi*kappa^2)*(-1.+(varphi/mu)^p)*(1.-1.*(varphi/mu)^p))-.6666666667*Zeta*m^4*((varphi/mu)^p)^2*p^2/(varphi*(1.-1.*(varphi/mu)^p)))/(varphi*(1.-1.*(varphi/mu)^p)*(-1.*Zeta*kappa^2*varphi^2+1.)*(-8.*kappa^2*m^4*(-3.*(varphi/mu)^(2.*p)*m^4+(varphi/mu)^(3.*p)*m^4+3.*(varphi/mu)^p*m^4-1.*m^4-2.*Zeta*(varphi/mu)^p*p+2.*Zeta*(varphi/mu)^(2.*p)*p)*Zeta*varphi/((m^4*(Zeta*kappa^2*varphi^2-1.)*(varphi/mu)^p+(-1.*Zeta*kappa^2*varphi^2+1.)*m^4+24.*Zeta*varphi*kappa^2)*(-1.+(varphi/mu)^p))+2.*m^4*(varphi/mu)^p*p/varphi)), varphi = varphi__end .. varphi__hc))

(8)

simplify(-1.*(int(-3.*(varphi/mu)^p*p*kappa^2*(-.6666666667*m^8*(1.-1.*(varphi/mu)^p)*(varphi/mu)^p*p/varphi+5.333333333*Zeta^2*varphi*m^4*(varphi/mu)^p*p*kappa^2*(-3.*(varphi/mu)^(2.*p)*m^4+(varphi/mu)^(3.*p)*m^4+3.*(varphi/mu)^p*m^4-1.*m^4-2.*Zeta*(varphi/mu)^p*p+2.*Zeta*(varphi/mu)^(2.*p)*p)/((m^4*(Zeta*kappa^2*varphi^2-1.)*(varphi/mu)^p+(-1.*Zeta*kappa^2*varphi^2+1.)*m^4+24.*Zeta*varphi*kappa^2)*(-1.+(varphi/mu)^p)*(1.-1.*(varphi/mu)^p))-.6666666667*Zeta*m^4*((varphi/mu)^p)^2*p^2/(varphi*(1.-1.*(varphi/mu)^p)))/(varphi*(1.-1.*(varphi/mu)^p)*(-1.*Zeta*kappa^2*varphi^2+1.)*(-8.*kappa^2*m^4*(-3.*(varphi/mu)^(2.*p)*m^4+(varphi/mu)^(3.*p)*m^4+3.*(varphi/mu)^p*m^4-1.*m^4-2.*Zeta*(varphi/mu)^p*p+2.*Zeta*(varphi/mu)^(2.*p)*p)*Zeta*varphi/((m^4*(Zeta*kappa^2*varphi^2-1.)*(varphi/mu)^p+(-1.*Zeta*kappa^2*varphi^2+1.)*m^4+24.*Zeta*varphi*kappa^2)*(-1.+(varphi/mu)^p))+2.*m^4*(varphi/mu)^p*p/varphi)), varphi = varphi__end .. varphi__hc)))

Error, (in content/content) invalid arguments

 

NULL

Download ex.mw

how to find CharacteristicPolynomiall of matrix with vector entries? 

restart

with(LinearAlgebra)

with(ArrayTools)

M := Matrix([[-(I*2)*lambda+I*(lambda+m0), c], [-Transpose(c), I*a+I*(lambda+m0)]])

Matrix(%id = 36893490099698106484)

(1)

P := CharacteristicPolynomial(M, eta)

eta^2+(-I*a-(2*I)*m0)*eta+a*lambda-a*m0+c^2+lambda^2-m0^2

(2)

NULL

NULL

NULL

NULL

Download characpol.mw

Since C2=D1.D1inv should be equal to I. But return is just an expression (see attached). Further, how to obtain residue for a function C2?

residue.mw

For some of the users with eye problems like me, the white canvas is burning eyes out of sockets as the monitor needs to be close up. Even turning down the intensity do not work especially since all other applications on Linux can be configured to have a dark-theme, but NOT Maple it seems.

What is the reason for this resistance from Maple Developers to just ram this white canvas down our throats verion after version.

Users have been asking since about Maple 11 to change  this.

I mean, Maple is not exactly cheap, which would have been an excuse, and is formidable intellectual software, so "ability" should not be a problem

However am I to believe that just changing the canvas color, turns out to be  a serious intellectual challenge for developers ?

Google yields such custom canvas request spanning more than a decade, but users arrive at crickets and a dead end.

Please be kind and give us a customizable canvas or any DARK theme of your choice for users with visual challenges and the lots of normal users who also want a custom canvas color or dark theme. It is overdue.

At the moment I use the cumbersome table-solution with a gray background, which helps some, but it is clunky and no alternative for long term use as the window and bars itself are still white and distracts and defeats the objective somewhat.

HPM.mw

  • Please help me
  • How do I write Homotopy Perturbation method for a partial differential equation for this question in Maple?

Download HPM.mw

 

Good day all,

please I am new Maple user, i used the same code to solve boundary layer flow. Itried to use the same code in solving nanofluid but the solution is not coverging at some point. But the author i want to compared my results with had solution at those points.

Is there any way i can get solution of this model at this with these values?. Please i need your help. Thank you in advance

secod_code.mw

NULL

restart

with*plots; ode1 := (1+1/bet)*(diff(f(eta), eta, eta, eta))-(diff(f(eta), eta))^2+f(eta)*(diff(f(eta), eta, eta))+Gr*(theta(eta)+lambda1*theta(eta)^2)+Gc*(phi(eta)+lambda2*phi(eta)^2)-M*(diff(f(eta), eta)) = 0

(1+1/bet)*(diff(diff(diff(f(eta), eta), eta), eta))-(diff(f(eta), eta))^2+f(eta)*(diff(diff(f(eta), eta), eta))+Gr*(theta(eta)+lambda1*theta(eta)^2)+Gc*(phi(eta)+lambda2*phi(eta)^2)-M*(diff(f(eta), eta)) = 0

(1)

ode2 := (diff(theta(eta), eta, eta))*(1+(4*R*(1/3))*(theta(eta)+CT)^3)/Pr+4*R*(theta(eta)+CT)^2*(diff(theta(eta), eta))^2+f(eta)*(diff(theta(eta), eta))+Nb*(diff(phi(eta), eta))*(diff(theta(eta), eta))+Nt*(diff(theta(eta), eta))^2-de*(f(eta)*(diff(f(eta), eta))*(diff(theta(eta), eta))+f(eta)^2*(diff(theta(eta), eta, eta))) = 0

(diff(diff(theta(eta), eta), eta))*(1+(4/3)*R*(theta(eta)+CT)^3)/Pr+4*R*(theta(eta)+CT)^2*(diff(theta(eta), eta))^2+f(eta)*(diff(theta(eta), eta))+Nb*(diff(phi(eta), eta))*(diff(theta(eta), eta))+Nt*(diff(theta(eta), eta))^2-de*(f(eta)*(diff(f(eta), eta))*(diff(theta(eta), eta))+f(eta)^2*(diff(diff(theta(eta), eta), eta))) = 0

(2)

ode3 := diff(phi(eta), eta, eta)+Pr*Le*(diff(phi(eta), eta))*f(eta)+Nt*(diff(theta(eta), eta, eta))/Nb-Pr*Le*dc*(f(eta)*(diff(f(eta), eta))*(diff(phi(eta), eta))+f(eta)^2*(diff(phi(eta), eta, eta))) = 0

diff(diff(phi(eta), eta), eta)+Pr*Le*(diff(phi(eta), eta))*f(eta)+Nt*(diff(diff(theta(eta), eta), eta))/Nb-Pr*Le*dc*(f(eta)*(diff(f(eta), eta))*(diff(phi(eta), eta))+f(eta)^2*(diff(diff(phi(eta), eta), eta))) = 0

(3)

bcs1 := f(0) = 0, (D(f))(0) = 1+xi*((D^2)(f))(0), (D(f))(6) = 0, theta(6) = 0, phi(0) = 1+`&varsigma;`*(D(phi))(0), theta(0) = 1+Zeta*(D(theta))(0), phi(6) = 0

f(0) = 0, (D(f))(0) = 1+xi*(D(f))(0)^2, (D(f))(6) = 0, theta(6) = 0, phi(0) = 1+varsigma*(D(phi))(0), theta(0) = 1+Zeta*(D(theta))(0), phi(6) = 0

(4)

NULL

 

L := [0., .1, .4, 1]

[0., .1, .4, 1]

(5)

 
  

NULL


  for k to 10 do
      sol_All := dsolve
                 ( eval
                   ( {bcs1, ode1, ode2,ode3},
                     [xi= L[k],R=1, CT=0.2, Gr=0.5, Gc=0.5, lambda1=0.2, lambda2=0.2, Pr=0.72, Nb=0.5,  Le=1, dc=0.2, de=0.2, Nt=0.5, Zeta=0.5, varsigma=0.5, M=1.5, bet=1.5]
                   ),
                   [f(eta), theta(eta),phi(eta)],
                   numeric,
                   output = listprocedure
                 );
      Y_sol || k := rhs(sol_All[5]);
      YP_sol || k := -rhs(sol_All[6]);

feta || k := rhs(sol_All[4]);
      fpeta || k := rhs(sol_All[3]);

phieta || k := rhs(sol_All[8]);
      phipeta || k := rhs(sol_All[7])
  end do:

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

 

for k to 10 do L[k], [(Y_sol || k)(0), (YP_sol || k)(0)] end do

0., [Y_sol1(0), YP_sol1(0)]

 

.1, [Y_sol2(0), YP_sol2(0)]

 

.4, [Y_sol3(0), YP_sol3(0)]

 

1, [Y_sol4(0), YP_sol4(0)]

 

Error, invalid subscript selector

 

for k to 10 do L[k], [(feta || k)(0)] end do

0., [feta1(0)]

 

.1, [feta2(0)]

 

.4, [feta3(0)]

 

1, [feta4(0)]

 

Error, invalid subscript selector

 

NULL

Error, mismatched or missing bracket/operator

"for k  from 1 to  10 do L[k], ([phieta ||k(0),phipeta||k(0)]); od; "

 

NULL

  plot( [ seq((Y_sol||j)(eta), j = 1..6)],
         eta = 0 .. 6,
         labels = [eta, theta(eta)],
         axes = boxed
      );
plot( [ seq((YP_sol||j)(eta), j = 1..6)],
         eta = 0 .. 8,
         labels = [eta, thetaprime(eta)],
         axes = boxed
      );

 plot( [ seq((feta||j)(eta), j = 1..6)],
         eta = 0 .. 8,
         labels = [eta, f(eta)],
         axes = boxed
      );
  plot( [ seq((fpeta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, fprime(eta)],
         axes = boxed
      );
plot( [ seq((phipeta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, phiprime(eta)],
         axes = boxed
      );

plot( [ seq((phieta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, phi(eta)],
         axes = boxed
      );

Warning, expecting only range variable eta in expression Y_sol1(eta) to be plotted but found name Y_sol1

 

 

Warning, expecting only range variable eta in expression YP_sol1(eta) to be plotted but found name YP_sol1

 

 

Warning, expecting only range variable eta in expression feta1(eta) to be plotted but found name feta1

 

 

Warning, expecting only range variable eta in expression fpeta1(eta) to be plotted but found name fpeta1

 

 

Warning, expecting only range variable eta in expression phipeta1(eta) to be plotted but found name phipeta1

 

 

Warning, expecting only range variable eta in expression phieta1(eta) to be plotted but found name phieta1

 

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