MaplePrimes Questions

Hello everyone,

I have a question about adding references to a non executable math in a document. Namely, If we use an executable math there is a label that appears on the right of a formula. We can use it as a reference. However, there is no label when we use non-executable math. I wonder how can I refer to that, the point is to create a document with a references to formulas.

To illustrate the point I would like to create a text like the following :

...

X=2 (equation 1)

X=3 (equation 2)

.....Some text here......

From the (equation 2) we can achieve that ....

Regards

Hi

cant get the answer, any comments plz

 

f := (x, y) ->(1/2)*a*(sinh(y-x^2)+tanh(x-y^3)); 
sol := evalf(int(int(f(x, y), x = -6 .. 5), y = -5 .. 5));

where a is the constant no restriction on it ( could be real or complex)

Is there any simple way to combine the commands ChromaticNumber(G) and DrawGraph(G), in order to get a vertex coloring of a graph G? Thanks

Hi everybody,

This is my code:

assume(0 < a, 0 < L, a < L);

M := piecewise(0 <= x and x < a, P*x*(L-a)/L, a <= x and x < L, P*a*(L-x)/L);
ode := diff(y(x), `$`(x, 2)) = M/(E*I__0);
ic := y(0) = 0, y(L) = 0;
sol := factor(dsolve([ode, ic], y(x))); assign(sol); y1 := y(x);

I have two questions:

1) How to plot y1?

I would like to plot y1, but in the plot can to specify a values of a, L, P, E and I.

2) How can I find a maximun and minimun value of y1?

I tried to use maximize and minimize commands but really I don't know if I used them correctly.

Thank you.

 

 

Hello everybody,

 

Being a beginner in maple, I tried to make some animations involving geometrical objects.

I haven't been through any problems for typical 2-variables or 3-variables functions.

However, I couldn't get to making 3d-objects like spheres/cylinders.... to grow in link with a parameter (radius, axes...)

I've found lots of procedures to get sphere to rotate but I didn't succeed in adapting them to, for example, an animation showing a growing zero-centered sphere from radius zero to a radius n (variable entered by the user).

Thank you for your reading, your patience and your kindness.

 

This is a piece of code from my file.

 g(1,a) should be 0, but not. I find some other questions  mentioned  assuming n::posint, but it does not take effect, so how could I avoid this? Thanks.

a := 0.12;
kn := n -> (n + 0.5)*Pi/a;
g := (n, x) -> cos(kn(n)*x);
g(1, a);
 

Hello  i have this pb i don't now what to do :
 

Error, (in simplify/tools/_zn) too many levels of recursion

thank you 

inside a local proc, when calling a  function such as map using the syntax map(x->x^2, target) does one need to declare as local inside the proc?

Same for other Maple calls, which uses something similar. For example 

subsindets(expr,'specfunc( anything, csgn )', f->simplify(f));

does one need to declare local to the proc where the above call is made?

Which one of these two example is more correct?

restart;
foo:=proc(expr)
  local x;
  map(x->x^2,expr);
end proc;

foo([x,y])

vs.

restart;
foo:=proc(expr)
    map(x->x^2,expr);
end proc;
foo([x,y])

In Mathematica for example, such symbols used by similar functions of the system (for example, Plot command, and others) are automatically localized to the system call itself avoiding any conflict with user own symbols.

I am not sure how Maple handles this. Should one always declare these symbols?

Maple 2020.2

 

 

I have a parametric polynomial which is defined based on the multiplication of different variables and I want to rearrange the polynomial based on specific variables. For example, suppose the polynomial is defined as follows:

a:= (1+x+y)(2x-yx+z)(y^2-zy)

and I want to have a based on first, and second orders of x, or even other variables. Thanks

I have an expression with number of csgn(arg) in it.

I'd like to scan this expression, telling Maple to assume arg is positive, in order to replace csgn(arg) by 1.

