MaplePrimes Questions

I was playing with plots:-fieldplot in Maple 2019 and found that sometime the grid option gives a strange result.  The code I used was

with(plots):
fieldplot([-x/(x^2+y^2)^1.5,-y/(x^2+y^2)^1.5],x=-1..1,y=-1..1);
fieldplot([-x/(x^2+y^2)^1.5,-y/(x^2+y^2)^1.5],x=-1..1,y=-1..1,grid=[8,8]);
fieldplot([-x/(x^2+y^2)^1.5,-y/(x^2+y^2)^1.5],x=-1..1,y=-1..1,grid=[7,7]);

The first two plots come out as expected.  The third plot has (0,0) in the grid, a point where the vector field does not exist.  Rather than giving an error or ignoring the point, Maple 2019 (and 2018) plots a single arrow through the origin. The file with plots is below.  I hope that this can be changed to give a different output.

 


 

with(plots):
fieldplot([-x/(x^2+y^2)^1.5,-y/(x^2+y^2)^1.5],x=-1..1,y=-1..1);
fieldplot([-x/(x^2+y^2)^1.5,-y/(x^2+y^2)^1.5],x=-1..1,y=-1..1,grid=[8,8]);
fieldplot([-x/(x^2+y^2)^1.5,-y/(x^2+y^2)^1.5],x=-1..1,y=-1..1,grid=[7,7]);

 

 

 

 


 

Download fieldplots_1.mw

I am trying to use the StringTools package to extract the URLs from the html file exported from Microsoft Edge when i wish to transfer these to another browser, in a text file without all of the nonsense I havent learnt yet.

I just want to trim the file name to set up a Boolean function to check it's update for the day and the output went crazy and decided to spoil my day again

 


 

``

restart

with(StringTools);

[Anagrams, AndMap, ApproximateSearch, ApproximateSearchAll, ArithmeticMean, Border, BorderArray, BorderLength, CamelCase, Capitalize, CaseJoin, CaseSplit, Center, Centre, Char, CharacterFrequencies, CharacterMap, Chomp, Chop, CommonPrefix, CommonSuffix, Compare, CompareCI, Compress, CountCharacterOccurrences, Decode, Delete, DeleteSpace, DifferencePositions, Drop, EditDistance, Encode, Entropy, Escape, Exchange, ExpandCharacterClass, ExpandTabs, Explode, Fence, Fibonacci, Fill, FirstFromLeft, FirstFromRight, FormatMessage, FormatTime, FromByteArray, Generate, GenerateIdentifier, Group, HammingDistance, HammingSearch, HammingSearchAll, Has, HasASCII, HasAlpha, HasAlphaNumeric, HasBinaryDigit, HasControlCharacter, HasDigit, HasGraphic, HasHexDigit, HasIdentifier, HasIdentifier1, HasLower, HasOctalDigit, HasPrintable, HasPunctuation, HasSpace, HasUpper, HasVowel, Hash, Implode, Indent, IndexOfCoincidence, Insert, Iota, IsASCII, IsAlpha, IsAlphaNumeric, IsAnagram, IsBalanced, IsBinaryDigit, IsConjugate, IsControlCharacter, IsDerangement, IsDigit, IsEodermdrome, IsGraphic, IsHexDigit, IsIdentifier, IsIdentifier1, IsLower, IsMonotonic, IsOctalDigit, IsPalindrome, IsPeriod, IsPermutation, IsPrefix, IsPrimitive, IsPrintable, IsPunctuation, IsSorted, IsSpace, IsSubSequence, IsSuffix, IsUpper, IsVowel, Join, Kasiski, LeftFold, LeftRecursivePathOrder, Length, LengthSplit, Levenshtein, LexOrder, LongestCommonSubSequence, LongestCommonSubString, LowerCase, LyndonFactors, Map, MatchFence, MaxChar, MaximalPalindromicSubstring, Metaphone, MinChar, MinimumConjugate, MonotonicFactors, NGrams, NthWord, OrMap, Ord, OtherCase, Overlap, PadLeft, PadRight, ParseTime, PatternCanonicalForm, PatternDictionary, PatternEquivalent, Period, Permute, PrefixDistance, PrimitiveRoot, Random, Randomize, Readability, RegMatch, RegSplit, RegSub, RegSubs, Remove, Repeat, Repeats, RevLexOrder, Reverse, RightFold, RightRecursivePathOrder, Rotate, Search, SearchAll, Select, SelectRemove, Sentences, Shift, ShortLexOrder, ShortRevLexOrder, SimilarityCoefficient, Snarf, Sort, SortPermutation, Soundex, Split, Squeeze, Stem, StringBuffer, StringSplit, SubString, Substitute, SubstituteAll, SuffixDistance, Support, SyllableLength, Tabulate, Take, ThueMorse, ToByteArray, Trim, TrimLeft, TrimRight, Uncompress, Unique, UpperCase, Visible, WildcardMatch, WordContaining, WordCount, WordEnd, WordStart, Words, WrapText]

