MaplePrimes Questions

What is the logic behind this. 

restart;
expr:=int(f(x),x);
lprint(algsubs(int=Int,expr));
lprint(subs(int=Int,expr));

gives


   int(f(x),x)

   Int(f(x),x)

So algsubs failed to replace int by Int

Looked at help. and see nothing. But I might have overlooked something. It says

It is a generalization of the subs command, which only handles syntactic substitution.

Generalization? If so, I expected it to work here. But may be there is a subtle reason why it did not? May be with algsubs, the replacement has to be algebraic expression and "int" is not, it is just a name.

Maple 2020.2
 

Hello Maple experts.

According to our teacher class notes, the ODE   y'=2*sqrt(y) with IC  y(0)=0 has 2 solutions. y(0)=0 and sqrt(y)=x

I am not able to get Maple to give the second solution,. It only gives y(0)=0.

Is there an option I am overlooking to make it give the other solution sqrt(y)=x ?

ode := diff(y(x),x) = 2*sqrt(y(x));
ic:=y(0)=0;
sol:=dsolve([ode,ic],y(x));

One can see the other solution by doing this

ode := diff(y(x),x) = 2*sqrt(y(x));
ic:=y(0)=A;
sol:=dsolve([ode,ic],y(x));
subs(A=0,sol)

I tried this in Mathematica. Mathematica does not give y=0 but it gives the second solution

I tried the singsol=all also, but it had no effect. Maple only shows the y(0)=0 solution.

Any suggestions?

Maple 2020.2

 

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));

evalf(int(int(f(x, y), x = -6 .. 5), y = -5 .. 5)):

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 :)

First 354 355 356 357 358 359 360 Last Page 356 of 2308