PatrickT

Dr. Patrick T

2103 Reputation

18 Badges

15 years, 88 days

MaplePrimes Activity


These are replies submitted by PatrickT

I guess you mean to select a constant such that the two lines make contact, in that case all you have to do is solve the system, i.e. constant:=  1/(1000)^(3/8); so adapting Markiyan's piecewise definition of f:

f := piecewise(`and`(x >= 0, x <= 10^3), 1/(1000)^(3/8), `and`(x > 10^3, x <= 10^8), 1/x^(3/8), undefined);

(check that this looks right) 

as for combining, why don't you provide an example: usually you can do that with plots:-display(p1,p2) where p1 and p2 are previously defined plots.

I guess you mean to select a constant such that the two lines make contact, in that case all you have to do is solve the system, i.e. constant:=  1/(1000)^(3/8); so adapting Markiyan's piecewise definition of f:

f := piecewise(`and`(x >= 0, x <= 10^3), 1/(1000)^(3/8), `and`(x > 10^3, x <= 10^8), 1/x^(3/8), undefined);

(check that this looks right) 

as for combining, why don't you provide an example: usually you can do that with plots:-display(p1,p2) where p1 and p2 are previously defined plots.

your worksheet is a little muddled -- the package declarations should come at the top.

Here is how mapleprimes users usually like to get code (minimal effort -- no need to download a worksheet, you can just copy-paste):

restart;
with(VectorCalculus);
with(LinearAlgebra);
yg := Determinant(subs(c = (1+s)/(1-s), q = 2*k^2*s/(1-s)+k*(1+9*s)/(2*(1-s))+k^2+2*k, a = k, b = k+1/2, g = 1/2, d = 2*k+3, s = 1/2, k = -1+I*sqrt((1/4)*x-1), t = 1/2, sqrt(x-4) = k, Wronskian([(1-t)^(I*sqrt((1/4)*x-1))*HeunG(c, q, a, b, g, d, t), (1-t)^(I*sqrt((1/4)*x-1))*exp(-I*ln(2)*sqrt(x-4))*HeunG(1-c, -q+a*b, a, b, d, g, 1-t)], t)));
deltag := argument(yg);
plot(evalf(deltag), k = -35 .. 35);
diffdeltag := Im(diff(ln(yg), k));
plot(diffdeltag, k = -25 .. 25);
int(diffdeltag*ln(k^2+4), k = 0 .. infinity);
int(((deltag+(1/2)*Pi)*2)*k/(k^2+4), k = 0 .. infinity);

What version of Maple/OS are you using? I let it run for a few minutes but quickly stopped it, how long does it take to run on your machine?

Markiyan,

I couldn't get your second plot with the code you provided: tested on Maple 15(Windows7,32bits)+16(Windows7,64bits):

a:= diff(argument(HeunG(3, -9/2+(3/4*I)*k-(3/4)*k^2, -1+(1/2*I)*k, -1/2+(1/2*I)*k, 1/2, 1+I*k, 1/2))-ln(2)*k,k);
//3 3 \ / 9 3 3 2 1
||- I - - k| D[2](HeunG)|3, - - + - I k - - k , -1 + - I k,
\\4 2 / \ 2 4 4 2

1 1 1 1\ 1 /
- - + - I k, -, 1 + I k, -| + - I D[3](HeunG)|3,
2 2 2 2/ 2 \

9 3 3 2 1 1 1 1 1\ 1
- - + - I k - - k , -1 + - I k, - - + - I k, -, 1 + I k, -| + - I
2 4 4 2 2 2 2 2/ 2

/ 9 3 3 2 1 1 1 1
D[4](HeunG)|3, - - + - I k - - k , -1 + - I k, - - + - I k, -,
\ 2 4 4 2 2 2 2

1\ / 9 3 3 2 1
1 + I k, -| + I D[6](HeunG)|3, - - + - I k - - k , -1 + - I k,
2/ \ 2 4 4 2

1 1 1 1\\ /
- - + - I k, -, 1 + I k, -|| |
2 2 2 2// \
// / 9 3 3 2 1 1 1 1
- (I) |HeunG|3, - - + - I k - - k , -1 + - I k, - - + - I k, -,
\ \ 2 4 4 2 2 2 2