(1)

currentdir("G:\\Computer Science\\EDGE\\fav_exports"):

if is(currentdir() = "G:\\Computer Science\\EDGE\\fav_exports") = true then "Edge favorites usb import html directory is the current file path" end if;

"Edge favorites usb import html directory is the current file path"

(2)

Filename0 := ListDirectory(currentdir())[]

"Microsoft_Edge_‎08_‎29_‎2019.html"

(3)

StringTools['Reverse']("Microsoft_Edge_‎08_‎29_‎2019.html")

"lmth.9102���_92���_80���_egdE_tfosorciM"

(4)

Delete(Delete(Filename0, 1 .. 15), nops(Delete(Filename0, 1 .. 14))-4 .. nops(Delete(Filename0, 1 .. 14)))

Error, (in StringTools:-Delete) invalid range

 

dt := ParseTime("%Y-%m-%d", "2002-11-05")

dt:-year, dt:-month, dt:-monthDay

2002, 11, 5

(5)

``

``


 

Download microsoft_edge_fav_import_fail.mw
 

Edit: I have gotten closer with the following:

 


 

``

restart

with(StringTools);

[Anagrams, AndMap, ApproximateSearch, ApproximateSearchAll, ArithmeticMean, Border, BorderArray, BorderLength, CamelCase, Capitalize, CaseJoin, CaseSplit, Center, Centre, Char, CharacterFrequencies, CharacterMap, Chomp, Chop, CommonPrefix, CommonSuffix, Compare, CompareCI, Compress, CountCharacterOccurrences, Decode, Delete, DeleteSpace, DifferencePositions, Drop, EditDistance, Encode, Entropy, Escape, Exchange, ExpandCharacterClass, ExpandTabs, Explode, Fence, Fibonacci, Fill, FirstFromLeft, FirstFromRight, FormatMessage, FormatTime, FromByteArray, Generate, GenerateIdentifier, Group, HammingDistance, HammingSearch, HammingSearchAll, Has, HasASCII, HasAlpha, HasAlphaNumeric, HasBinaryDigit, HasControlCharacter, HasDigit, HasGraphic, HasHexDigit, HasIdentifier, HasIdentifier1, HasLower, HasOctalDigit, HasPrintable, HasPunctuation, HasSpace, HasUpper, HasVowel, Hash, Implode, Indent, IndexOfCoincidence, Insert, Iota, IsASCII, IsAlpha, IsAlphaNumeric, IsAnagram, IsBalanced, IsBinaryDigit, IsConjugate, IsControlCharacter, IsDerangement, IsDigit, IsEodermdrome, IsGraphic, IsHexDigit, IsIdentifier, IsIdentifier1, IsLower, IsMonotonic, IsOctalDigit, IsPalindrome, IsPeriod, IsPermutation, IsPrefix, IsPrimitive, IsPrintable, IsPunctuation, IsSorted, IsSpace, IsSubSequence, IsSuffix, IsUpper, IsVowel, Join, Kasiski, LeftFold, LeftRecursivePathOrder, Length, LengthSplit, Levenshtein, LexOrder, LongestCommonSubSequence, LongestCommonSubString, LowerCase, LyndonFactors, Map, MatchFence, MaxChar, MaximalPalindromicSubstring, Metaphone, MinChar, MinimumConjugate, MonotonicFactors, NGrams, NthWord, OrMap, Ord, OtherCase, Overlap, PadLeft, PadRight, ParseTime, PatternCanonicalForm, PatternDictionary, PatternEquivalent, Period, Permute, PrefixDistance, PrimitiveRoot, Random, Randomize, Readability, RegMatch, RegSplit, RegSub, RegSubs, Remove, Repeat, Repeats, RevLexOrder, Reverse, RightFold, RightRecursivePathOrder, Rotate, Search, SearchAll, Select, SelectRemove, Sentences, Shift, ShortLexOrder, ShortRevLexOrder, SimilarityCoefficient, Snarf, Sort, SortPermutation, Soundex, Split, Squeeze, Stem, StringBuffer, StringSplit, SubString, Substitute, SubstituteAll, SuffixDistance, Support, SyllableLength, Tabulate, Take, ThueMorse, ToByteArray, Trim, TrimLeft, TrimRight, Uncompress, Unique, UpperCase, Visible, WildcardMatch, WordContaining, WordCount, WordEnd, WordStart, Words, WrapText]

