Maple 2022 Questions and Posts

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

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 am re-posting. I am not sure why my question was deleted. Please advise on how to amend my post so that it's not considered spam.

I simply wonder how parameters can "disappear" in a solution. In particular, in my example below the parameter gamma correctly appears in 3 out of 4 solution. However, the solution in which 'gamma' does not appear is also the solution I am most interested in, given its manageable size. Why gamma is "lost" for this solution? 281223_gamma_disappear.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?

NULL

restart

with(LinearAlgebra)

prel := {p1 = (1/2)*exp(I*a*x*(1/2)+I*b*t*(1/2))*(I*a*g[1](t, x)+2*(diff(g[1](t, x), x))), p2 = -(1/2)*exp(-I*a*x*(1/2)-I*b*t*(1/2))*(I*a*g[2](t, x)-2*(diff(g[2](t, x), x))), p3 = -(1/2)*exp(-I*a*x*(1/2)-I*b*t*(1/2))*(I*a*g[3](t, x)-2*(diff(g[3](t, x), x)))}

{p1 = (1/2)*exp(((1/2)*I)*a*x+((1/2)*I)*b*t)*(I*a*g[1](t, x)+2*(diff(g[1](t, x), x))), p2 = -(1/2)*exp(-((1/2)*I)*a*x-((1/2)*I)*b*t)*(I*a*g[2](t, x)-2*(diff(g[2](t, x), x))), p3 = -(1/2)*exp(-((1/2)*I)*a*x-((1/2)*I)*b*t)*(I*a*g[3](t, x)-2*(diff(g[3](t, x), x)))}

(1)

A := Matrix([[rhs(prel[1]), rhs(prel[2]), rhs(prel[3])]])

A1 := Transpose(A)

Matrix(%id = 36893490201564614396)

(2)

prel1 := {p4 = exp((1/2*I)*a*x+(1/2*I)*b*t)*(-I*lambda*g[1](t, x)+c[1]*g[2](t, x)+c[2]*g[3](t, x)), p5 = exp(-(1/2*I)*a*x-(1/2*I)*b*t)*(I*lambda*g[2](t, x)-c[1]*g[1](t, x)), p6 = exp(-(1/2*I)*a*x-(1/2*I)*b*t)*(I*lambda*g[3](t, x)-c[2]*g[1](t, x))}

{p4 = exp(((1/2)*I)*a*x+((1/2)*I)*b*t)*(-I*lambda*g[1](t, x)+c[1]*g[2](t, x)+c[2]*g[3](t, x)), p5 = exp(-((1/2)*I)*a*x-((1/2)*I)*b*t)*(I*lambda*g[2](t, x)-c[1]*g[1](t, x)), p6 = exp(-((1/2)*I)*a*x-((1/2)*I)*b*t)*(I*lambda*g[3](t, x)-c[2]*g[1](t, x))}

(3)

A2 := Matrix([[rhs(prel1[1]), rhs(prel1[2]), rhs(prel1[3])]]); A3 := Transpose(A2)

Matrix(%id = 36893490201519962460)

(4)

NULL

Download simplify2getgXisBg.mw

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

How do i retrieve the expression fra a "Fit" command so that i can use the expression for later calculations.

As you can see from the picture below, i use the "Fit" command to find an expression based on the values specified in X and Y. From there i would like to use the expression to find points on the line and to automate the proces. I can succesfully retrieve the expression by using the reference label, but is there another way to retrieve the expression so that i can avoid having to display the expression after evaluating?

I guess the question can be rephrased to: How do i retrieve the same information as the label reference does, but with a command and without using a label reference?

Since (1/h)[f(i+1,t)-f(i,t)]=f(x,t)_{x} as h goes to zero, 'i' is the discrete index along x-axis. How to do it in Maple? How to reduce Eq. (5) into continuous derivatives?

restart

with(LinearAlgebra)

with(PDEtools)

with(Physics)

with(plots)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1)

``

U := proc (i, t) options operator, arrow; Matrix([[1+I*(q(i+1, t)-q(i, t))/lambda, I*(r(i+1, t)-r(i, t))/lambda], [I*(r(i+1, t)-r(i, t))/lambda, 1-I*(q(i+1, t)-q(i, t))/lambda]]) end proc

proc (i, t) options operator, arrow; Matrix([[1+Physics:-`*`(Physics:-`*`(I, q(i+1, t)-q(i, t)), Physics:-`^`(lambda, -1)), Physics:-`*`(Physics:-`*`(I, r(i+1, t)-r(i, t)), Physics:-`^`(lambda, -1))], [Physics:-`*`(Physics:-`*`(I, r(i+1, t)-r(i, t)), Physics:-`^`(lambda, -1)), 1-Physics:-`*`(Physics:-`*`(I, q(i+1, t)-q(i, t)), Physics:-`^`(lambda, -1))]]) end proc

(2)

``

V := proc (i, t) options operator, arrow; Matrix([[-((1/2)*I)*lambda, -r(i, t)], [r(i, t), ((1/2)*I)*lambda]]) end proc

proc (i, t) options operator, arrow; Matrix([[Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(1, Physics:-`^`(2, -1)), I), lambda), -1), Physics:-`*`(r(i, t), -1)], [r(i, t), Physics:-`*`(Physics:-`*`(Physics:-`*`(1, Physics:-`^`(2, -1)), I), lambda)]]) end proc

