nm

11678 Reputation

20 Badges

13 years, 150 days

MaplePrimes Activity


These are questions asked by nm

Could someone please check if this error happens in earlier versions of Maple? I have only Maple 2025.2 on Windows.

Unable to upload worksheet due to new security. Here is the code to run


restart;
integrand:=-3*(Pi-2*arcsin(tau))*(tau+1)^(1/2)*(tau+(tau^2-1)^(1/2))^(2*(tau^2-1)^(1/2)/(tau-1)^(1/2)/(tau+1)^(1/2))*(tau-1)^(1/2)*(-16/3*tau^2+Pi-2*arcsin(tau)+8/3)/(4*tau^2-4);

int(integrand,tau)

The error is 

Why one is no longer able to upload worksheet here showing a problem? I found an internal error in int() but can't upload worksheet.

When I click on the green arrow and select my worksheet, I get this message

What is going on? I am on windows 10 and I tried 2 different browsers. So the problem is on the Mapleprimes site.

Can anyone else try to upload a worksheet to test to see if they get same problem?

Currently, when I have solution to an ode, say y(x)=sin(x)+_C1 and have some initial condition, then to solve for _C1,  I manually substitute the solution into the IC and replace each x by x0 and replace each derivative manually and so on.

This is because I could not find automatic way to do this. Using another software, it is possible to automate this by writing the solution using the  y -> Function[{x}, ...] syntax. But in Maple, I was not sure how to do the same.

Here is a simple made up example. 

sol:= y(x) = sin(x)+_C1;
IC := a*D(y)(x0)+c*y(x0)= b*y0+exp((D@@2)(y)(x0));

The goal is to replace the solution (which is function y(x)) into the IC, and automatically replace all its derivatives and replace x by x0 then solve for _C1 from the equation that results.

Now I do this manually like this

eval(IC,[ y(x0)=eval(rhs(sol),x=x0), 
          D(y)(x0)=eval(diff(rhs(sol),x),x=x0), 
         (D@@2)(y)(x0)= eval(diff(rhs(sol),x$2),x=x0) ])

which gives

But this is too much work.

Using the other software, I can do the above much more easily like this

sol = y -> Function[{x}, Sin[x] + C[1]]
ic = a*y'[x0] + c*y[x0] == b*y0 + Exp[y''[x0]];
ic /. sol

I looked at algsubs, dchange, or making the solution as function instead, and so on but could not emulate the y -> Function[{x}, Sin[x] + C[1]] method in Maple.

What would be similar method in Maple to do the above automatically?  May be there is already builtin function in Maple?

is it possible to collect using pattern? For example, given 

How to tell Maple to collect on  r^power terms to produce

This came up in another forum here  and using that other software, it is possible to ask collect to collect on pattern r^_

Is there a way in Maple to collect on all powers of r in the above? Here is worksheet

A:=r^(2*a)+r^2*(1+a+r^(2*a)) + r + a*r;
B:=(1+a)*r+(1+a)*r^2+r^(2*a)+r^(2+2*a);

r^(2*a)+r^2*(1+a+r^(2*a))+r+a*r

(1+a)*r+(1+a)*r^2+r^(2*a)+r^(2+2*a)

simplify(A-B)

0

collect(A,r)

r^2*(1+a+r^(2*a))+(1+a)*r+r^(2*a)

collect(A,r,'distributed')

r^2*(1+a+r^(2*a))+(1+a)*r+r^(2*a)

collect(A,r,'recursive')

r^2*(1+a+r^(2*a))+(1+a)*r+r^(2*a)

collect(A,r,expand)

(1+a+(r^a)^2)*r^2+(1+a)*r+(r^a)^2

collect(A,r^(n::anything))

Error, (in collect) cannot collect r^n::anything

 


 

Download collect_using_pattern.mw

Using that other software:

 

I do not remember if this came up before. And this is all done in code, without looking at the screen.

Given sqrt(1-cos(x)^2), Maple's simplify does not return sqrt(sin(x)^2), instead it returns ugly result csgn(sin(x))*sin(x) which is correct ofcourse, but why not just return sqrt(sin(x)^2)?  As sqrt(sin(x)^2) is much easier to read than csgn(sin(x))*sin(x).

length of sqrt(1-cos(x)^2) is 29 and length of sqrt(sin(x)^2) is 21.

What Maple simplify seems to do is simplify sqrt(1-cos(x)^2) to sqrt(sin(x)^2) internally, but instead of stopping there, it keeps going and "simplifies" sqrt(sin(x)^2)  to csgn(sin(x))*sin(x).

How to make it stop at sqrt(sin(x)^2)?

Again, this is done in code. Not interactive. code uses simplify() command on most things. 

interface(version)

`Standard Worksheet Interface, Maple 2025.2, Windows 10, November 11 2025 Build ID 1971053`

A:=sqrt(1-cos(x)^2)

(1-cos(x)^2)^(1/2)

B:=sqrt(sin(x)^2)

(sin(x)^2)^(1/2)

length(A)

29

length(B)

21

simplify(A)

csgn(sin(x))*sin(x)

simplify(A,trig)

csgn(sin(x))*sin(x)

simplify(A,size)

(1-cos(x)^2)^(1/2)

simplify(A) assuming x>0 and x<Pi

sin(x)

 

 

Download simplify_dec_3_2025.mw

That other system does it better

Is it possible to make simplify do the same in Maple? 

1 2 3 4 5 6 7 Last Page 1 of 206