Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi
I have a huge trigonometric expression in Maple with an approximate length of length(.)=397593353.

When I compute this expression in Matlab, I receive another expression with a much smaller length, and the reason is that Matlab is using subexpressions to calculate the main expression. However, I need to do this in Maple.

I have already tried to simplify, but it didn't work.
The maple worksheet & a screenshot of the Matlab subexpression is attached.

See below file for expression in maple (Please run the "Main.mpl" in the attached file.):

Ldiff.zip

And part of the expression in Matlab is shown in the below picture

Where the subexpressions (again in Matlab) are shown below:

Let a,b,c,d and E be constants.

Prove that Laplace{at^-c+bt^-d} = E{as^-c+bs^-d}

if and only if c+d=1 and E= +or-  sqr(pi*csc(c*pi))

Given the property of Gamma:

Gamma(p)Gamma(1-p)=pi/(sin(p*pi)), 0<p<1

This is from an old Schaums outline on Laplace Transforms.

By hand i get  E{as^-d+bs^-c}.

Cant figure out how to get Maple to express this.

Greeting to all of you, I'm having problem in searching for R in this silmutaneious equation. How do I solve this?

 

Please help me to solve the system of nonlinear ordinary differential equations with the help of the Homotopy perturbation method in MAPLE. I have attached a worksheet please check.  Please please help me.

Thank you

HELP.mw

Hi,

Is there a way to change the font type and size when printing a table of data using DocumentTools:-Tabulate? Also can I change the column width?

DocTabFont.mw

I have calculated z=f(x,y) for x from 0 to 5 and y from 0 to 5 by taking step size 0.5  and stored it in a matrix M. Now I am trying to plot the resultant matrix having order 11x11. Where x and y values are ranging from 0 to 5. But If I use this command
matrixplot(M, heights = histogram, colorscheme = ["Blue", "Green", "Yellow", "Red"])
It is taking 0 to 11 on both x and y axis. It must be 0,0.5,0.1,0.15...5.
How to change the values of x and y axis manually?

hi! how can I write it correct?

this is the parametric curve in cartesian coordinates:

spacecurve([2*t^3 - 2*t, 4*t^2, t^3 + t], t = -1 .. 1, color = black, numpoints = 1000, orientation = [90, 90, 90]);

and this should be the same curve but in spherical coordinates:

spacecurve([sqrt(5)*(t^3 + t), arccos(1/sqrt(5)), arccot((t^2 - 1)/(2*t))], t = -1 .. 1, coords = spherical, color = black);

I rewrite that parametrization using formula from this page 

https://en.wikipedia.org/wiki/Spherical_coordinate_system

why doesn't it work?

help on structured type says

| identical(expr) an expression identical to expr

and

The type identical(expr) matches the expression expr identically. If there is more than one expr (i.e. identical(expr1,expr2,...)), then this type matches any one of the exprN identically.
 

Then why does the following produce the same output?

restart;
expr:=x*A[2]+A[1];
select(type,expr,'`*`'({anything, identical(x^2)}));
select(type,expr,'`*`'({anything, identical(x)}))

x*A[2]

x*A[2]


I would have expected only the second select to find x*A[2].

What do I need to only select anything*x^2 without selecting anything*x ?

Actually anything in identical gives same result

select(type,expr,'`*`'({anything, identical(zzzzz)}));

x*A[2]

So I must be misunderstanding something about identical and how it works.  I want to match only anything*x^2 and nothing else. How to do that?

all these things are trivial to do use pattern matching. But in Maple, one is supposed to use structured types.

 

I can't figure this one out.

I need to pick out the subexpression   anything*sin(3*x) from an expression.

it works, when the expression is   anything*sin(3*x)+something else. But when the expression is exactly  anything*sin(3*x) then select returns and not anything*sin(3*x) as I was expecting.

So I must be doing something silly, but do not see it.

restart;
TypeTools:-AddType('type_1', '`*`'({anything,identical(exp(3*x))}));
expr:=25*A[1]*exp(3*x);
type(expr,type_1);

returns true. good. Now I test it on 

select(type,expr+sin(x),type_1) ;

and this returns what is expected. 25*A[1]*exp(3*x) but when I type

select(type,expr,type_1) ;

it return

reading select help page did not help.  Tried flatten, inplace.

I can do this using patmatch

patmatch(expr,a::anything*exp(3*x),'la');la

But why is select not working in the above? What is the correct way to do this so it works for a*expr+anything and also for a*expr only? This is done inside a function and not interactive. So I need it to work for both cases, since the input can be anything, but I only need the term anything*exp(3*x) pulled out.

 

Hi,

As I am continuing to use Maple, I find I use multiple customized worksheets and documents as well as a maple student guide or AEM guide.......How can I save the workspace with these other documents so that I don't have to rebuild them everytime I use that customized Maple system?

