acer

32333 Reputation

29 Badges

19 years, 323 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Stretto I realize that this is going to sound crazy, but... there are actually two different kinds of file that Maple uses on MS-Windows, both of which are named maple.ini .

One of these contains saved preferences for the Java GUI. That's the one you've described. That's not the one that you need here.

What you want is a file that contains only plaintext Maple commands (or is empty). The online help for that is indeed topic worksheet/reference/initialization, as you found. You can create this file in one of the locations listed on that help page.

I suggest that you go with choice 3). I suggest that you do not mess around with maplejava.i4j.ini and try and change any location setting. You just need a file maple.ini in the folder that Maple thinks is your "home directory". It'll be a location similar to C:\\Users\userid\maple.ini but of course userid will be different.

You can even issue the Maple command  kernelopts(homedir)  to discover what Maple thinks is your home directory.

 

 

The simplest example I have so far is:

restart;

expr := (7 + a/b)/(1 + c/d):

latex( expr );
{1 \left( 7+{\frac {a}{b}} \right)  \left( 1+{\frac {c}{d}} \right) ^{
-1}}

The problem seems to be due to weak coding in procedure `latex/latex/*`.

Specifically, line 43 is a general else fallback, without any consideration for the special case that local numShort could be equal to 1.

showstat(`latex/latex/*`,42..43);

`latex/latex/*` := proc(e)
local subexp, den, ee, ff, subee, i, k, num, texlist, `\\,`, `\\frac `, `\\sqrt `, 
  `{`, `}`, ccnt, keepcnt, ll, nlist, numTall, numShort, denTall, denShort;
global _LatexSmallFractionConstant;
       ...
  42           texlist := '`{`', '`(`', `latex/print`(numShort), '`)`', 
                 texlist, '`}`'
           else
  43           texlist := '`{`', `latex/print`(numShort), texlist, '`}`'
       ...
end proc

If I replace that else with elif numShort<>1 then the errant 1 is not present in the generated LaTeX. I will test some more examples, and try and form a FromInert/ToInert hotfix.

This would not address my other concern, that the denominator renders like (den)^(-1) instead of within \frac{...}{den} . That'd likely require a deeper rewrite of this routine.

@Mohamed19 Simply read the help page for the diff command.

@Carl Love Thanks, Carl.

I've fixed it. (It didn't change that example's generated plot -- just the name in the unevaluated name case.)

That's an interesting question.

Technically speaking, that is not a command so much as a data structure used for plotting. When printed the interface renders this plot structure using a plot driver for the current plot device.

How can we describe the rules by which the shaded regions are determined? Here's an example:

restart;
# Drag the red circle around, inside the boxed axes.
Explore(PLOT(POLYGONS([[0,0],[1,0],[2,1],[0.5,1],
                       [0.7,0.5],[2.0,0.4],[a,b]]),
             AXESSTYLE(BOX)),
        a=0.0..2.0, b=0.0..1.0,
        initialvalues=[a=0.2, b=0.3],
        showmarkercontrols=false,
        markers=[[a, b, symbol=solidcircle, color=red]]);

A description would explain how the shaded regions change as the point [a,b] moves across lines determined by the line segments formed by adjacent point pairs (in the list). Visually the behavior "makes sense", but what is the precise characterization in words?

I adjusted the unevaluated call returned in method 3).

@nm I am guessing that the latex command calls content (or somehow otherwise computes a similar thing) when it does that manipulation of the denominator, and that it fails to account for the special cases that the content is 1 ( and perhaps also -1).

I will have a look.

@tomleslie From the 5th bullet point in the Description section of the Help page for Topic convert,temperature in Maple 2019,

Expressions with a unit are represented in Maple as a product of
the expression with a function call, which can be obtained by
calling the procedure "Unit". This means that Maple cannot
represent the expression "0" with a unit: it would be represented
as, for example, "0*degC", or internally, "0 . (Unit(degC))",
but "0" multiplied by any function call immediately simplifies
to "0". This particularly comes up with temperatures sometimes,
when dealing with empirical temperatures rather than with
temperature differences. This can be a reason to use Temperature
objects instead of regular unit expressions.

For example, contrasting combinations of relative versus absolute ("empirical") temperatures,

restart;

kernelopts(version);

`Maple 2019.1, X86 64 LINUX, May 21 2019, Build ID 1399874`

0.0*Unit(Celsius) + 30.0*Unit(K);

30.0*Units:-Unit(K)

Temperature(0.0, Celsius) + Temperature(30.0, K);

_m140524845539424

combine( -1*Unit(Celsius) -1*Unit(Fahrenheit), units);

-(14/9)*Units:-Unit(K)

Temperature(-1, Celsius) + Temperature(-1, Fahrenheit);

_m140524744097920

combine( 0*Unit(Celsius) - 0*Unit(Fahrenheit), units);

0

Temperature(0, Celsius) + Temperature(0, Fahrenheit);

_m140524744070656

 

Download temperatures.mw

Your examples using the is command are not meaningful, since is doesn't know how to compare different units anyway. It would not even handle these:

is( -1*Unit(degC) = -9/5*Unit(degF) );

                false

is( -1*Unit(degC) + 9/5*Unit(degF) = 0 );

                false

Note: While this is all interesting, I suspect that the OP's point about his first two examples was simply that he expected a result in terms of Unit(degC) rather than the received Unit(K). I may have misinterpreted, and indeed I initially considered that his first point might have to do relative versus absolute/empirical temperature.

I have submitted a bug report.

@gabrielperes46 Ok, thanks for clarifying.

You might try an uninstall/re-install, assuming the downloaded Installer is itself ok.

If you continue to have these issues then I'd suggest contacting Maplesoft's Tech Support.

In Maple it is capitalized Pi , and not pi. The lowercase name pi has no special meaning.

Pardon my asking, but do you have a valid license? There have been several reports somewhat similar to what you've shown, from people running "cracked" Maple 2019 without a valid license.

If you have additional details (such as pseudocode for the unweighted case) then please add it in a Reply/Comment here rather than in a separate Question.

Can you stack random row vectors created with a suitable density option value?

Or do you need it to be super fast and efficient?

@ajfriedlan I know what you're trying to do. I spent some time looking at it a few days ago.

I have doubts that `parameters` will help/work for you, since in your example the values of the varying i,j indices relate to differing subexpressions containing the dependent variable K.

I have several other observations on your problem, including accuracy/precision, the discontinuity jumps, evalf/Int vs dsolve/numeric, etc. I got some speedup and memory reduction, but I'd like to see it 20 times faster and 1/10th the allocation. I've also asked the dsolve developer about how to clear the hidden storage that seems to be going on for your example.

I have not yet had enough free time to respond properly in your Question's own thread.

But I will not respond at all if you continue to duplicate your question, including repeating it in such old posts as this.

@Ramakrishnan 

1) filenames including the absolute path (though names relative to currentdir may work)

2) This code doesn't go anywhere in the original worksheet to be converted.  You run it standalone (in the GUI if you wish),  and merely reference the original worksheet by name.

3) The target of this conversion is a new .mw file. Subsequent export to .pdf (if you want it) would still be done the usual way, ie. by opening the new worksheet in the GUI.

First 207 208 209 210 211 212 213 Last Page 209 of 591