MaplePrimes Questions

For a single variable function, I can expand the function 

series(x/(1−x−x^2),x,4);

and get the expansion upto order 4 term.

What shall I do if the function is two variable like f(x,y)=xy/(y−x*sqrt(y)−x^2) and intended to keep terms upto order 5, or moreseries.mw

series(x/(-x^2-x+1), x, 4)

series(x+x^2+2*x^3+O(x^4),x,4)

(1)

series(series(x*y/(1-x*sqrt(y)-x^2), x, 8), y, 4)

O(x^8)+(x^7+x^5+x^3+x)*y+(3*x^6+2*x^4+x^2)*y^(3/2)+(6*x^7+3*x^5+x^3)*y^2+(4*x^6+x^4)*y^(5/2)+(5*x^7+x^5)*y^3+x^6*y^(7/2)+O(y^4)

(2)

``

Download series.mw

say.

My attempt failed as (x^7 + x^5 + x^3 + x)*y etc contains O(8) terms x^7.y

Please help. 

I have some of my main functions defined to take input in different formats. Some have required  parameters and also optional parameters. Similar to how say dsolve can take one ode, or a list of ode's or set of ode's and also other additional arguments.

Currently I use something like  ode::{`=`,set(`=`),list(`=`)} in the signature of the proc to indicate this input can be any of these types. There are also optional aguments.

So inside the proc, it does lots and lots of if this then do such else do such type of logic in order to determine which case/combination of input it is called with.

I am thinking of rewriting all of the API to use overload. Yes, it means I will have lots of copies of the same proc, each to handle specific case of the signature. But it also mean it will be now much simpler inside each of the overloaded proc's to determine which case of call it is processing.

I'd like to ask, is there anything to be aware of before making this change? does it affect performance much? It seems to me it will make the logic and the program simpler.  Here is a very simple example to illustrate.

Which you think is better? I like the overload version more. But I am worried that I will end up with too many versions of the API since I need one for each possible combination and may be this will slow Maple down? 

The following is the worksheet also.

restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):
foo:=overload(
[
   proc(A::`=`) option overload;
       print("single equation");
   end,
  
   proc(A::set(`=`)) option overload;
       if nops(A)=1 then
          print("single eq in a set");
       else
          print("more than one eq in a set");
       fi;
   end,

   proc(A::list(`=`)) option overload;
       if nops(A)=1 then
          print("single eq in a list");
       else
          print("more than one eq in a list");
       fi;
   end

]):

 

3

foo(x=1);
foo([x=1]);
foo([x=1,y=2]);
foo({x=1});
foo({x=1,y=2})

"single equation"

"single eq in a list"

"more than one eq in a list"

"single eq in a set"

"more than one eq in a set"

restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):

foo:=proc(A::{`=`,set(`=`), list(`=`)})

    if type(A,`=`) then
        print("single equation");
    elif type(A,set) then
          if nops(A)=1 then
             print("single eq in a set");
          else
             print("more than one eq in a set");
          fi;
    else #must be list
       if nops(A)=1 then
          print("single eq in a list");
       else
          print("more than one eq in a list");
       fi;
    fi;
end proc:

4

foo(x=1);
foo([x=1]);
foo([x=1,y=2]);
foo({x=1});
foo({x=1,y=2})

"single equation"

"single eq in a set"

"more than one eq in a set"

"single eq in a set"

"more than one eq in a set"

 

Download overload.mw

Consider the following code:

van_der_Waals := (p + a / V[m]^2) * (V[m] - b) = R * T:
expand(van_der_Waals);

The objective of the exercise is express the equation in a cubic form. Obvious solution is to take the output of the code above and multiplie both sides by V[m]^2. However, I would like to know if there exists a different aproach to get the same result.

How can I write a decimal number with period in maple? For example, in the following code;

restart;
number := 3.123123123123:
convert(number, rational);

I got 1040 / 333. However if number := 3.123123 then output is 76123 / 24374, so, in order to solve the exercise assign to the variable number a value of 3.123123123123123123123123123... How can I do it in abreviate form?

simplify is a procedure in Maple that have as parameter an assumption ¿Have the assumption a default value? For example, if we consider the following code:

restart;
f:= (x^3 - 27) / (x^2 - 3 * x):
print(f = simplify(f));

The output of that code assume that denominator is not zero, so I think the procedure have a default value for assume parameter.

