Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello,

I would like to define two vectors in spherical coordinates (preferably using Physics[Vectors] package) such that these two vectors have the magnitudes of r1 and r2, resepctively, but pointing in different directions.

In Physics[Vectors] package, basis vectors _r,_theta,_phi are predefined. So, I cannot define the vectors as r1_:=r1*_r1 and r2_:=r2*_r2 and use all the cool features of physics package.

I will eventually be needing the norm of the difference of these vectors at a later calculation, but this representation turned out to be a problem.

I am avoiding to define these vectors  in cartesian basis with spherical coordinates such as r1_=r1*(sin(theta1)*cos(phi1) i + sin(theta1)*sin(phi1) j + cos(theta1) k), etc. which is a work around. 

How can I do this in Maple?

Thank you.

 

 

 

How can we obtain the expression of the function f : R --> R defined, for each (a, b) such that -oo < a <= b < +oo, by this equality?

Int(f(x), x=a..b) = Int(f(x), x=1/b..1/a)

Replacing x by 1/y in the rhs integral shows that f satisfies this functional equation 

f(y) = f(1/y)/y^2

(note this impose y <> 0, see the PS below)
Functional equations is not y cup of tea and Maple (2015) doesn't seem to have any feature to solve them.
Could anyone explain me how f can be obtained?

PS:
I inadvertently obtained this equality between integrals as I was comparing the performances of different numerical integration methods.
One of the functions in my benchmarks suite had the expression f(x)=1/(1+x^2)... and I "discovered", by changing x to 1/y to ease the numerical integration, that f checked the inequality of the first code snippet.
Thus , for any constant C, C*f  is a solution of the functional equation.
Note that f(x) being strictly positive, 1/y > 0 and the functional equation is always defined.

Im new to Maple. My instructor asked us to use it, but I can't find a student free version, please help.

Consider the following simple example. It works fine and we get a plot with two blue points and two red points when we run it inside Maple. However, when we right click on it and choose export as `.eps` file, the result is a plot with four black points!

List := [[[0, 0], 1], [[1, 2], 0], [[2, 3], 0], [[3, 1], 1]]:
plots[pointplot]([seq(List[i][1], i = 1 .. nops(List))], color = [seq(`if`(List[j][2] = 1, red, blue), j = 1 .. nops(List))], symbolsize = 12, symbol = solidcircle, labels = [typeset(t), typeset(x[t])]);

Of course one solution is to make a seperate pointplot for each color and then use `plots[display]`. But what if there is a situation with more number of colors or a gradient of colors which you can't know how many colors will be in the end?

Is there any specific reason behind becoming black when I export the output of this plot? I wonder why it is displayed properly inside Maple, but not in the eps output.

Why this fails in solve in Maple 2020.2?

restart;

A:=-ln(u)/2 + ln(3*u - 2)/6;
B:=_C1 + ln(x);
sol := solve(A-B= 0,u) assuming real

No error if I try the above code in Maple 2019.2.

Also, the error goes away if I replace assuming real  with assuming x::real

restart;

A:=-ln(u)/2 + ln(3*u - 2)/6;
B:=_C1 + ln(x);
sol := solve(A-B= 0,u) assuming x::real

Is this a bug in solve?

Maple 2020.2 on windows 10.

 

I have this procedure to perform a Boole-Mobius Transform. I took me quite a while to figure out. Whereas it works, I wonder how it should be done efficiently? The document is also attached which shows the steps I went through to derive the procedure. I can't get the document to display.

BooleMobiusTransform := proc(V) 
local n, im, istep, jm, h, istart, i, j, k; n := ilog2(numelems(V)); im := 2^n/2; istep := im; jm := 1; h := 2^n; 
for k to n do
 istart := 1; 
for j to jm do 
for i from istart to im - 1 + istart do 
V(istep + i) := (V[istep + i] + V[i]) mod 2;
 end do;
 istart := istart + h; 
end do;
 im := 1/2*im; istep := 1/2*istep; jm := 2*jm; h := 1/2*h; 
end do; 
return V; 
end proc

Boole-Mobius_Transform.mw

Why this error shows up when adding assuming?

restart;
expr:= ln(c^2*y/sqrt(c^2)+sqrt(c^2*y^2+1));
simplify(expr,size=true,evaluate_known_functions=false);
simplify(expr,size=true,evaluate_known_functions=false) assuming real;  #error

 

Is this to be expected?

Maple 2020.2

I got the plot of an ellipsis and a hyperbola using the following code:

plot([sqrt((1^2 - 0.5)*(1 - x^2/(2^2 - 0.5))), -sqrt((1^2 - 0.5)*(1 - x^2/(2^2 - 0.5))), sqrt((1^2 - 2.5)*(1 - x^2/(2^2 - 2.5))), -sqrt((1^2 - 2.5)*(1 - x^2/(2^2 - 2.5)))], x = -2 .. 2, scaling = constrained, color = [blue, blue, red, red])

