C_R

1895 Reputation

19 Badges

4 years, 159 days

MaplePrimes Activity


These are replies submitted by C_R

Malpe has a fracdiff command. Have you had a look at this.

Is that the DE you want to solve

fracdiff(u(r),r,1/2)=r^2/25+(sin(u(r))+sin(fracdiff(u(r),r,1/2)))/47+r;

Maybe usefull:

https://www.mapleprimes.com/questions/228656-How-Do-I-Solve-Fractional-Differential

https://www.mapleprimes.com/questions/234553-How-To-Calculate-The--Fractional-Derivative

There is more on Mapleprimes if you search for fracdiff.

@Carl Love 

Your answer makes totally sense provided that there is a solid mathematical and computer science background. This is not the case for most of Maple users (including me). It would be good that such an explanation was part of Maple's help documentation. It seems that the property help page needs some adjustments.

Even with your explanation, I still do not understand why a property realcons is needed. On the real line every value is constant. 

 

Have you read these posts?

@Scot Gould 

Not only has the speed improved, but the functions that I was convinced that work are back as well

@Carl Love 
I was looking for a construct that only lists names displayed to the user and/or used in a session (i.e. names added after start up)
 

# works in 1-D Math input
dsolve(diff(y(x), x, x) = 2*y(x) + 1);
{unames()}:
has(%,c__1);
has(%,_C1)

The above set of names can be used to scan for existing displayed c__n. However, I did not propose it because @nm was interested in _Cn that he wanted to add. These do not seems to match the c__n displayed. I could not figure out a link been made between these two types constants to make it usable for nm.

Compiling a set of names takes time and filtering by an initial set of names (using minus) did not work. Do you know why this does not work?

{unames()}:iu:=%;
dsolve(diff(y(x), x, x) = 2*y(x) + 1);
{unames()} minus iu;
has(%,c__1)

In any case using commands like dsolve blows up the set of unames which is not good to keep an overview.

 

@nm 
Here is a fix

sol:=_C22+x-_C3*x+_C2*x^2;
indets(sol,And(symbol, suffixed(_C, nonnegint)));
myconstants:=sort([%[]],length); 
n:=1; 
do n++ until is(_C||n=myconstants[-1]):
new_constant := _C ||(n+1)

By the way: I though that there is "name" command, like anames, which can list all instances of names and names used in values assigned to names but could not find a construct.

 

@nm 

OK, my sorting works only up to 9. Its not a good option.

@dharr 
I think PDEtools:-dchange gets it wrong

I1:=Int(sin(x^4)/(sqrt(x)+x^2),x=0..infinity);
PDEtools:-dchange(x=u^(1/4),I1);
value(%);
evalf(%);

 

@Rouben Rostamian  
FYI: On my machine your solution is 6 times faster compared to restarting the integration after 200 bumps

t:=Time():
[seq(evalf((200*Pi*i)^(1/4)), i = 0 .. 5)]:
range_list:=[seq(%[i] .. %[i + 1], i = 1 .. nops(%) - 1)]:
seq(evalf(Int(abs(sin(x^4))/(sqrt(x) + x^2), x = i)), i in range_list):
add(%);
Time()-t;

What makes your solution interesting is its periodicy. A good starting point for precise approximations (with known error perhaps) that could be evaluated much faster than direct integration. If that is of interest.

@Axel Vogt 

Maybe this example explains better where I am stuck

`^`(`^`(a + b, 4), 1/2);
                                  (1/2)
                        /       4\     
                        \(a + b) /     

This cannot be written with compound procedures (or operators in this case, which are procedures themselves if I am not mistaken). Here is an attempt

(`^`@`^`)((a + b, 4), 1/2);

which can be modifed this way not make it work

(sqrt@`^`)(a + b, 4);

But what can be done if powers other than 1/2 are involved? There seems to be no way to pass extra arguments.

I am inventing now code to show a structure that separates (names of) procedures from arguments (using the % symbol do indicate that the output from the preceeding procedure call is used)

(`^`@`^`)([(a + b, 4)],[(%, 1/2)]);

These examples are trivial. However, sometimes compound procudure calls are quite handy for example to simplify expression, where a sequence of commands expand, factor, normal, simplify, ... are effecitve. However, when extra arguments (for collect for example) are required procedure composition does not work any more.

Maybe there  are other ways than functional programming using the ()() construct to do this. One could think of a procedure with a long list of arguments starting with a sequence of procedure names followed by a stack of parameters that is processed from the left to the right. However, this would probably not be easy to read, although compact.

@yasi add the view option to Roubens answer (here with 0.01 instaed of 0.0001)

plots:-display(plot(x^2, x = -1 .. 1, linestyle = dot), plot(x^2 + 1, x = -1 .. 1, linestyle = spacedash), plot(x^2 + 2, x = -1 .. 1, linestyle = dashdot), thickness = 3, view = 0.1e-5 .. 0.01)

 

Yes on two computers and with two browsers.

I had a suspicion that a VPN connection was responsible for that but his was wrong.

@acer 

Thank you all. This was copied code I modifed to test a triangular domain. I overlooked the restart...

Nice modification of the range by the way.

Just a comment: What makes your example challenging is that "Expression of secondary variables" still contains the primary variables.

I think there is a way if you could provide the equation and tell what the terms with the double bar stands for (i.e. provide the equations). This would make answers easier.

PS.: I also get two images

It's the other way around: You can use ChatGPT from Maple. Have you read this post?

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