acer

33188 Reputation

29 Badges

20 years, 207 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Soldalma When you copied the file from bin.xxx to homedir location you kept other lines in it? The file "C:\Users\Fernando\maple.ini" should contain only valid Maple commands. It sounds to me as if you have inadvertantly copied over some preferences file.

I suggest leaving all files under bin.xxx alone, and never edited. Have the file "C:\Users\Fernando\maple.ini" contain only valid maple commands, such as the ones you wanted. Those line are read as 1D Maple Notation commands and should end in a semicolon (if you want the results echoed) or a colon (if you want them executed silently).

@kle8309 While the goal of "easy ways to use units" is important, the Units:-Natural subpackage was not a great idea. When loaded it simply takes away far too many common names and symbols from other uses.

But you can still use convert(..,units,..) in the following way for this example, with Units:-Natural loaded.

restart:
with(Units:-Natural):
convert( Unit(m^2*kg/(s^4*A)), units, :-`/`(V,us));
convert( Unit(m^2*kg/(s^4*A)), units, 'V/us');

@maple fan In this case "hybrid" means a hybrid of both hardware and software floating-point precision, not a hybrid of numeric and symbolic methods.

@maple fan You've found a bug. It only goes wrong when Digits = floor(evalhf(Digits)). In Maple 12.02 that means when Digits=14 for MS-Windows, and in Maple 18.02 it means when Digits=15.

I will submit a bug report.

At higher or lower values of Digits I have not yet seen a problem.

restart;
Digits:=floor(evalhf(Digits));

                                Digits := 15

with(LinearAlgebra):
A:=Matrix([[1,3],[2,5]],datatype=float):
b:=Vector([1,1],datatype=float):
infolevel[LinearAlgebra]:=5:
LinearSolve(A,b,method=hybrid);

  LinearSolve: using method hybrid
  LinearSolve: using method hybrid
  LinearSolve: calling external function
  LinearSolve: NAG hw_f07adf
  LinearSolve: NAG hw_f07aef
  LinearSolve: CLAPACK sw_dgerfs_
  Error, (in SWcallhybrid[1]) param 4 should be an rtable

kernelopts(version);
          Maple 18.02, X86 64 WINDOWS, Oct 20 2014, Build ID 991181

@Bryon The tags "linear_algeba" and "thank-you-mapleprimes" could go...

I see nothing unfriendly about your question.

I suspect that you're right -- it need not be coded that way. It might instead begin like, say,

R := Matrix(n, n, ':-shape' = ':-triangular'[':-lower']);

and end with something like,

Digits:=oldDigits:
map[':-inplace'](evalf,R);

There are lots of ways to get similar effects, of course. I suspect that we are seeing some part of the personal style of the code's author. (To me, it looks old-fashioned, almost redolent of linalg.)

I suspect that the author was not especially concerned about efficiency. The author might have felt that this is a routine more for exposition of method than for attaining maximal efficiency, being part of the Student body of code. Examples are likely not large enough or repeated often enough to make the efficiency concerns most crucial. If efficiency were more crucial here then better to operate at hardware precision. And less need to round down the result.

All the above is my best guess. I cannot prove any of it.

acer

@nm There is a separate procedure `evalf/AiryBiZeros`.

Maple has an extension mechanism, which allows evalf to utilize a custom procedure.

restart:

`evalf/foo` := proc(x) x!; end proc:

evalf( foo(3) );                    

                                       6

There are examples of this on the help page for topic evalf,details.

In my Chrome (version 25.0.1364.152) on 64bit Linux the voting toggles (upvote, favorite, best-answer) don't do anything.

acer

You have two sets of braces (nested) in your assignment to `init4`. Remove the outer ones.

acer

In 1D Maple notation the following returns the scalar value 2. Note the space after the first closing parenthesis (round bracket).

    Vector([1,2]) (2);

In 2D Math input mode it produces Vector([2,4]) since the space is interpreted as implicit multiplication.

@9colai By default the plotting mechanism will try to use evalhf to evaluate the expression. Some of the multiplicands' exponents are out of range for double precision, however.

There are several ways around this.

For this particular example, expanding the product combines some of the exponents. Ie, in Maple 18.01, these both work.

plot(expand(u));
plot(simplify(u));

Other workarounds can involve side-stepping evalhf mode. One way is to set Digits higher than evalhf(Digits).

Digits:=17:
plot(u);

Or, if you don't want to set Digits high,

Digits:=10:
UseHardwareFloats:=false:
plot(u);

@wo0olf There are details inside the numerical pdsolve routines which will get printed if you execute the command,

infolevel[`pdsolve/numeric`]:=2:

before you call pdsolve(..., numeric).

Execute the command I showed (or set the value higher, say to 3), and then call the solver as you did before. That is all.

@ctc In your latest comment you are still missing proper syntax for the multiplication of terms y(x) and (20-y(x)), which I pointed out before.

It is sometimes useful to make the condition explicit, as an assumption. Sometimes simplification with the `symbolic` option to ignore branch cut details leads to confusion for some people, when they forget later on that the results were conditional.

ee := -ln(-a/(b-c)):
combine(ee) assuming a/(c-b)>0;

                            /  b - c\
                          ln|- -----|
                            \    a  /

You appear to be missing the multiplication sign between y(x) and (20-y(x)).

Are you looking for something remotely like this (not making any attempt at the Order question)?

des := diff(y(x), x) = (1/80)*(y(x))*(20-y(x)):
ics := y(0) = 1:
soln := dsolve({des, ics}, {y(x)}, series);
approx := eval(y(x), convert(soln,polynom));
exact := eval(y(x), dsolve({des, ics}, {y(x)}));
plot( [approx, exact], x=0..20, color=[red,blue], linestyle=[1,2] );

acer

First 360 361 362 363 364 365 366 Last Page 362 of 607