Maple 2022 Questions and Posts

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

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 am facing problem while solving differential equation in loops where conditons are given also in loops. the particular problem occurs while solving Differential equation involving He's Homotopy purturbation method

How  to make the integration 

 

into the following form:



Thanks in advance,Q1.mw

IsFrobeniusGroup(SmallGroup(20, 3)) will get true, but IsFrobeniusPermGroup(SmallGroup(20, 3)) will get false. What happen? As the documentation, it will get same result:

The two definitions are equivalent in the following sense.  If G is a Frobenius permutation group, then G is Frobenius as an abstract group

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 ?

How to convert this set of PDEs into ODEs? PDEs.mw

I have a list as follows:
lst := [`A=70`, `B=17`, `C=27`, `D=37`, `E=74`, `F=57`, `G=67`, `H=08`, `I=81`, `J=28`, `K=38`, `L=48`, `M=58`, `N=68`, `O=90`, `P=19`, `Q=29`, `R=39`, `S=49`, `T=59`, `U=96`, `V=010`, `W=110`, `X=210`, `Y=310`, `Z=410`, "SPACE=105", "DOT=106"]

however using tt:=convert(lst, table) gives

tt:=table([1 = `A=70`, 2 = `B=17`, 3 = `C=27`, 4 = `D=37`, 5 = `E=74`, 6 = `F=57`, 7 = `G=67`, 9 = `I=81`, 8 = `H=08`, 11 = `K=38`, 10 = `J=28`, 13 = `M=58`, 12 = `L=48`, 15 = `O=90`, 14 = `N=68`, 18 = `R=39`, 19 = `S=49`, 16 = `P=19`, 17 = `Q=29`, 22 = `V=010`, 23 = `W=110`, 20 = `T=59`, 21 = `U=96`, 27 = "SPACE=105", 26 = `Z=410`, 25 = `Y=310`, 24 = `X=210`, 28 = "DOT=106"])

I want this to be such that I can retrieve the numerical value assigned to each alphabet e.g.
tt[A] should produce 70.

Are the results consistent either we use simplify(expression) or simplify(expression,size)? It seems (2) and (3) are not consistent.

restart

with(PDEtools); with(LinearAlgebra)

b := -(2*I)*exp(2*t*Im(lambda1))*(exp(I*a*x/conjugate(lambda1))*exp((2*I)*a*x/lambda1)*exp((-I*a*x)*(1/conjugate(lambda1)))*exp(I*conjugate(lambda1)*t)+exp(I*lambda1*t)*exp(I*a*x/lambda1)*exp((-I*a*x)*(1/lambda1))*exp((2*I)*a*x/conjugate(lambda1))*(abs(`ε1`)^2+abs(`ε2`)^2))*conjugate(`ε1`)*Im(lambda1)/(exp((2*I)*a*x/lambda1)*abs(`ε1`)^2*exp(-(2*I)*a*x/conjugate(lambda1))*exp(2*t*Im(lambda1))+exp(-(2*I)*a*x/lambda1)*abs(`ε1`)^2*exp((2*I)*a*x/conjugate(lambda1))*exp(2*t*Im(lambda1))+exp(I*a*x/lambda1)*exp((-I*a*x)*(1/lambda1))*exp(I*a*x/conjugate(lambda1))*exp((-I*a*x)*(1/conjugate(lambda1)))*(abs(`ε2`)^4+2*abs(`ε1`)^2*abs(`ε2`)^2+abs(`ε1`)^4+2*abs(`ε2`)^2*exp(2*t*Im(lambda1))+exp(4*t*Im(lambda1))))

-(2*I)*exp(2*t*Im(lambda1))*(exp(I*a*x/conjugate(lambda1))*exp((2*I)*a*x/lambda1)*exp(-I*a*x/conjugate(lambda1))*exp(I*conjugate(lambda1)*t)+exp(I*lambda1*t)*exp(I*a*x/lambda1)*exp(-I*a*x/lambda1)*exp((2*I)*a*x/conjugate(lambda1))*(abs(epsilon1)^2+abs(epsilon2)^2))*conjugate(epsilon1)*Im(lambda1)/(exp((2*I)*a*x/lambda1)*abs(epsilon1)^2*exp(-(2*I)*a*x/conjugate(lambda1))*exp(2*t*Im(lambda1))+exp(-(2*I)*a*x/lambda1)*abs(epsilon1)^2*exp((2*I)*a*x/conjugate(lambda1))*exp(2*t*Im(lambda1))+exp(I*a*x/lambda1)*exp(-I*a*x/lambda1)*exp(I*a*x/conjugate(lambda1))*exp(-I*a*x/conjugate(lambda1))*(abs(epsilon2)^4+2*abs(epsilon1)^2*abs(epsilon2)^2+abs(epsilon1)^4+2*abs(epsilon2)^2*exp(2*t*Im(lambda1))+exp(4*t*Im(lambda1))))