(1)

currentdir("G:\\Computer Science\\EDGE\\fav_exports"):

if is(currentdir() = "G:\\Computer Science\\EDGE\\fav_exports") = true then "Edge favorites usb import html directory is the current file path" end if;

"Edge favorites usb import html directory is the current file path"

(2)

Filename0 := ListDirectory(currentdir())[]

"Microsoft_Edge_‎08_‎29_‎2019.html"

(3)

StringTools['Reverse']("Microsoft_Edge_‎08_‎29_‎2019.html")

"lmth.9102���_92���_80���_egdE_tfosorciM"

(4)

Filename1 := StringTools:-Delete(Filename0, 1 .. nops(StringTools:-Explode(Filename0))-15)

"29_‎2019.html"

(5)

StringTools:-Delete(Filename1, nops(StringTools:-Explode(Filename1))-4 .. nops(StringTools:-Explode(Filename1)))

"29_‎2019"

(6)

StringTools:-Delete(StringTools:-Delete(Filename0, 1 .. nops(Filename0)), nops(StringTools:-Delete(Filename0, 1 .. nops(Filename0)))-4 .. nops(StringTools:-Delete(Filename0, 1 .. 10)))

Error, (in StringTools:-Delete) invalid range

 

dt := ParseTime("%Y-%m-%d", "2002-11-05")

dt:-year, dt:-month, dt:-monthDay

2002, 11, 5

(7)

``

``


 

Download microsoft_edge_fav_import_fail2.mw

 

Hi,

In statistics a  "degree of freedom" is a strictly positive integer.

The three distributions ChiSquare, StudentT and FRatio from package Statistics have degrees of freedom as parameters. Nevertheless they accept any strictly positive real values for them.
(one can verify that their "Conditions" attribute is of the form [0 < n] instead of [n::posint]).

I think this ought to be corrected in future versions
 

A=B  but not able to simplify arctanh(A)-arctanh(B)  to be zero.  Why? Is there a workaround? Using Maple 2019.1

restart;

A:=((y*sqrt(3) + 3)*sqrt(3))/(6*sqrt(y^2 + 1));
B:=(y + sqrt(3))/(2*sqrt(y^2 + 1));
simplify(A-B)

(1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2)

(1/2)*(y+3^(1/2))/(y^2+1)^(1/2)

0

simplify(arctanh(A)-arctanh(B))

arctanh((1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2))-arctanh((1/2)*(y+3^(1/2))/(y^2+1)^(1/2))

simplify(arctanh(A)-arctanh(B),trig)

arctanh((1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2))-arctanh((1/2)*(y+3^(1/2))/(y^2+1)^(1/2))

simplify(arctanh(A)-arctanh(B)) assuming positive