I am trying to do this using subsindets. But I do not know why it is not working. I am doing this in code, without looking at the expression. So I do not know what the arg's are and how many such cases could be.

Here is an example

expr:=(1+csgn(a)*a)/(3*csgn(b)*b);

To get to each csgn(arg), I am using the type 'specfunc( anything, csgn )'. I checked this is correct type by doing

type(csgn(a),'specfunc( anything, csgn )');

           true

Then

subsindets(expr,'specfunc( anything, csgn )', f->simplify(f) assuming positive);

But this does not change anything. 

I also tried

subsindets(expr,'specfunc( anything, csgn )',f->simplify(f) assuming op(1,f)::positive);

No change, But if I do 

simplify(csgn(a)) assuming positive;

it works. And Maple returns 1. Also this works

simplify(expr) assuming a>0,b>0;

But since I am do not before hand what the arguments to csgn() in the expression are, I can't do the above. I do not know even if expression has csgn() in it even. I am trying to simplify a result I obtain inside the program by doing the above.

What is wrong with my use of  subsindets above?

I think the problem is with using assumptions inside subsindents. As this below works

subsindets(expr,'specfunc( anything, csgn )',f->1);

So the call to subsidents was OK, it is just that the assumptions do not seem to be somehow effective inside.  May be name scoping issue?

Maple 2020.2

edit:

For now and as workaround, I am doing this

restart;
expr:=(1+csgn(a)*a)/(3*csgn(b)*b):
fun:=selectfun(expr,'csgn'); #find csgn if any

if numelems(fun)>0 then
    the_args:= op~(1,fun);
    simplify(expr) assuming map(x->x::positive,the_args)[];
fi;

 

The worksheet below mimics some of the construction in the web site https://www.geogebra.org/m/d4k6SjFX.

This seems a crude and limiting way to display a pencil of ellipses tangent in a quadrilateral.

Please provide references (textbooks, articles, etc.) to the mathematics which produces this kind of display.

Pencil_in_quad.mw

Sorry, I was not able to change the displays to inline.

Hi,

How to generate a random list of 4 elements so the sum of the elements is 1 ?

Thanks

LoiProbabilité2.mw

Hi!

I am trying to plot points, which are supposed to be connected by splines. Within a range of say i from 1 to 5 I would like to calculate f(i) and plot the results. It is however possible in my case that the result is discarded before, lets assume because the result is complex. Then no point is saved for that particular i and the program goes on to i+1. It is then possible to have no point and no spline defined. Therefore the function "plot" can complain if the used names for the graphs have not been defined before, because there is nothing to define. Is there a way to define an empty graph, so that I can define the graphs as the empty graph in the beginning, so that the plot command doesn't complain if no usable points are found? I would need something like this:

Graph:= <EmptyGraph>;
Spline:=<EmptyGraph>;
if numelems(<ListWithUsablePoints>) > 0  then
  <define(Graph)>;
  if numelems(<ListWithUsablePoints>) > 1 then
     <define(Spline)>
  fi;
fi;
plot(Graph, Spline,...)

If the condition under which the points are used is never met, then plot should not complain about Graph and Spline not being defined.

Thank you in advance :)

SIR_model.mw
 

How to solve Part(b)? Anyone can give me some ideas? Thank you

Download SIR_model.mw

 

Hello Maple community and others,

It has been proven that every positive
rational number can be represented in 
Egyptian Fraction form

See wikipedia on Egyptian Fractions

We have the fact that the harmonic series diverges
Let Hn = 1 + 1/2 + 1/3 + ... + 1/n.

Then the limit as n goes to infinity of Hn is unbounded.

It seems these two facts go hand in hand.

Is there a procedure in Maple that will give
Egyptian Fraction representation of an arbitrary
rational number?

I made a worksheet with some examples.

egyptian_fractions.mw

egyptian_fractions.pdf

 

Regards,
Matt

1 2 3 4 5 6 7 Last Page 1 of 1957
´╗┐