1\\ / / / 9 3 3 2
1 + I k, -|| + |I abs|1, HeunG|3, - - + - I k - - k ,
2// \ \ \ 2 4 4

1 1 1 1 1\\\//| /
-1 + - I k, - - + - I k, -, 1 + I k, -||| ||HeunG|3,
2 2 2 2 2/// \| \

9 3 3 2 1 1 1 1 1\|\\
- - + - I k - - k , -1 + - I k, - - + - I k, -, 1 + I k, -||||
2 4 4 2 2 2 2 2/|//

- ln(2)


plot(k->evalf(a),-10..10);

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

Markiyan,

I couldn't get your second plot with the code you provided: tested on Maple 15(Windows7,32bits)+16(Windows7,64bits):

a:= diff(argument(HeunG(3, -9/2+(3/4*I)*k-(3/4)*k^2, -1+(1/2*I)*k, -1/2+(1/2*I)*k, 1/2, 1+I*k, 1/2))-ln(2)*k,k);
//3 3 \ / 9 3 3 2 1
||- I - - k| D[2](HeunG)|3, - - + - I k - - k , -1 + - I k,
\\4 2 / \ 2 4 4 2

1 1 1 1\ 1 /
- - + - I k, -, 1 + I k, -| + - I D[3](HeunG)|3,
2 2 2 2/ 2 \

9 3 3 2 1 1 1 1 1\ 1
- - + - I k - - k , -1 + - I k, - - + - I k, -, 1 + I k, -| + - I
2 4 4 2 2 2 2 2/ 2

/ 9 3 3 2 1 1 1 1
D[4](HeunG)|3, - - + - I k - - k , -1 + - I k, - - + - I k, -,
\ 2 4 4 2 2 2 2

1\ / 9 3 3 2 1
1 + I k, -| + I D[6](HeunG)|3, - - + - I k - - k , -1 + - I k,
2/ \ 2 4 4 2

1 1 1 1\\ /
- - + - I k, -, 1 + I k, -|| |
2 2 2 2// \
// / 9 3 3 2 1 1 1 1
- (I) |HeunG|3, - - + - I k - - k , -1 + - I k, - - + - I k, -,
\ \ 2 4 4 2 2 2 2

1\\ / / / 9 3 3 2
1 + I k, -|| + |I abs|1, HeunG|3, - - + - I k - - k ,
2// \ \ \ 2 4 4

1 1 1 1 1\\\//| /
-1 + - I k, - - + - I k, -, 1 + I k, -||| ||HeunG|3,
2 2 2 2 2/// \| \

9 3 3 2 1 1 1 1 1\|\\
- - + - I k - - k , -1 + - I k, - - + - I k, -, 1 + I k, -||||
2 4 4 2 2 2 2 2/|//

- ln(2)


plot(k->evalf(a),-10..10);

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct

I have been using pdflite for the last few months and like it a lot: freeware, can handle pdf, djvu, cbz, cbr, etc. it adds a pdf printer that you can use to print your Maple documents/worksheet to pdf; also when you compile with LaTeX, the text updates itself while keeping the document opened -- you don't need to close and re-open as you would typically need to do with other pdf viewers.

But if you just want to save parameters, you probably don't want pdf, exporting to a Matrix or a List as simple text file or in Matlab or other output is very useful. see help exportMatrix, as one of many ways.

I have been using pdflite for the last few months and like it a lot: freeware, can handle pdf, djvu, cbz, cbr, etc. it adds a pdf printer that you can use to print your Maple documents/worksheet to pdf; also when you compile with LaTeX, the text updates itself while keeping the document opened -- you don't need to close and re-open as you would typically need to do with other pdf viewers.

But if you just want to save parameters, you probably don't want pdf, exporting to a Matrix or a List as simple text file or in Matlab or other output is very useful. see help exportMatrix, as one of many ways.

dunnee worry about Markiyan's off-the-cuff remarks, it takes rather a lot more than that to make him laugh.

Added: when you're back at uni, DO post a short working example or copy-paste the relevant code from restart; to the end: the best is to copy-paste in plain text format the maple 1D input (you can omit output if it's long, since we can rerun the code on our machines, although occasionally there are differences in Maple versions, so it's also useful to have info about OS/Maple Version).

 

 

