Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi,

I am struggling with one task involving solve and plot commands. I would appreciate if I could get some help. What I need to do is as follows:

1. Define alpha between 0 and 1.

2. Solve an equation f(x,alpha) =0 for x by taking different values of alpha.

3. Of all values of x obtained in step 2, choose the value of x between 0 and 1 and discard all others. I have technically shown that there will be exactly one value that is acceptable and all other values of x can be discarded.

4. For different values of alpha and correspondingly selected values of x in step 3, plot and display function g(x,alpha) with function value on the vertical axis and alpha on the horizontal axis.

Regards,

Omkar

 

solve({-infinity < a , a < -1, -1 < b ,  b < 0});

 

Hi, 

does anyone remember of a recent question (maybe a post) about a bouncing ball over a hilly ground?
I can't put the finger on it.

TIA

f(x) := piecewise(0 < x, x^(3/2)*sin(1/x), x = 0, 0, undefined);
plot(f(x));

gives me the following error:

Error, (in plot) incorrect first argument piecewise(0 < x, (HFloat(2.739493386336394e-116)+HFloat(2.739493386336394e-116)*I)*x^(3/2), x = 0, 0, undefined)

I just want to see the function plot. With Wolfram Alpha this is no deal at all!
 

I used the implicit function to draw two images, how to display only the intersection of two images? Or, how do I draw the x^2+y^2+z^2=1 image under x+y+z=0 condition? Code show as above.Thank you.

 

Is it because I have handed subs a multiset or is it because I used the "``" things in the code producing my set? I seemed to remember algsubs and subs working perfectly well regardless of the dimensions of the argument in previous times i have needed it.

 

 

 

abCaseSet := {[`0<a<1`, `0<b<1`], [`0<a<1`, `b=-1`], [`0<a<1`, `b=0`], [`0<a<1`, `b=1`], [`0<a<1`, `1<b<&infin;`], [`0<a<1`, -`1<b<0`], [`0<a<1`, -`&infin;<b<-1`], [`a=-1`, `0<b<1`], [`a=-1`, `b=-1`], [`a=-1`, `b=0`], [`a=-1`, `b=1`], [`a=-1`, `1<b<&infin;`], [`a=-1`, -`1<b<0`], [`a=-1`, -`&infin;<b<-1`], [`a=0`, `0<b<1`], [`a=0`, `b=-1`], [`a=0`, `b=0`], [`a=0`, `b=1`], [`a=0`, `1<b<&infin;`], [`a=0`, -`1<b<0`], [`a=0`, -`&infin;<b<-1`], [`a=1`, `0<b<1`], [`a=1`, `b=-1`], [`a=1`, `b=0`], [`a=1`, `b=1`], [`a=1`, `1<b<&infin;`], [`a=1`, -`1<b<0`], [`a=1`, -`&infin;<b<-1`], [`1<a<&infin;`, `0<b<1`], [`1<a<&infin;`, `b=-1`], [`1<a<&infin;`, `b=0`], [`1<a<&infin;`, `b=1`], [`1<a<&infin;`, `1<b<&infin;`], [`1<a<&infin;`, -`1<b<0`], [`1<a<&infin;`, -`&infin;<b<-1`], [-`1<a<0`, `0<b<1`], [-`1<a<0`, `b=-1`], [-`1<a<0`, `b=0`], [-`1<a<0`, `b=1`], [-`1<a<0`, `1<b<&infin;`], [-`1<a<0`, -`1<b<0`], [-`1<a<0`, -`&infin;<b<-1`], [-`&infin;<a<-1`, `0<b<1`], [-`&infin;<a<-1`, `b=-1`], [-`&infin;<a<-1`, `b=0`], [-`&infin;<a<-1`, `b=1`], [-`&infin;<a<-1`, `1<b<&infin;`], [-`&infin;<a<-1`, -`1<b<0`], [-`&infin;<a<-1`, -`&infin;<b<-1`]}