(1)

bdif := simplify(diff(b, x)); bdifxzero := simplify(subs({x = 0}, bdif))

4*Im(lambda1)*exp(2*t*Im(lambda1))*a*conjugate(epsilon1)*(conjugate(lambda1)*abs(epsilon1)^2*(abs(epsilon1)^2+abs(epsilon2)^2)*exp((t*(I*lambda1+2*Im(lambda1))*abs(lambda1)^2+(4*I)*a*(lambda1-(1/2)*conjugate(lambda1))*x)/abs(lambda1)^2)+exp(((I*conjugate(lambda1)+2*Im(lambda1))*t*abs(lambda1)^2-(2*I)*(lambda1-2*conjugate(lambda1))*a*x)/abs(lambda1)^2)*abs(epsilon1)^2*lambda1+2*abs(epsilon1)^2*(conjugate(lambda1)-(1/2)*lambda1)*exp((I*conjugate(lambda1)^2*t+(2*I)*a*x+2*t*Im(lambda1)*conjugate(lambda1))/conjugate(lambda1))+2*abs(epsilon2)^2*lambda1*(abs(epsilon1)^2+abs(epsilon2)^2)*exp((I*t*abs(lambda1)^2+(2*I)*a*x+2*t*Im(lambda1)*conjugate(lambda1))/conjugate(lambda1))+lambda1*(abs(epsilon1)^2+abs(epsilon2)^2)*exp((I*t*abs(lambda1)^2+(2*I)*a*x+4*t*Im(lambda1)*conjugate(lambda1))/conjugate(lambda1))+2*conjugate(lambda1)*exp((I*t*abs(lambda1)^2+(2*I)*a*x+2*t*Im(lambda1)*lambda1)/lambda1)*abs(epsilon2)^2+conjugate(lambda1)*exp((I*t*abs(lambda1)^2+(2*I)*a*x+4*t*Im(lambda1)*lambda1)/lambda1)+(-abs(epsilon1)^2*(conjugate(lambda1)-2*lambda1)*exp((I*lambda1^2*t+(2*I)*a*x+2*t*Im(lambda1)*lambda1)/lambda1)+(abs(epsilon1)^2+abs(epsilon2)^2)*(lambda1*(abs(epsilon1)^2+abs(epsilon2)^2)*exp(I*(t*abs(lambda1)^2+2*a*x)/conjugate(lambda1))+conjugate(lambda1)*exp(I*(t*abs(lambda1)^2+2*a*x)/lambda1)))*(abs(epsilon1)^2+abs(epsilon2)^2))/((abs(epsilon1)^4+2*abs(epsilon1)^2*abs(epsilon2)^2+abs(epsilon2)^4+2*abs(epsilon2)^2*exp(2*t*Im(lambda1))+exp((2*t*Im(lambda1)*abs(lambda1)^2-(2*I)*(lambda1-conjugate(lambda1))*a*x)/abs(lambda1)^2)*abs(epsilon1)^2+exp((2*t*Im(lambda1)*abs(lambda1)^2+(2*I)*(lambda1-conjugate(lambda1))*a*x)/abs(lambda1)^2)*abs(epsilon1)^2+exp(4*t*Im(lambda1)))^2*abs(lambda1)^2)

 