Thanks for your help!

Frank

My first day attempting Maple so probably something simple about environment variables.

I'm trying to use Digits in an expression to set and use the preceision. It seems to set the value if used in a procedure but seems to update the variable after the execution of multiple commands executed together - also setting a variable from Digits, updating it, then using that in evalf doesn't help.

Digits := 1

Digits := Digits + 1; Digets; 1.0/3;

Gives 1 digit, Setting of Digits takes affect after the evaluation.

f := proc() Digits + 1; 1.0/3; end proc

f();

2 digits - so the setting of Digits takes effect before the evaluation. Looks like the procedure is executed as separate commands.

So repeated executes of 

f(); Digits++;

Will increment the precision as will

f := proc() Digits++; print(evalf[Digits](1.0/3)); return Digits; end proc; Digits := f();

Also

a := 1; a := a + 1; evalf[a](1.0/3);

Gives 2 digits

a := Digits + 1; evalf[a](1.0/3);

Gives 1 digit.

a := eval(Digits + 1); evalf[a](1.0/3);

Gives 1 digit.

A := [1, -2, 3]:u := `<,>`(0, -2, 2):v := `<,>`(5, 8, -3):
PL := proc (A, u, v) local d, Det, AP, t, U, V;
AP := `<,>`(x-A[1], y-A[2], z-A[3]);
Matrix(`<|>`(`<,>`(AP), `<,>`(u), `<,>`(v)));
Det := LinearAlgebra:-Determinant(%); d := igcd(coeff(Det, x), coeff(Det, y), coeff(Det, z), tcoeff(Det));
print(`Une équation cartésienne du plan est :`);
t := Det/d; print([t = 0]);
print('Une*représentation*paramétrique*du*plan*est; -1');
U := convert(u, list); V := convert(v, list);
[x = lambda*U[1]+mu*V[1]+A[1], y = lambda*U[2]+mu*V[2]+A[2], z = lambda*U[3]+mu*V[3]+A[3]] end proc;
PL(A, u, v);

plan3p := proc (A::list, B::list, C::list)
local d, M, N, P, Mat, Det, t, U, V;
M := `<,>`(x-A[1], B[1]-C[1], C[1]-A[1]); N := `<,>`(y-A[2], B[2]-C[2], C[2]-A[2]); P := `<,>`(z-A[3], B[3]-C[3], C[3]-A[3]);
Mat := Matrix([M, N, P]);
Det := LinearAlgebra:-Determinant(%);
d := igcd(coeff(Det, x), coeff(Det, y), coeff(Det, z), tcoeff(Det));
print(`Une équation cartésienne du plan est :`);
t := Det/d; print([t = 0]); print('Une*représentation*paramétrique*du*plan*est; -1');
U := A-B; V := B-C;
[x = lambda*U[1]+mu*V[1]+A[1], y = lambda*U[2]+mu*V[2]+A[2], z = lambda*U[3]+mu*V[3]+A[3]] end proc;
A := [-6, 3, -2]; B := [5, 2, 1]; C := [2, 5, 2];plan3p(A, B, C);
How to know if these procedures are correct or not. Thank you.

I want to have a proc, which returns an expression using an indexed symbol. The proc needs to basically generate constansts to use to build an expression, similar to how dsolve uses _Cn.  But I do not want to use _Cn for this so not to confuse the expression with another one that was generated using _Cn already.

So I thought to use a local symbol say A.  (I could have used _Zn also, but I think _Z is also used by Maple).

The symbol A is first declared local to the proc, and then the proc returns the expression using A[n]. For example  A[0]*x+A[1]*x^2 etc... The number of A[n]'s is not known before hand, but should not be more than 10. 

I want to make sure that A[n] returned is really part of the local symbol and not different symbol to avoid clash with any global A[n] 

When I do the following check

restart;
foo:=proc()
 local A;
 return A[99]
end proc;

expr:=foo()

type(expr,`global`)

gives

good. So Maple says that A[99] is not global. But when I do

type(expr,`local`)

it also says false!

My question is: When making local A , will A[1] and A[2] also be local, or are they different symbols? Maplemint says nothing about it, so I assume A[n] is local also?

maplemint(foo)
Procedure foo() 
  These local variables were used but never assigned a value:  A

It did not say that A[99] was never declared local. This tells me that A[99] is local, because A is local. But then why did type(expr,`local`)  say false?

Hi,

I was wondering why each time solve is executed, I get a different of number of solutions and can I specify the number of solutions?

 

Thanks so much for taking time to answering this question.

 



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/number_of_solutions.mw .
 

I don't way the above error happened. But here is my worksheet below.

Download number_of_solutions.mw

First 383 384 385 386 387 388 389 Last Page 385 of 2216