{[`0<a<1`, `0<b<1`], [`0<a<1`, `b=-1`], [`0<a<1`, `b=0`], [`0<a<1`, `b=1`], [`0<a<1`, `1<b<&infin;`], [`0<a<1`, -`1<b<0`], [`0<a<1`, -`&infin;<b<-1`], [`a=-1`, `0<b<1`], [`a=-1`, `b=-1`], [`a=-1`, `b=0`], [`a=-1`, `b=1`], [`a=-1`, `1<b<&infin;`], [`a=-1`, -`1<b<0`], [`a=-1`, -`&infin;<b<-1`], [`a=0`, `0<b<1`], [`a=0`, `b=-1`], [`a=0`, `b=0`], [`a=0`, `b=1`], [`a=0`, `1<b<&infin;`], [`a=0`, -`1<b<0`], [`a=0`, -`&infin;<b<-1`], [`a=1`, `0<b<1`], [`a=1`, `b=-1`], [`a=1`, `b=0`], [`a=1`, `b=1`], [`a=1`, `1<b<&infin;`], [`a=1`, -`1<b<0`], [`a=1`, -`&infin;<b<-1`], [`1<a<&infin;`, `0<b<1`], [`1<a<&infin;`, `b=-1`], [`1<a<&infin;`, `b=0`], [`1<a<&infin;`, `b=1`], [`1<a<&infin;`, `1<b<&infin;`], [`1<a<&infin;`, -`1<b<0`], [`1<a<&infin;`, -`&infin;<b<-1`], [-`1<a<0`, `0<b<1`], [-`1<a<0`, `b=-1`], [-`1<a<0`, `b=0`], [-`1<a<0`, `b=1`], [-`1<a<0`, `1<b<&infin;`], [-`1<a<0`, -`1<b<0`], [-`1<a<0`, -`&infin;<b<-1`], [-`&infin;<a<-1`, `0<b<1`], [-`&infin;<a<-1`, `b=-1`], [-`&infin;<a<-1`, `b=0`], [-`&infin;<a<-1`, `b=1`], [-`&infin;<a<-1`, `1<b<&infin;`], [-`&infin;<a<-1`, -`1<b<0`], [-`&infin;<a<-1`, -`&infin;<b<-1`]}

(1)

map(subs, {[`0<a<1`, `0<b<1`], [`0<a<1`, `b=-1`], [`0<a<1`, `b=0`], [`0<a<1`, `b=1`], [`0<a<1`, `1<b<&infin;`], [`0<a<1`, -`1<b<0`], [`0<a<1`, -`&infin;<b<-1`], [`a=-1`, `0<b<1`], [`a=-1`, `b=-1`], [`a=-1`, `b=0`], [`a=-1`, `b=1`], [`a=-1`, `1<b<&infin;`], [`a=-1`, -`1<b<0`], [`a=-1`, -`&infin;<b<-1`], [`a=0`, `0<b<1`], [`a=0`, `b=-1`], [`a=0`, `b=0`], [`a=0`, `b=1`], [`a=0`, `1<b<&infin;`], [`a=0`, -`1<b<0`], [`a=0`, -`&infin;<b<-1`], [`a=1`, `0<b<1`], [`a=1`, `b=-1`], [`a=1`, `b=0`], [`a=1`, `b=1`], [`a=1`, `1<b<&infin;`], [`a=1`, -`1<b<0`], [`a=1`, -`&infin;<b<-1`], [`1<a<&infin;`, `0<b<1`], [`1<a<&infin;`, `b=-1`], [`1<a<&infin;`, `b=0`], [`1<a<&infin;`, `b=1`], [`1<a<&infin;`, `1<b<&infin;`], [`1<a<&infin;`, -`1<b<0`], [`1<a<&infin;`, -`&infin;<b<-1`], [-`1<a<0`, `0<b<1`], [-`1<a<0`, `b=-1`], [-`1<a<0`, `b=0`], [-`1<a<0`, `b=1`], [-`1<a<0`, `1<b<&infin;`], [-`1<a<0`, -`1<b<0`], [-`1<a<0`, -`&infin;<b<-1`], [-`&infin;<a<-1`, `0<b<1`], [-`&infin;<a<-1`, `b=-1`], [-`&infin;<a<-1`, `b=0`], [-`&infin;<a<-1`, `b=1`], [-`&infin;<a<-1`, `1<b<&infin;`], [-`&infin;<a<-1`, -`1<b<0`], [-`&infin;<a<-1`, -`&infin;<b<-1`]}, a = A)

Error, invalid input: subs received [`0<a<1`, `0<b<1`], which is not valid for its 1st argument

 

``


 

Download subsQuestionMP.mw

 

Why Maple returns -1/x as singular solution below when this solution can be obtained from the general solution when constant of integration is zero?

restart;

ode:=2*y(x)+2*x*y(x)^2+(2*x+2*x^2*y(x))*diff(y(x),x) = 0;
dsolve(ode,singsol=false);

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

y(x) = (-1-_C1)/x, y(x) = (-1+_C1)/x

sol:=[dsolve(ode,singsol=essential)];

[y(x) = -1/x, y(x) = (-1-_C1)/x, y(x) = (-1+_C1)/x]