12*Im(lambda1)*exp(2*t*Im(lambda1))*((2/3)*abs(epsilon2)^2*lambda1*(abs(epsilon1)^2+abs(epsilon2)^2)*exp(t*(I*abs(lambda1)^2+2*Im(lambda1)*conjugate(lambda1))/conjugate(lambda1))+(1/3)*lambda1*(abs(epsilon1)^2+abs(epsilon2)^2)*exp(t*(I*abs(lambda1)^2+4*Im(lambda1)*conjugate(lambda1))/conjugate(lambda1))+(2/3)*conjugate(lambda1)*exp(t*(I*abs(lambda1)^2+2*lambda1*Im(lambda1))/lambda1)*abs(epsilon2)^2+(1/3)*conjugate(lambda1)*exp(t*(I*abs(lambda1)^2+4*lambda1*Im(lambda1))/lambda1)+(1/3)*lambda1*(abs(epsilon1)^2+abs(epsilon2)^2)^3*exp(I*abs(lambda1)^2*t/conjugate(lambda1))+(1/3)*conjugate(lambda1)*(abs(epsilon1)^2+abs(epsilon2)^2)^2*exp(I*abs(lambda1)^2*t/lambda1)+((-I*Im(lambda1)+(1/3)*lambda1+(1/3)*Re(lambda1))*exp((I*conjugate(lambda1)+2*Im(lambda1))*t)+(I*Im(lambda1)+(1/3)*conjugate(lambda1)+(1/3)*Re(lambda1))*(abs(epsilon1)^2+abs(epsilon2)^2)*exp(t*(I*lambda1+2*Im(lambda1))))*abs(epsilon1)^2)*a*conjugate(epsilon1)/(abs(lambda1)^2*((2*abs(epsilon2)^2+2*abs(epsilon1)^2)*exp(2*t*Im(lambda1))+abs(epsilon2)^4+2*abs(epsilon1)^2*abs(epsilon2)^2+abs(epsilon1)^4+exp(4*t*Im(lambda1)))^2)

(2)

bdif1 := simplify(diff(b, x), size); bdif1xzero := simplify(subs({x = 0}, bdif1), size)

4*Im(lambda1)*(2*exp(I*a*x/lambda1)*exp(I*conjugate(lambda1)*t)*(exp(I*a*x/conjugate(lambda1)))^2*exp(-I*a*x/lambda1)*((1/2)*abs(epsilon1)^4+abs(epsilon1)^2*abs(epsilon2)^2+(1/2)*abs(epsilon2)^4+abs(epsilon2)^2*exp(2*t*Im(lambda1))+(1/2)*exp(4*t*Im(lambda1)))*exp((2*I)*a*x/lambda1)*conjugate(lambda1)*(exp(-I*a*x/conjugate(lambda1)))^2+2*exp(I*a*x/conjugate(lambda1))*(((exp(I*a*x/lambda1))^2*lambda1*exp(I*lambda1*t)*((1/2)*abs(epsilon1)^4+abs(epsilon1)^2*abs(epsilon2)^2+(1/2)*abs(epsilon2)^4+abs(epsilon2)^2*exp(2*t*Im(lambda1))+(1/2)*exp(4*t*Im(lambda1)))*(abs(epsilon1)^2+abs(epsilon2)^2)*(exp(-I*a*x/lambda1))^2+exp(-(2*I)*a*x/lambda1)*exp((2*I)*a*x/lambda1)*exp(2*t*Im(lambda1))*exp(I*conjugate(lambda1)*t)*abs(epsilon1)^2*(conjugate(lambda1)-(1/2)*lambda1))*exp((2*I)*a*x/conjugate(lambda1))+(1/2)*(exp((2*I)*a*x/lambda1))^2*exp(2*t*Im(lambda1))*exp(I*conjugate(lambda1)*t)*exp(-(2*I)*a*x/conjugate(lambda1))*lambda1*abs(epsilon1)^2)*exp(-I*a*x/conjugate(lambda1))+exp(I*a*x/lambda1)*abs(epsilon1)^2*exp(I*lambda1*t)*exp(-I*a*x/lambda1)*exp((2*I)*a*x/conjugate(lambda1))*(conjugate(lambda1)*exp(-(2*I)*a*x/lambda1)*exp((2*I)*a*x/conjugate(lambda1))-exp((2*I)*a*x/lambda1)*exp(-(2*I)*a*x/conjugate(lambda1))*(conjugate(lambda1)-2*lambda1))*exp(2*t*Im(lambda1))*(abs(epsilon1)^2+abs(epsilon2)^2))*conjugate(epsilon1)*a*exp(2*t*Im(lambda1))/((2*exp(I*a*x/lambda1)*exp(I*a*x/conjugate(lambda1))*exp(-I*a*x/lambda1)*((1/2)*abs(epsilon1)^4+abs(epsilon1)^2*abs(epsilon2)^2+(1/2)*abs(epsilon2)^4+abs(epsilon2)^2*exp(2*t*Im(lambda1))+(1/2)*exp(4*t*Im(lambda1)))*exp(-I*a*x/conjugate(lambda1))+exp(2*t*Im(lambda1))*abs(epsilon1)^2*(exp(-(2*I)*a*x/lambda1)*exp((2*I)*a*x/conjugate(lambda1))+exp((2*I)*a*x/lambda1)*exp(-(2*I)*a*x/conjugate(lambda1))))^2*lambda1*conjugate(lambda1))

 