How can I get the two vectors n1,n2 as shown in the following picture (the intersection point of the curves defines the beginning of the vectors)

 

DEAR SIR,

 

GOOD EVENING.

 

HOW TO FIND THE AREA BETWEEN THE CURVES  USING MAPLE? 

I was trying to use the idea explained in this post (), using `densityplot` to create a barplot. But there are several difficultes specially using new Maple that has problem with exporting plots in pdf format the same as displayed inside Maple.

The example code:

zmin := 0;
zmax := 1;
verthuebar := plots:-densityplot(z, dummy = 0 .. 1, z = zmin .. zmax, grid = [2, 10], style = patchnogrid, size = [90, 260], colorscheme = [ColorTools[Color]([0, 0, 1]), ColorTools[Color]([1, 0, 0])], style = surface, axes = frame, labels = [``, ``], axis[1] = [tickmarks = []], axis[2] = [tickmarks = [aList[1] = "0   ", 0.5 = typeset(alpha*` `), 1 = "1    "]]);

Problems:

1- When I export the bar-plot as `.eps`, it shows white lines as a grid, while I don't want it and it is not the same way it is displayed at Maple! 

test-1.pdf

I tried adding `gridlines=false` and other similar things, but had no effect. I changed `10` to `3` in `grid = [2, 10]`, but it increases the distance of 0 and 1 from the borderies and therefore wrong numbers will be read from the color bar. Exporting the picture as `.pdf` doesn't have that gridlines problem, but destroys the proportions of the image, so I want to stick on the `.eps` one, but without those white lines.

2- How can I have 0 and 1 exactly on the start and end of the color bar and with no distance from the edges? I can use `view=[0..1,0..1]` at the end of the above code, but depending on the number in the `grid=[2,n]` that I choose, the colors may not start and end exactly at the specified colors.

I think Maple's simplify could need much more improvement. 

Here is another example, which I can't get Maple to simplify to zero for positive x, when it is clearly zero there

restart;
ode:=x = (diff(y(x),x)^2+1)^(1/2)*diff(y(x),x);
mysol:=y(x)=_C1+int(  sqrt(-2+2*sqrt(4*a^2+1))/2,a=0..x);
check:=odetest(mysol,ode);

The above is zero for x>0

But I tried every assumption or option on it, and it will not give zero.

simplify(check) assuming x>0;
simplify(check,symbolic);
simplify(check,symbolic,sqrt) assuming x>0;
simplify(check,sqrt) assuming x>0;
simplify(check,radical) assuming x>0;
simplify(check,power) assuming x>0;
etc...

Here it is in Mathematica

ClearAll[x];
check = x - (Sqrt[2 + 2 Sqrt[4 x^2 + 1]]) (Sqrt[-2 + 2 Sqrt[4 x^2 + 1]])/4;
Simplify[check, Assumptions -> x > 0]

Why Maple can't simplify this to zero?  Is there some other specific trick one must use each time?

Maple 2020.2 on windows 10

 

hi. i write this code with "for" loop. but i dont want to show comma sign in my print. how can i remove it

for example

thanks in advance

code

restart;
for i to 2 do
    for j to 2 do S[i, j] := 2*mu*varepsilon[i, j] - add((2*mu)/3*varepsilon[r, r]*delta[i, j], r = 1 .. 3); print("S"[i, j] = S[i, j]); end do;
end do;
 

HI everyone I have this excel spreedsheet ValeursB.xlsx and I know how to import Data in Maple. But What i don t know is how to tell to maple to use this data, to be able to make differents plots like you can see in the picture, i have shared. Your helps is very welcome.

The interval [0,T] is divided into n subintervals [i*h, (i + 1)*h], i = 0,1,2, . . . ,n -1, of equal lengths h where h=T/n.

The first (n + 1) hat functions   is defined as follows:

 

Question:

How to find g_ij ( the value of the following integral)

=

where 

i = 0,1,2, . . . ,n -1,

alpha>0,

0<=t<h.

 

In fact, 

by using the Maple, I want to check whether it is equal to the following expression or not:

There is the following differential equation:

 

where l(t)=2+t,  g=10 and the goal is to find φ(t). I wrote the following code:

M := diff(phi(t), t);

M1 := diff(M, t);
g := 10;
M2 := diff(l(t), t);
ode := M1 + 2*M2*M/l(t) + g*sin(phi(t))/l(t) = 0;
ics := phi(0) = 1, D(phi)(0) = 1;
l := t -> 2 + t;
ode;
dsovle([ode, ics]);
 

But I don't get any result. How can I solve this differential equation?

First 325 326 327 328 329 330 331 Last Page 327 of 2097