arctanh((1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2))-arctanh((1/2)*(y+3^(1/2))/(y^2+1)^(1/2))

simplify(arctanh(A)-arctanh(B),trig) assuming positive

arctanh((1/6)*(y*3^(1/2)+3)*3^(1/2)/(y^2+1)^(1/2))-arctanh((1/2)*(y+3^(1/2))/(y^2+1)^(1/2))

plot(arctanh(A),y=-Pi..Pi)

plot(arctanh(B),y=-Pi..Pi)

 

 

Download will_not_simplify.mw

Compare to Mathematica:

Dear Users!
Hope you all are fine with everything. How we can identify the same equations from a number of equations using maple command, like
Eq1:=5.09295817894067*`&tau;u`[1, 1]-30.5577490736439*`&tau;u`[2, 1]+178.253536262923*`&tau;u`[3, 1]-30.5577490736439*`&tau;u`[1, 2]+183.346494441862*`&tau;u`[2, 2]-1069.52121757753*`&tau;u`[3, 2]+178.253536262923*`&tau;u`[1, 3]-1069.52121757753*`&tau;u`[2, 3]+6238.87376920228*`&tau;u`[3, 3];
Eq2:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]-30.5577490736439*`&tau;u`[1, 2]-61.1154981472883*`&tau;u`[2, 2]-91.6732472209439*`&tau;u`[3, 2]+178.253536262923*`&tau;u`[1, 3]+356.507072525849*`&tau;u`[2, 3]+534.760608788841*`&tau;u`[3, 3]-3/7;
Eq3:=5.09295817894067*`&tau;u`[1, 1]-30.5577490736439*`&tau;u`[2, 1]+178.253536262923*`&tau;u`[3, 1]+10.1859163578814*`&tau;u`[1, 2]-61.1154981472883*`&tau;u`[2, 2]+356.507072525849*`&tau;u`[3, 2]+15.2788745368241*`&tau;u`[1, 3]-91.6732472209439*`&tau;u`[2, 3]+534.760608788841*`&tau;u`[3, 3]-9/7;
Eq4:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]+10.1859163578814*`&tau;u`[1, 2]+20.3718327157631*`&tau;u`[2, 2]+30.5577490736484*`&tau;u`[3, 2]+15.2788745368241*`&tau;u`[1, 3]+30.5577490736484*`&tau;u`[2, 3]+45.8366236104784*`&tau;u`[3, 3]-12/7;
Eq5:=5.09295817894067*`&tau;u`[1, 1]-30.5577490736439*`&tau;u`[2, 1]+178.253536262923*`&tau;u`[3, 1]+50.9295817894067*`&tau;u`[1, 2]-305.577490736439*`&tau;u`[2, 2]+1782.53536262923*`&tau;u`[3, 2]+504.202859715131*`&tau;u`[1, 3]-3025.21715829077*`&tau;u`[2, 3]+17647.1000900295*`&tau;u`[3, 3]-18/7;
Eq6:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]+50.9295817894067*`&tau;u`[1, 2]+101.859163578814*`&tau;u`[2, 2]+152.788745368241*`&tau;u`[3, 2]+504.202859715131*`&tau;u`[1, 3]+1008.40571943027*`&tau;u`[2, 3]+1512.60857914560*`&tau;u`[3, 3]-3;
Eq7:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]-30.5577490736439*`&tau;u`[1, 2]-61.1154981472883*`&tau;u`[2, 2]-91.6732472209439*`&tau;u`[3, 2]+178.253536262923*`&tau;u`[1, 3]+356.507072525849*`&tau;u`[2, 3]+534.760608788841*`&tau;u`[3, 3]-3/7;
Eq8:=5.09295817894067*`&tau;u`[1, 1]+10.1859163578814*`&tau;u`[2, 1]+15.2788745368241*`&tau;u`[3, 1]+10.1859163578814*`&tau;u`[1, 2]+20.3718327157631*`&tau;u`[2, 2]+30.5577490736484*`&tau;u`[3, 2]+15.2788745368241*`&tau;u`[1, 3]+30.5577490736484*`&tau;u`[2, 3]+45.8366236104784*`&tau;u`[3, 3]-12/7;
Eq9:=41.7622570673196*`&tau;u`[3, 1]+41.7622570673196*`&tau;u`[1, 3]+15.2788745368220*`&tau;u`[1, 1]+83.5245141346398*`&tau;u`[2, 3]+30.5577490736443*`&tau;u`[2, 1]+113.063671572516*`&tau;u`[3, 3]+83.5245141346398*`&tau;u`[3, 2]+30.5577490736443*`&tau;u`[1, 2]+61.1154981472892*`&tau;u`[2, 2];
In above equations Eq2 and Eq7; Eq4 and Eq8 are same. If I have set of 100 equation how I can identify similar equations?
@acer @Kitonum @Preben Alsholm