dunnee worry about Markiyan's off-the-cuff remarks, it takes rather a lot more than that to make him laugh.

Added: when you're back at uni, DO post a short working example or copy-paste the relevant code from restart; to the end: the best is to copy-paste in plain text format the maple 1D input (you can omit output if it's long, since we can rerun the code on our machines, although occasionally there are differences in Maple versions, so it's also useful to have info about OS/Maple Version).

 

 

 @Alejandro Jakubi 

Thank you Alejandro, this is a very clear explanation. And you're right, it's that power constructor again. Using what I learned from a previous exchange on mapleprimes, then, one way (rather complicated!) would be:

restart;
Surdify := proc(f)
subsindets(eval(f),`^`,convert,surd);
end proc :
f := A^2-2*sqrt(A^2+1)+1;
Surdify(algsubs(A^2+1 = M^2, f)) assuming M > 0;
  M^2-2*M

 but that, as you note, doesn't work if the assumption is instead: A>0

Reference
http://www.mapleprimes.com/questions/141201-Maximize-Expression-With-RootOf-And-Parameters

 @Alejandro Jakubi 

Thank you Alejandro, this is a very clear explanation. And you're right, it's that power constructor again. Using what I learned from a previous exchange on mapleprimes, then, one way (rather complicated!) would be:

restart;
Surdify := proc(f)
subsindets(eval(f),`^`,convert,surd);
end proc :
f := A^2-2*sqrt(A^2+1)+1;
Surdify(algsubs(A^2+1 = M^2, f)) assuming M > 0;
  M^2-2*M

 but that, as you note, doesn't work if the assumption is instead: A>0

Reference
http://www.mapleprimes.com/questions/141201-Maximize-Expression-With-RootOf-And-Parameters

 

EDIT:

There are 2 distinct steps here: 1) substitution to get expressions in M instead of in A, 2) simplification of the square-root of the square of M. The first one is handled by algsubs (not by subs) as suggested by Carl. The second one is handled by invoking a simplification under the assumption that M>0.

The 2 steps:

f := A^2-2*sqrt(A^2+1)+1;
f2 := algsubs(A^2+1 = M^2, f);
f3 := simplify(f2) assuming M>0;

However, I would have expected to be able to do these two steps in one go, as in:

f4 := algsubs(A^2+1 = M^2, f) assuming M > 0;
 f4 := M^2-2*sqrt(M^2) 

but the simplification did not take place.

 

 

Likewise, Markiyan's suggestion, which looks similar, did not work:

f2 := `assuming`([algsubs(A^2+1 = M^2, f)], [M > 0]); 

 f4 := M^2-2*sqrt(M^2)

Even more surprising, this one doesn't work either:

 

 assume(M>0):
f := A^2-2*sqrt(A^2+1)+1;
f2 := algsubs(A^2+1 = M^2, f);

 f2 := M^2-2*sqrt(M^2) 

 

I'm on Maple 15.

 

EDIT:

There are 2 distinct steps here: 1) substitution to get expressions in M instead of in A, 2) simplification of the square-root of the square of M. The first one is handled by algsubs (not by subs) as suggested by Carl. The second one is handled by invoking a simplification under the assumption that M>0.

The 2 steps:

f := A^2-2*sqrt(A^2+1)+1;
f2 := algsubs(A^2+1 = M^2, f);
f3 := simplify(f2) assuming M>0;

However, I would have expected to be able to do these two steps in one go, as in:

f4 := algsubs(A^2+1 = M^2, f) assuming M > 0;
 f4 := M^2-2*sqrt(M^2) 

but the simplification did not take place.

 

 

Likewise, Markiyan's suggestion, which looks similar, did not work:

f2 := `assuming`([algsubs(A^2+1 = M^2, f)], [M > 0]); 

 f4 := M^2-2*sqrt(M^2)

Even more surprising, this one doesn't work either:

 

 assume(M>0):
f := A^2-2*sqrt(A^2+1)+1;
f2 := algsubs(A^2+1 = M^2, f);

 f2 := M^2-2*sqrt(M^2) 

 

I'm on Maple 15.

3 4 5 6 7 8 9 Last Page 5 of 93