Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi!

There is some procedure/function to convert C code into maple code? For instance, the above text file

C_code.txt

contains the C code of this paper  http://www.dcs.bbk.ac.uk/~jkl/pubs/JL1_00a.pdf to compute the image of a point in [0,1] under the N-dimensional Hilbert curve and vice versa (i.e., given a point P in the N-dimensional cube [0,1]^{N} find the point t in [0,1] such that t is mapped into P under the Hilbert curve)

Unfortunately, I don't know anything about the C programming language.

Many thanks in advance for your comments.

Fyi, there seems to be some problem here

Maple 2020.2 with Physics 897

restart;
interface(warnlevel=4):
kernelopts('assertlevel'=2):
eq:=exp(x)*sin(y(x))-3*x^2+(exp(x)*cos(y(x))+(1/3)/y(x)^(2/3))*(D(y))(x) = 0;
timelimit(30,solve(eq,y(x)));

 

Full screen shot:

 



Maple Worksheet - Error

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

Download solve_error.mw

Hi,

I noticed that, in Maple 2020.2, the caracters seem smaller. As if the zoom had somewhat been reduced (a bit).

However, in the preferences, the default zoom level I would like is between 100 and 125% (something like 110%) (since the default zoom level is adjusted by steps of +/- 25%). I wondered if there was a way to set the default zoom level to an arbitrary value. In fact I thought it would be great to have a field instead of a list of choices, so we can choose a custom value.

Thank you

I was trying to plot a simple degree two curve but with one point removed. My first attempt was the following;

p1 := plot(x^2 - 1, x = -2 .. 2);
p2 := plot([[0, -1]], style = point, symbol = circle, symbolsize = 20);
plots[display](p1, p2);

But the curve line is shown even inside the circle of the removed point. Changing order of `p1` and `p2` in `plots[display]` doesn't make any changes on the output.

My second attempt was the following.

p3 := plots[display](plottools[disk]([0, -1], 0.1, color = white)):
plots[display](p1,p3);

This didn't help either.

Is there a way to tell Maple to compute an integral over a domain defined by an implicit condition?

A trivial example would be: integrate 1 over the 2D domain defined by x^2+y^2<=1.

I know it's possible to write the explicit double integral

int(int(1,y=-sqrt(1-x^2)..sqrt(1-x^2)),x=-1..1);

Or even as a single integral:

integrate(2*sqrt(1-x^2),x=-1..1);

However, it's not always possible to do this explicitly, depending on the form of the relation f(x,y)=0 defining the domain.

 

My idea was:

int(Heaviside(1-x^2-y^2),[x=-1..1,y=-1..1]);

But Maple returns 0. However, evalf/Int returns the correct numerical value of Pi.

 

Hi,

Is there a way to keep the fractional form of probabilities? I tried with InertForm without success. thanks

ARBREprobabilité.mw

Hello everyone,

There is a strange behaviour with code-edit. Namely, when hiding code-edit window and recovering it, sometimes Maple create a very narrow window. It is very hard to see the code that way. After a while the code-edit region window readjusts itself though. However it takes time.

Also another thing, it would be useful when searching in a worksheet, to have an option that allows to search in code-edit region also.

Best regards,

By the code

P := plot( [ sin(x)-x+(x^3)/3! ] ) :
L := plots[textplot]( [ 3 , 15 , sin(x)-x+(x^3)/3! ],  axes = none) :
plots[display]( P ,L, axes = normal )

I'd like to put the text sin(x)-x+(x^3)/3!  not  sin(x)-x+(x^3)/6   in the image.

I thought  that parse can do that

parse("sin(x)-x+(x^3)/3!")

But One use it in plots[textplot] , it is not useful!

P := plot( [ sin(x)-x+(x^3)/3! ] ) :
L := plots[textplot]( [ 3 , 15 , parse("sin(x)-x+(x^3)/3!") ],  axes = none) :
plots[display]( P ,L, axes = normal )

How to do? Thanks!

 The code