(3)

NULL

z := diff(U(i, t), t)+U(i, t).V(i, t)-V(i+1, t).U(i, t)

Matrix(%id = 4525182530)

(4)

z11 := simplify(lambda*z[1, 1]/h, size) = 0

I*(r(i+1, t)^2-r(i, t)^2+(D[2](q))(i+1, t)-(diff(q(i, t), t)))/h = 0

(5)

NULL

Download limit.mw

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

Download Exercises_all_lectures_1.mw

Exercises_all_lectures_1.mw

Hello,

I have a Maple document that contains a lot of notes that I have an exam for tomorrow. I opened the document today and it suggests I save a copy of a corrupt document and also it gives me the message "There were problems during the loading process.
Your worksheet may be incomplete." when it finally does load.

Any suggestions for how I could fix this would be greatly greatly appreciated.

Thank you

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

I am solving 3 nonlinear equations for 3 variables: lambda_1, lambda_2, and lambda_3. I would expect these lambdas to be real and positive.

Instead of solving my original equations, which are convoluted and not in polynomial form, I try to solve for their numerators first (since their numerators are polynomials). Broadly speaking, such solutions should also solve the original non-polynomial system. More specifically, the solutions thus obtained may be a nontrivial superset of the solutions of the original system. They need to be verified, which should be a much much easier process than obtaining that superset. In the case at hand, my original system is rational functions, and thus the only thing that really needs to be verified is that the solutions do not make any of the original denominators zero.

1st question: How to actually implement such verification? In other words, how to verify that the polynomial solution that I obtain also solves the original non-polynomial system?

2nd question: As you can see from my attached script, I obtain one polynomial solution. How to analyze it? What can I say about its roots? In case there are an infinite number of roots, how can I pin down a closed-form, real, and positive expression of lambda_1, lambda_2, lambda_3 in terms of the four parameters gamma, p, sigma_e and sigma_v?*

*Please note that in SolveTools:-PolynomialSystem I set backsubstitute=false to favour compactness and computational efficiency (which means that I need to do the backsubstitution myself now - how to do it?).

**Perhaps is useful to know that gamma, sigma_e and sigma_v are all real and positive and that p is a real, positive number between 0 and 1 (it represents a probability).

SCRIPT: 141123_Problem_NoCorrelation.mw

Thanks a lot!

Dear Maple   help me to  to plot the graph please see and rectify.  thanks in advance

i am attaching the codes 

inf:=5:
pdes:= R(X,R,t)*diff(U(X,R,t),X)+U(X,R,t)*diff(R(X,R,t),X)+R(X,R,t)*diff(V(X,R,t),R)+V(X,R,t),
         diff(U(X,R,t),t)+U(X,R,t)*diff(U(X,R,t),X)+V(X,R,t)*diff(U(X,R,t),R)=Gr*T(X,R,t)+Gc*C(X,R,t)+(1/R(X,R,t))*diff(R*diff(U(X,R,t),R),R),
         diff(T(X,R,t),t)+U(X,R,t)*diff(T(X,R,t),X)+V(X,R,t)*diff(T(X,R,t),R)+(1/(Pr*R(X,R,t)))*diff(R*diff(T(X,R,t),R),R),diff(C(X,R,t),t)+U* diff(C(X,R,t),X)+V(X,R,t)*diff(C(X,R,t),R)+(1/(Sc*R(X,R,t)))*diff(R*diff(C(X,R,t),R),R):
conds:= U(X,R,0)=0, V(X,R,0)=0, T(X,R,0)=0,  C(X,R,0)=0,                                            
        U(X,1,t)=1, V(X,1,t)=0, T(X,1,t)=1,  C(X,1,t)=1,                                                                          U(0,R,t)=0, T(0,R,t)=0, C(0,R,t)=0,
        U(X,int,t)=0,T(X,int,t)=0,C(X,int,t)=0:
pars:= { Gr=5, Gc=10,Sc=2.0}        

              pars := {Gc = 10, Gr = 5, Sc = 2.0}

PrVals:=[0.71, 1.00, 1.25, 2.00]:
  colors:=[red, green, blue, black]:
  for j from 1 to numelems(PrVals) do
      pars1:=`union`( pars, {Pr=PrVals[j]}):
      pdSol:= pdsolve( eval([pdes], pars1),
                       eval([conds], pars1),
                       numeric
                     );
      plt[j]:=pdSol:-plot( U(X,R,t),X=1, t=2, R=0..inf, numpoints=200, color=colors[j]);
  od:
  plots:-display( [seq(plt[j], j=1..numelems(PrVals))]);

I have a linear system of 3 equations in 3 variables and have no issues with solving it using solve().

I am having issues with solving it by imposing assumptions on my parameters. The infolevel[solve] now outputs "Entering solver with 6 equations in 3 variables", so I am likely making mistakes in the syntax solve(Eqs, Vars, UseAssumptions) assuming ... first of all, do I even need to do this given the assume statements that I set up on top of my script? How do I make sure that all the assumptions are preserved throughout all the calculations in my worksheet?

Moreover, I don't know why I get SolutionsLost: setting solutions lost flag.

My script: 061123_solving_with_assumptions.mw

First 6 7 8 9 10 11 12 Last Page 8 of 40