MaplePrimes Questions

B(4) := x^4 - 4*x^3/(2 + p) - 6*(p - 1)*x^2/((3 + p)*(2 + p)) - 4*p*(p - 5)*x/((4 + p)*(3 + p)*(2 + p)) - (p - 1)*(p^2 - 15*p - 4)/((5 + p)*(4 + p)*(3 + p)*(2 + p));
for p from -1 to 5000 do
    A(p) := fsolve(B(4), x, ':-complex');
end do;
Error, (in fsolve) p is in the equation, and is not solved for
ptlist := [0];
for j from -1 to 5000 do
    ptlist := [op(ptlist), A(j)];
end do;
with(plots);
complexplot(ptlist, x = -1 .. 1.5, y = -0.5 .. 0.5, style = point);


I get an error with this code, but when I replace B(4) with its assignment in fsovle, it works. Why is this, and is there a way I can write B(4) instead of the longer expression x^4 - 4*x^3/(2 + p) - 6*(p - 1)*x^2/((3 + p)*(2 + p)) - 4*p*(p - 5)*x/((4 + p)*(3 + p)*(2 + p)) - (p - 1)*(p^2 - 15*p - 4)/((5 + p)*(4 + p)*(3 + p)*(2 + p)) in the fsolve argument?

ishak.mw
 

restart

with*plots; -1; ode1 := diff(f(eta), eta, eta, eta)+(1/2)*f(eta)*(diff(f(eta), eta, eta)) = 0

diff(diff(diff(f(eta), eta), eta), eta)+(1/2)*f(eta)*(diff(diff(f(eta), eta), eta)) = 0

(1)

ode2 := (diff(theta(eta), eta, eta))/pr+3*N*f(eta)*(diff(theta(eta), eta))/(6*N+8) = 0

(diff(diff(theta(eta), eta), eta))/pr+3*N*f(eta)*(diff(theta(eta), eta))/(6*N+8) = 0

(2)

bcs1 := f(0) = 0, (D(f))(0) = S, (D(f))(16) = 1-S;

f(0) = 0, (D(f))(0) = S, (D(f))(16) = 1-S

(3)

fixedparameter := [pr = 1];

[pr = 1]

(4)

ode3 := eval(ode2, fixedparameter);

diff(diff(theta(eta), eta), eta)+3*N*f(eta)*(diff(theta(eta), eta))/(6*N+8) = 0

(5)

ode4 := eval(ode1, fixedparameter);

diff(diff(diff(f(eta), eta), eta), eta)+(1/2)*f(eta)*(diff(diff(f(eta), eta), eta)) = 0

(6)

bcs2 := theta(16) = 0, (D(theta))(0) = -a*(1-theta(0));

theta(16) = 0, (D(theta))(0) = -a*(1-theta(0))

(7)

 

L := [1, 5, 10]

[1, 5, 10]

(8)

 
  