The uploaded worksheet describes a mechanics scenario which I would like to animate.

While I understand the expression for the kinetic energy of the torus, the term containing cos(theta) within the expression for the KE of the pearl baffles me.

From which physics aspect of the scenario does this term derive?

Pearl_in_torus.mw

Hi, 

While trying to convert into integers a sample S drawn from a binomial distribution,  I've observed that  round~(S) didn't do the job while map(round, S) did it.

First question: why the first syntax and the second one are not equivalent on this case?

I investigated a little bit further by applying round~ on a row vector T of Hfloats (thus T and S are "identical")

Second question: While  round~(S) doesn't work but round~(T) does?


 

restart

S := Statistics:-Sample(Binomial(10, 0.5), 2);
round~(S);      # Why round~(S) doesn't return integers
map(round, S);  # but map(round, S) does?

lprint(S)

S := Vector[row](2, {(1) = 6.0, (2) = 7.0}, datatype = float[8])

 

Vector[row]([6., 7.])

 

Vector[row]([6, 7])

 

Vector[row](2, {1 = HFloat(6.), 2 = HFloat(7.)}, datatype = float[8], storage = rectangular, order = Fortran_order, shape = [])

 

# Evaluation of round~(T) on a vector of Hfloats



T := Vector[row](2, [HFloat(6.), HFloat(3.)]);
lprint(S);
round~(T);   # round~(T) returns integers,
             

T := Vector[row](2, {(1) = HFloat(6.0), (2) = HFloat(3.0)})

 

Vector[row](2, {1 = HFloat(6.), 2 = HFloat(7.)}, datatype = float[8], storage = rectangular, order = Fortran_order, shape = [])

 

Vector[row]([6, 3])

(1)

 


 

Download Tilde_versus_map.mw

 

Hello, 

In this simple example in Maple 2019:

 

k[1] := 16;

solve(k[2]^2 = k[1], {k[2]}, useassumptions) assuming 0 < k;
 

The result of the solve is 

{k[2] = 4}, {k[2] = -4}

which is not what I'm expecting.

I'm expecting 

{k[2] = 4}

I'm trying to assume that both the variable named k[1] and the variable named k[2] are greater than 0 by assuming that 0 < k.
My goal is a way to make the same assumption for variables with the same base but different subscripts.
How can I do this?

Thanks in advance.


 

``

  Note: To enter units, I used the unit key (blue) in the Units palette.

  When I use the combine and simplify functions to manipulate temperature units, Maple returns a wrong answer, as we can see below;

combine(20*Unit(Unit('Celsius'))+30*Unit('K'), units)

50*Units:-Unit(K)

(1)

simplify(20*Unit(Unit('Celsius'))+30*Unit('K'))

50*Units:-Unit(K)

(2)

  The quantity 20 Celsius is not converted correctly. However, for other types of dimensions, the combine and simplify functions work correctly.

combine(10*Unit('m')+120*Unit('cm')+200*Unit('ft'), units)

(1804/25)*Units:-Unit(m)

(3)

simplify(10*Unit('m')+120*Unit('cm')+200*Unit('ft'))

(1804/25)*Units:-Unit(m)

(4)

``

Another strange thing happens with the convert function, with temperature units. When we use the same source unit, the convert function deletes the unit, leaving only the quantity.