I am working with expressions resulting from maple calculations that are 3-4 lines long, but I have to make a term-by-term comparison between one calculation and another. I would like to interweave the results of the two calculation so that one is above the other allowing direct comparison. It would also be nice to break up the expressions into pieces.  Unfortunately, I have gone as far as I can using maple directly.  The only solution I have come up with is to convert the expressions into Tex, copy them to a Tex editor and manipulate the expressions.  Unfortunately, Tex markup makes it difficult interpret the terms. 

Has anyone come up with another method to manually manipulate the output from maple calculations.

eval.mw This is the maple worksheet The regions are u<=-1, -1<=u<=1,u>=1

I want to plot a number created in a loop to monitor how it varies while keeping all previous ones on the figure. This is simply done in Matlab by hold on command, but I dont know how it is possible in Maple?

for i to 22 do
plot([i], [i^.5], style = point) :
end do

Note I want to monitor points during the loop running not after it finishes.

how to write 

-a2/3 + a3 - (2*a4)/3 - (2*a5)/3

into the form 

-(-3*a3 + a2 + 2*a4 + 2*a5)/2

No simplify works. Please help. 

 

test.mw

How to collect the coefficient of epsilon^(1/2) from A.

Actually, I want to write A as A=c1*epsilon^(1/2) +c2*epsilon+c3*epsilon^(3/2)

How to do that? My collect command failed to do this. 

A:=-epsilon^(3/2)*a2^3/4 - (5*epsilon^(3/2)*a4^3)/3 - (5*epsilon^(3/2)*a5^3)/3 + a3*sqrt(epsilon) - sqrt(epsilon)*a2/3 - (2*sqrt(epsilon)*a4)/3 - (2*sqrt(epsilon)*a5)/3 - (5*epsilon^(3/2)*a2)/36 + (5*epsilon^(3/2)*a4)/9 + (5*epsilon^(3/2)*a5)/9 + epsilon/12 + (4*epsilon^(3/2)*a2*a4*a5)/3 - (7*epsilon^(3/2)*a2*a3*a4)/12 - (7*epsilon^(3/2)*a2*a3*a5)/12 + 5*epsilon^(3/2)*a3*a4*a5 - (3*epsilon^(3/2)*a2^2*a4)/4 - (3*epsilon^(3/2)*a2^2*a5)/4 + (2*epsilon^(3/2)*a2*a4^2)/3 + (2*epsilon^(3/2)*a2*a5^2)/3 - 5*epsilon^(3/2)*a4^2*a5 - 5*epsilon^(3/2)*a4*a5^2 + epsilon^(3/2)*a2^2*a3/12 + (5*epsilon^(3/2)*a3*a4^2)/2 + (5*epsilon^(3/2)*a3*a5^2)/2

 Kind help Please It will be acknownoleged please please help

The conditions given the below PDF file link Please help it will be greatly acknowleged

to_maple.pdf

Hello im an amateur using maple for my hidraulics machines course at engineering school. Does anyone know how to use the degrees package on maple 2021, i called it out by using the short form. with(Degrees): and then try to use sind but it doesnt recognice the command.

Also when using RPMs the units that should be giving me m/s appear as m2/m*s(radious). I know that the software recognice it as angular speed but is there anyway to eliminate the (radious) so i can work with the speed as lineal?

We have the system with one discrete variable along x-axis (i.e. 'i' is discrete in the attached file) and other variable 't' is continuous. But maple return error.

CD.mw

Good day everyone,

Please, I need help on how to optimize the function above. I actually wanted to plot the function with respect to "eta", but, I need the optimum value(s) for "alpha". Anyone with useful information should please help.

Thanking you in anticipation for your help.                                                             f=((-0.111000111e-1*alpha^4+.109890109900000*alpha^3+0.110726700000000e-1*alpha^2+0.133899904900000e-3*alpha+0.136700000000000e-4)*exp(-alpha*eta)+(-0.683733733e-5+0.683733733e-5*alpha^2-0.676896396e-4*alpha)*exp(-2*alpha*eta)+0.111000111e-1*alpha^4-.109890109900000*alpha^3-0.110794990900000e-1*alpha^2-0.663221721200000e-4*alpha-0.683733733200000e-5)/(.1*alpha^5-.99*alpha^4-.1*alpha^3)

how to plot multivalued function in the region from  -a to a solving 2nd order ode in maple ?

d^x/du^2+1/2sech^2(u)*x(u)=0  . I have to find out the analytical value in three different regions like u<=-a , -a<=u<=a , u>=a . How to find out ? 

First 221 222 223 224 225 226 227 Last Page 223 of 2362