``


  for k to 10 do
      sol_All := dsolve
                 ( eval
                   ( {bcs1, bcs2, ode3, ode4},
                     [N= L[k],a=1,S=1]
                   ),
                   [f(eta), theta(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])
  end do:

Error, invalid subscript selector

 

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

1, [HFloat(0.8022978364702027), HFloat(0.19770216352979716)]

 

5, [HFloat(0.7250508085648081), HFloat(0.27494919143519203)]

 

10, [HFloat(0.7099202264181006), HFloat(0.29007977358189907)]

 

Error, invalid subscript selector

 

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

1, [HFloat(-0.4437495989448031)]

 

5, [HFloat(-0.4437495983315978)]

 

10, [HFloat(-0.4437495982077529)]

 

Error, invalid subscript selector

 

``

  plot( [ seq((Y_sol||j)(eta), j = 1..16)],
         eta = 0 .. 10,
         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 .. 8,
         labels = [eta, fprime(eta)],
         axes = boxed
      );

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

 

 

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

 

 

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

 

 

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

 

 

NULL

``

NULL


 

Download ishak.mw

Good day every one;

please im soliciting for a help on how to plot my Nusselt number and Skin friction.

The attached is plotting against the dependent variable (eta) but i want skin friction (f  ' ' ) against N or Pr not against eta 

thank you for your help in aticipation

I have the following polynomials, and I want to multiply each term of the polynomial by the least common denomiator, so that the denominators are cleared. However, I want to keep the products and powers of terms together. So for example, B(2) should become (2+p)(3+p)x^2-2(3+p)x-p-1.

How can I accomplish this? Alternatively, given the following polynomials, I want to factor only the expressions of p in the brackets, so we have (2+p), (2+p)(3+p), etc.

Hi, 

I'm trying to solve an ODE. I don't understand why Maple returns nothing when I run this code. 

with(ODETools):
dsolve(diff(y(x), x) = (6*y(x)^5 - 3*y(x)*x^2 - 20*y(x)^3*x)/(-4*x^3 + 30*y(x)^2*x^2 - 30*y(x)^4 + 7*y(x)^6), y(x));

I don't have any error messages, it just doesn't return anything.

Thank you very much for your time and your help. 

Hello. Plotting a graph in the polar coordinate system using polar plot (example). Is it possible to make it display 90 degrees instead of Pi/2, 45 degrees instead of Pi/4, and so on. Thanks

Hello,

How to solve an equation like and show all values ?

Thanks

Whenever i press F5, Maple will switch to nonexecutable math so I have to press it once more to go to math. This is very annoying. I would very much like to have it just switch between math and text when i press F5 like it used to do. 
How do I make it so?

Please help.

I tried to change my email on my account, and got a message that an email was sent to confirm, but never got an email.
I may have more than one account, because I tried to change my user name, but I can't log onto that account so I tried password reset, and the same thing. I got a message that an email was sent, but I haven't received that either.

I'm logged in now, but I suspect I won't be able to get back in.

my email is mgmcderm@gmail.com

I didn't realize until now that ExcelTools:-Import will not return a value for a cell that has an equation inside. Am I doing something wrong?

I'm trying to do some manipulation of expressions that contain products of scalars and non-commuting operators (as defined by the physics package). The worksheet below shows this on a particular example. I can imagine a long/tedious way to do this, but perhaps the two key steps outlined below might be easily handled by some pattern-matching maple trickery, that is obvious to the pros here? 

In short, I need to convert expressions of the general form:

 

expr:=alpha*Sx*Sz^2 + beta*Sy*Sz + gamma*Sz*Sy*Sx  + Sx + beta^2;

to something like:

expr3:=alpha*f([Sx,Sz, Sz]) + beta*f([Sy,Sz]) + gamma*f([Sz, Sy, Sx]) + f([Sx]) + beta^2;

... with the caveat that the 'Sk' are operators (and their products could be of an arbitrary length).

 

The context here (for those who care) is basically to use the nice handling of non-commutative algebra of the Physics package to write down some Heisenberg equations of motion for a given system, and then approximate those using a cummulant expansion (this is in practice really tedious to do by hand in even simple systems, but arguably the most painful part is trivially done by the physics' package nice handling and sorting of the non commuting oprators). That, in essence requires one to transform larger products of non-commuting operators into smaller products (so say approximating an expectation value of 3-operator product as a sum of 2-operator peoducts and single operators). 

If anyone has ideas how best to approach this in the maple-ish way, please let me know.

thanks!


 

restart:

Init related stuff

with(Physics);

[`*`, `.`, Annihilation, AntiCommutator, Antisymmetrize, Assume, Bra, Bracket, Check, Christoffel, Coefficients, Commutator, CompactDisplay, Coordinates, Creation, D_, Dagger, Decompose, Define, Dgamma, Einstein, EnergyMomentum, Expand, ExteriorDerivative, Factor, FeynmanDiagrams, FeynmanIntegral, Fundiff, Geodesics, GrassmannParity, Gtaylor, Intc, Inverse, Ket, KillingVectors, KroneckerDelta, LeviCivita, Library, LieBracket, LieDerivative, Normal, NumericalRelativity, Parameters, PerformOnAnticommutativeSystem, Projector, Psigma, Redefine, Ricci, Riemann, Setup, Simplify, SortProducts, SpaceTimeVector, StandardModel, SubstituteTensor, SubstituteTensorIndices, SumOverRepeatedIndices, Symmetrize, TensorArray, Tetrads, ThreePlusOne, ToContravariant, ToCovariant, ToFieldComponents, ToSuperfields, Trace, TransformCoordinates, Vectors, Weyl, `^`, dAlembertian, d_, diff, g_, gamma_]

(1)

algebra_rules:={NULL
,%Commutator(Sx,Sy)=I*Sz
,%Commutator(Sy,Sz)=I*Sx
,%Commutator(Sz,Sx)=I*Sy
};

{%Commutator(Sx, Sy) = I*Sz, %Commutator(Sy, Sz) = I*Sx, %Commutator(Sz, Sx) = I*Sy}

(2)

Setup(mathematicalnotation=true, hermitianoperators = {Sx, Sy, Sz}, algebrarules=algebra_rules);

[algebrarules = {%Commutator(Sx, Sy) = I*Sz, %Commutator(Sy, Sz) = I*Sx, %Commutator(Sz, Sx) = I*Sy}, hermitianoperators = {Sx, Sy, Sz}, mathematicalnotation = true]

(3)

 

Say i have an expression like this below. In principle, each term could be a product:

(scalar) * (some prodcut of opertors)

with some arbitrary number of operators.

expr:=alpha*Sx*Sz^2 + beta*Sy*Sz + gamma*Sz*Sy*Sx  + Sx + beta^2;

alpha*Physics:-`*`(Sx, Physics:-`^`(Sz, 2))+beta*Physics:-`*`(Sy, Sz)+gamma*Physics:-`*`(Sz, Sy, Sx)+Sx+beta^2

(4)

would like apply ave(expr) and end up with:

expr2:=alpha*ave(Sx*Sz^2) + beta*ave(Sy*Sz) + gamma*ave(Sz*Sy*Sx)+ ave(Sx)   + beta^2;

alpha*ave(Physics:-`*`(Sx, Physics:-`^`(Sz, 2)))+beta*ave(Physics:-`*`(Sy, Sz))+gamma*ave(Physics:-`*`(Sz, Sy, Sx))+ave(Sx)+beta^2

(5)

so basically need a rule that forces:
ave(scalar*operators)->scalar*ave(operators)
with
ave(scalar)=>scalar

Next, given expr2, would like to be able to apply some transformation to all the ave(XXX) functions.
for simplicity let's assume that I would like a following transformation:

ave(A*B*C ....)->f([A, B, C, ...])

with each of A, B, C here being an operator.

However the crucial point is that if there are powers of operators, each one should get its own entry in the list. So for example:

ave(A*B^2)->f([A, B, B]).
So applying this transformation to expr2, should give:

expr3:=alpha*f([Sx,Sz, Sz]) + beta*f([Sy,Sz]) + gamma*f([Sz, Sy, Sx]) + f([Sx]) + beta^2;

alpha*f([Sx, Sz, Sz])+beta*f([Sy, Sz])+gamma*f([Sz, Sy, Sx])+f([Sx])+beta^2

(6)


 

Download cumulant.mw

Hello, 

Im having trouble fully opening the contents of my maple file. Only half of the doucment is showing up.

I get the following message: "There were problems during the loading process, Your worksheet may be incomplete."

There is also no bak. file available. 

Can anyone please help?

matOpgaver_1.mw.zip

 

sys_ode.mw 

sys := -diff(g(x), x)*e^(c*x)*c/(3*t) + f(x) = 0, t*(c*e^(2*c*x)*diff(g(x), x) + t*e^(c*x)*(2*c^2 + 3*f(x) - 1))*diff(f(x), x) + 6*c^2*(diff(f(x), x, x)*t*e^(2*c*x) + diff(f(x), x, x, x)*e^(3*c*x)/3) = 0. I have attached worksheet. Please solve this system,of ODE.

I was wondering if anyone had a solution for this issue, everytime I try to export my work as a .pdf file the program freezes up and I have to shut it off using task manager.

I have Maple 2020 installed in addition to Maple-Gym.

So Maple 2019 seems to be unable to evaluate a relatively easy integeral for a positive integer, but when the obvious substitution u=cos(x) is made it is able to evaluate the integral.  Is there some setting I am using that is causing Maple to give up without much effort?  
 

restart

assume(n::integer, n > 0)

about(n)

Originally n, renamed n~:
  is assumed to be: AndProp(integer,RealRange(1,infinity))

 

int(sin(x)^(2*n+1), x = 0 .. Pi)

int(sin(x)^(2*n+1), x = 0 .. Pi)

(1)

for j to 5 do int(sin(x)^(2*j+1), x = 0 .. Pi) end do

4/3

 

16/15

 

32/35

 

256/315

 

512/693

(2)

int((-u^2+1)^n, u = -1 .. 1)

GAMMA(n+1)*Pi^(1/2)/GAMMA(n+3/2)

(3)

for j to 5 do int((-u^2+1)^j, u = -1 .. 1) end do

4/3

 

16/15

 

32/35

 

256/315

 

512/693

(4)

``


 

Download walter.mw

Suppose you have some functions like:

S^1 --> S^1: w(x,y) = (x^2 - y^2, 2xy)

Then this is equivalent of

w(exp(i 2Pi t)) = exp(i 4 Pi t)

Or if I have S^1 --> S^1: w(x,y) = (-y,x), we would get:

w(exp(i 2Pi t)) = exp(i 2 Pi (t+1/4))

 

How can I obtain the second form of the expression in Maple given the first one?

First 154 155 156 157 158 159 160 Last Page 156 of 2177