subs(_C1=0,sol)

[y(x) = -1/x, y(x) = -1/x, y(x) = -1/x]

 


Download essential.mw

How can I get a seq(seq(...))) to print each sub-sequence per line? It currently prints all the sequences as one big sequence. I'd like some way to tell it to "eol".

 

I've made this proc and it has 2 outputs




*

How do I fix that?

Some mathematical functions and also some (not so) inert functions are implemented as objects.
For example, Perm is used to represent permutations.

p :=Perm([2,3,1,5,4]);  # ==> disjoint cycles representation
        p:=(1,2,3)(4,5);
lprint(p);
Perm([[1, 2, 3], [4, 5]])
    
Perm acts as an inert function (like RootOf) but it's an object.
Is it possible to convert it into a true inert form such as PERM([[1, 2, 3], [4, 5]]) and so, being able to extract the arguments with op?  

In this specific case we may use
convert(p, disjcyc);
       [[1, 2, 3], [4, 5]]
    
but this is possible only because Perm has a convert export.
So, is it possible to obtain the arguments directly (without convert)?
This would be useful for other situations.

Hi there,

ist there any possibility to change the native look and feel of the gui? I use Arch-Linux. I've tried other java runtimes instead of the shipped. Maple works, but only with the awful look and feel :D

Thx :)

Heiko

We all know that Maple's Latex is not the best of Maple to say the least.

But this one is really strange. Maple prints a `1` for no apparant reason in the latex which makes it ugly. 

I wonder if Maplesoft still maintains its Latex conversion code at all?  So one can at least hope may be one day all of this will get fixed? Year after year, and Maple's Latex still not changed.  

If Mapesoft do not intend to make any changes in its Latex conversion software at all, it will be good if an official statement is made in this regards so that at least customers know.

sol:=dsolve((x-a)*(x-b)*diff(y(x),x)+k*(y(x)-a)*(y(x)-b) = 0,y(x)):
sol:=subs(_C1=C[1],sol);

y(x) = ((x-b)^(-k)*(x-a)^k*a*exp(a*k*C[1]-b*k*C[1])-(x-b)^(-k)*(x-a)^k*b*exp(a*k*C[1]-b*k*C[1])+b*((-x+b)/(-x+a))^(-k)*exp(a*k*C[1]-b*k*C[1])-b)/(-1+((-x+b)/(-x+a))^(-k)*exp(a*k*C[1]-b*k*C[1]))

latex(sol)

y \left( x \right) ={1 \left(  \left( x-b \right) ^{-k} \left( x-a
 \right) ^{k}a{{\rm e}^{akC_{{1}}-bkC_{{1}}}}- \left( x-b \right) ^{-k
} \left( x-a \right) ^{k}b{{\rm e}^{akC_{{1}}-bkC_{{1}}}}+b \left( {
\frac {-x+b}{-x+a}} \right) ^{-k}{{\rm e}^{akC_{{1}}-bkC_{{1}}}}-b

 \right)  \left( -1+ \left( {\frac {-x+b}{-x+a}} \right) ^{-k}{{\rm e}
^{akC_{{1}}-bkC_{{1}}}} \right) ^{-1}}

 

 

Download why_1_in_latex.mw

 

Why odetest sometimes fail to give 0  from odetest when simply using C[1] instead of _C1 as constant of integration?

I do not remember now if I asked about this before now. But for me as a user, this does not look right. I like to use C[1] instead of _C1 as the constant of integration as it looks better in Latex. I had no idea it will make a difference to odetest what the constant of integration symbol used is.

Is this a known issue? Do you consider this a bug? Maple 2019.1 on windows 10.

restart;

ode:= x^2*diff(y(x),x)+x*y(x)+sqrt(y(x)) = 0;

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

sol_1:=sqrt(y(x))=1/x+_C1/sqrt(x);
odetest(sol_1,ode)

y(x)^(1/2) = 1/x+_C1/x^(1/2)

0

sol_2:=subs(_C1=C[1],sol_1);
odetest(sol_2,ode); #why this now fails??

y(x)^(1/2) = 1/x+C[1]/x^(1/2)

-y(x)^(1/2)-y(x)^(1/2)*x^(1/2)*C[1]+x*y(x)

sol_3:=subs(C[1]=_C1,sol_2);
odetest(sol_3,ode)

y(x)^(1/2) = 1/x+_C1/x^(1/2)

0

 

Download why_odetest_fail.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
 

First 521 522 523 524 525 526 527 Last Page 523 of 2097