s:=solve(sin(x)=3*x/Pi,x)

gives us following output:

s := RootOf(-sin(_Z)*Pi + 3*_Z)

The allvalues command attempts to find symbolic representations of the roots using solve.
But  the code:

allvalues(s);
solve(sin(x)=3*x/Pi,x,AllSolutions)

gives us 

RootOf(-sin(_Z)*Pi + 3*_Z, 0.5235987756), RootOf(-sin(_Z)*Pi + 3*_Z, -0.5235987756), 0

RootOf(-sin(_Z)*Pi + 3*_Z)

To see the roots of sin(x)-3*x/Pi   we use plot

plot(sin(x)-3*x/Pi,x=-100..100)

 

plot(sin(x)-3*x/Pi,x=-Pi/4..Pi/4)

And we can also figure out  three roots of this function are 0  Pi/6 and -Pi/6

High probability it has no other root.

seq(eval(sin(x)-3*x/Pi,x=i),i in [-Pi/6,0,Pi/6])

0, 0, 0

Why doesn't Maple do anything about it

 

 

 

Why doesn't the graphs of alpha=0 and alpha=1  appear in the following code?

restart:
v:=t->t:
plot([seq(fracdiff(v(t), t,alpha),alpha=-1..1.5,0.5)],t=0..10,view=[0..9.5,0..5],legend=[seq('alpha'=alpha,alpha=-1..1.5,0.5)],color = [red, blue, green,yellow,cyan,magenta],axis[2]=[gridlines=[linestyle=dot]]);

 

if alpha=1;

fracdiff(t, t,alpha)

gives 1. But it doesn't appear in the figure. 

if alpha=0, 

fracdiff(t, t,alpha)

gives t. But it doesn't appear in the figure, also. 

How can i remove a section envelope ( the initial arrow and the vertical line) without removing the content.

In other words how can I liberate the content from being imprisoned in the section

 

Thank you

Hi,

I would like to create an animation of the solutions to a differential equation, but I can't get animation to work.  I copy and pasted

plots[animate]( plot, [A*sin(x), x=0..10], A=0..2 )

into maple, but the animation did not animate, and only plotted the result for A = 0.  I am using Maple 2019.  Any ideas?

restart:
nuhf:=0.294*10^(-6):
Rehf:=Vhf*H/nuhf:
Vhf:=0.5:
rhohf:=965.31:
Lhs:=2.5*10^(-3):
DP1:=f1*Lhs*rhohf*Vhf^2/(2*H):
f1:=4*18.3/Rehf:
Whs:=1:
mhf:=rhohf*Vhf*Whs*H:
Rehf:=Vhf*H/nuhf:
PL1:=DP1*mhf/rhohf:
DP2:=f2*Lhs*rhohf*Vhf^2/(2*H):
f2:=0.3164/(Rehf^(0.25)):
PL2:=DP2*mhf/rhohf:
procd:=proc(H)
    if Rehf<1000 then PL1 elif Rehf>1000 then PL2 else 0 fi;
   end;

plot('procd(H)',H=0..0.002);

When doing solve(res,x); maple returns back x

Does this means the equation is true for any x?

Also, doing PDEtools:-Solve(res,x) returns nothing.

I was trying to check if my solution is valid for an ode, and I obtained res above is what odetest() gives back, I wanted to find for what could res be zero.

Here is the code

restart;
ode:=diff(y(x),x)=2*sqrt(1+y(x))*cos(x);
my_sol:=y(x)=sin(x)^2+2*sin(x);
res:=odetest(my_sol,ode);
res:=simplify(res)=0;
solve(res,x);

And now 

PDEtools:-Solve(res,x)

gives nothing.

So I am a little confused what is going on. does solve result mean the equation is true for any (I think the solution I have is correct, so may be what this means,  but wanted to make sure, as I do not think I've seen this before)  And if so, why then PDEtools:-Solve did not return the same result.

Maple 2020.2, windows 10, Physics 897

First 460 461 462 463 464 465 466 Last Page 462 of 2224