convert(30*Unit('K'), temperature, Unit('K'))

30

(5)

 I do not understand why this occurs.

convert(10*Unit('m'), units, Unit('m'))

10*Units:-Unit(m)

(6)

I do not understand why this occurs.

 

Oliveira


 

Download Matching_units.mw

If I copy the output of a lprint command e.g.
lprint(<1,2;3,4>);

Matrix(2,2,{(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4},datatype = anything
,storage = rectangular,order = Fortran_order,shape = [])

and paste it in a new execution group, I obtain a "Line print output" instead of a Maple (1D) input,
so it cannot be executed.
(Of course, it's possible to paste in Notepad to remove the format, but it's annoying.)

This happens in Maple 2019,  Windows 64, Worksheet mode, 1D input;  but not all the time (sometimes it is as it used to be).
Do you see the same behavior?

 

Maple doesn't completely check the condition on the number of trials "n" for Binomial and NegativeBinomial distributions (package Statistics).
The attribute "Conditions" explicitely says that n must be a strictly positive integer but no strictly positive real valuereturna an error (ok, it would be stupid to set n to a non integer value !!!).

I think it is a default that ought to be corrected in future releases (this default still exists in Maple 2018)

 

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

with(Statistics):


BINOMIAL DISTRIBUTION

X := RandomVariable(Binomial(n, p)):
L := [attributes(X)][3]:
A := exports(L)

Conditions, ParentName, Parameters, CDF, CharacteristicFunction, Kurtosis, Mean, Median, Mode, MGF, ProbabilityFunction, Skewness, Support, Variance, VariationCoefficient, CDFNumeric, QuantileNumeric, RandomSample, RandomSampleSetup, RandomVariate

(2)

L:-Conditions

[0 <= p, p <= 1, n::posint]

(3)

# Maple should return an error for N is not of type posint
#
# It seems that Sample uses floor(N)

N := 10.49; type(N::posint);
P := 1/2:
X := RandomVariable(Binomial(N, P)):
Mean(X), N*P;
ProbabilityFunction(X, k);
S := Sample(X, 10^6):
Mean(S);


# A non consistent result (only non negative values of k should be accepted)

eval(ProbabilityFunction(X, k), k=evalf(Pi));

N := 10.49

 

false

 

5.245000000, 5.245000000

 

piecewise(k < 0, 0, binomial(10.49, k)*(1/2)^k*(1/2)^(10.49-k))

 

HFloat(4.998903)

 

.1096019539

(4)


NEGATIVE BINOMIAL DISTRIBUTION

X := RandomVariable(NegativeBinomial(n, p)):
L := [attributes(X)][3]:
A := exports(L):
L:-Conditions

[0 < n, 0 < p, p <= 1]

(5)

N := 10.49:
P := 1/2:
X := RandomVariable(NegativeBinomial(N, P)):

Mean(X)


 

Download BinomialLaw.mw

 

Yeah, i have tried evalf[10](sqrt(25)).
How can i get a simple number as answer? I'm loving the software but i just wished i could type in:
int(sin(x), x = 0 .. pi)
and get 2 instead of (2.739493386*10^(-116) + (2.739493386*10^(-116))*I)*pi.
Also, when i type evalf[50](pi), i wish to get all the 50 digits, but i just get \pi :/.
Please help me.

i have a matrix named S. it has two variables with the names sigma1 and tau. i do some computations with these varibels to obtain a matrix named S_NEW. when i calculate S_NEW with parameters and then i substitute parameter tau with zero i got the answer a zero Matrix. but when i put tau=0 at the initiation of my code, i got another answer. what is the problem?

the second issue is related with the name of parametes in maple. when the varible has the name sigma1 (and tau=0), the matrix S_NEW is a matrix with the only component of (1,1). when i change the parameter name to sigma the matrix S_NEW is a matrix with the only component of (3,3). where is the problem?

 

restart:with(LinearAlgebra):

tau:=0;

0

(1)

S:=Matrix(3,[[sigma1,tau,0],[tau,0,0],[0,0,0]]):B1:=Matrix(3):

A12,B12:=(Eigenvectors(S)):

V12:= Matrix(Normalize~([Column(B12,1..3)],Euclidean)):

S_NEW:=simplify(V12^+.S.V12) assuming real ;

Matrix(3, 3, {(1, 1) = sigma1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

(2)

eval(S_NEW,tau=0)

Matrix(3, 3, {(1, 1) = sigma1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

(3)

 

 

 

Download problem.mw



Hello,

I have installed the Physics Package with:

PackageTools:-Install("5137472255164416", version = 329, overwrite)

I have a question about the calculation of the Tensor determinant:

I use two ways to calculate the determinant of the same matrix:

The first with Physics package and the second with LinearAlgebra Package:

It is easy to calculate analytically the result it is : -1

But Physics Package gives : +1 and LinearAlgebra gives: -1

My question is why I found +1 with Physics Package : What I doing wrong ?.

Please find my source hereafter:

**************************************************

restart

with(Physics)

Setup(coordinates = {X = [t, x, y, z]}, dimension = 4, metric = {(1, 1) = 1, (2, 2) = -1, (3, 3) = -1, (4, 4) = -1}, signature = `+---`, mathematicalnotation = true)

Define(H[mu, nu] = Matrix(4, {(1, 1) = 1+h, (1, 2) = h, (2, 2) = -1+h, (3, 3) = -1, (4, 4) = -1}, shape = symmetric))

H[]

H[determinant]

with(LinearAlgebra)

B := Matrix(4, {(1, 1) = 1+h, (1, 2) = h, (2, 2) = -1+h, (3, 3) = -1, (4, 4) = -1}, shape = symmetric)

Determinant(B)

***************************************

Thanks for your answer,

Sincerely yours

Xavier

 

This for me seems strange. A first oder ODE of degree one of form   A+B*y'=0. Asking Maple for its classification, it gives exact AND rational.  After rewriting it in the form y'=f(x,y) , now Maple says it is rational only. It no longer recognize it as exact.

How could this be possible? It is the same ODE, just rewrittng differently.  Maple 2019.1 on windows.

restart;

Typesetting:-Settings(typesetprime=true):

ode:=2*x/y(x)-y(x)/(x^2+y(x)^2)+(-x^2/y(x)^2+x/(x^2+y(x)^2))*diff(y(x),x) = 0;
DEtools:-odeadvisor(ode);

2*x/y(x)-y(x)/(x^2+y(x)^2)+(-x^2/y(x)^2+x/(x^2+y(x)^2))*(diff(y(x), x)) = 0

[_exact, _rational]

dsolve(ode)

y(x) = x/tan(RootOf(-_Z+x*tan(_Z)+_C1))

new_ode:=convert(ode,D); #so I can solve for y'
RHS:=solve(new_ode,D(y)(x));

2*x/y(x)-y(x)/(x^2+y(x)^2)+(-x^2/y(x)^2+x/(x^2+y(x)^2))*(D(y))(x) = 0

(2*x^3+2*x*y(x)^2-y(x)^2)*y(x)/(x*(x^3+x*y(x)^2-y(x)^2))

new_ode:=diff(y(x),x)=RHS;
DEtools:-odeadvisor(new_ode);

diff(y(x), x) = (2*x^3+2*x*y(x)^2-y(x)^2)*y(x)/(x*(x^3+x*y(x)^2-y(x)^2))

[_rational]

dsolve(new_ode)

_C1-arctanh((-2/(x^4*(1/y(x)^2+(x-1)/x^3)))^(1/2)*x/((-2*x+2)/(x^3*(1/y(x)^2+(x-1)/x^3))+2)^(1/2))+((-2*x+2)/(x^3*(1/y(x)^2+(x-1)/x^3))+2)^(1/2)/(-2/(x^4*(1/y(x)^2+(x-1)/x^3)))^(1/2) = 0

 


 

Download why_type_changed.mw

First 652 653 654 655 656 657 658 Last Page 654 of 2428