2*Im(lambda1)*exp(0)*conjugate(epsilon1)*exp(2*t*Im(lambda1))*a*(conjugate(lambda1)*exp(I*conjugate(lambda1)*t)+exp(I*lambda1*t)*lambda1*(abs(epsilon1)^2+abs(epsilon2)^2))/((((exp(0))^2*abs(epsilon2)^2+abs(epsilon1)^2)*exp(2*t*Im(lambda1))+(1/2)*(exp(0))^2*(exp(4*t*Im(lambda1))+(abs(epsilon1)^2+abs(epsilon2)^2)^2))*lambda1*conjugate(lambda1))

(3)

NULL

Download simplisize.mw

I am trying to define a function f(x1+tau,x2)= (x1+tau)*a+x2*b. I need this to be able to take derivations w.r.t. the sum (x1+tau) and to only tau as well. Is there a way to do this?

I want to approximate a positive function that is decreasing in Gamma, say f(Gamma), that is very complicated yet very smooth. I need this in order to obtain a tractable and compact version of its derivative, which enters in the partial derivative of another (very simple) function.

Along the way, three related questions emerge: Derivatives_and_Approximations.mw

Thanks a lot!

 

I don't why the limit is not providing me the answer; What did I do wrong?

I'd like to be able to define functions with units and then use them.

In the example below, things don't work with Maple input. I've shown one example, with the function f2.

It seems to work better with 2D input, but it seems that it is not possible to make plots.

In the example below, I define f4 as a function of two variables that returns a function of one variable.

I'd like to call the outer function, obtain a function as a result (r1 below) and then plot the latter.

restart

with(Units:-Simple)

NULL

f1 := proc (x) options operator, arrow; x*Unit('m') end proc

proc (x) options operator, arrow; Units:-Simple:-`*`(x, Unit('m')) end proc

(1)

f1(2)

2*Units:-Unit(m)

(2)

f2:=x->xUnit(m)

Units:-Unit(m)

(3)

f2(2)

f2(2)

(4)

f3 := proc (x, y) options operator, arrow; x*Unit('m')*y*Unit('m') end proc

proc (x, y) options operator, arrow; Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(x, Unit('m')), y), Unit('m')) end proc

(5)

f3(2, 3)

6*Units:-Unit(m^2)

(6)

f4 := proc (x, y) options operator, arrow; proc (z) options operator, arrow; x*Unit('m')*y*Unit('m')*z*Unit('m') end proc end proc

proc (x, y) options operator, arrow; proc (z) options operator, arrow; Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(x, Unit('m')), y), Unit('m')), z), Unit('m')) end proc end proc

(7)

r1 := f4(2, 3)

proc (z) options operator, arrow; Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(Units:-Simple:-`*`(2, Unit('m')), 3), Unit('m')), z), Unit('m')) end proc

(8)

r1(4)

24*Units:-Unit(m^3)

(9)

plot(r1)

 

NULL

The contents above aren't showing the error that Maple gives when I try to plot.

Here is a screenshot

Download FunctionUnits.mw

I have a variable with the unit Volt.

I'd like to print something like "The voltage is %f" where the floating point is the value of the variable with the unit.

I've tried the options below so far.

How would one accomplish this?

with(Units:-Simple)

NULL

x := 5*Unit('V')

5*Units:-Unit(V)

(1)

printf(x)

Error, (in fprintf) format string expected

 

printf("%f", x)

Error, (in fprintf) number expected for floating point format

 

printf("%d", x)

Error, (in fprintf) integer expected for integer format

 

printf("%a", x)

5*Units:-Unit(V)

 

printf("%A", x)

5*Units:-Unit(V)

 

printf("%q", x)

5*Units:-Unit(V)

 

printf("%v", x)

5*Units:-Unit(V)

 

printf("%P", x)

                               5 Units:-Unit(V)

 

print(x)

5*Units:-Unit(V)

(2)

print(The*voltage*is, x)

The*voltage*is, 5*Units:-Unit(V)

(3)

print(The*voltage*is*x)

5*The*voltage*is*Units:-Unit(V)

(4)

NULL

Download PrintUnits.mw

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

First 7 8 9 10 11 12 13 Last Page 9 of 43