acer

33188 Reputation

29 Badges

20 years, 209 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@awass 

If you want to use the simple read functionality (for accessing/loading a value for a name, but only when you decide to, as an explicit action), then yes, the simplest way to update the stored value is to repeat the command,
    save p,q,r, "test.m";
which just clobbers the file "test.m", by replacing it. Yes, if you store multiple assigned names/values to the same .m file then it can be problematic to update them separately. It sounds as if using distinct .m files for each stored name might work best for your scenarios as described so far.

I forgot to mention something in my Answer. I made it sound as if you had to use fprintf if you wanted to store a plaintext readable file. But you can in fact use the save command store the polynomial, assigned to name p, as plaintext, in a text file. The differences comes from the choice of filename extension. The following command would also produce a plaintext file:

    save p, "foo.mpl";

whose contents could be just a single statement of text, as Maple code, like say,

    p := 62*x^9-82*x^8+80*x^7-44*x^5+71*x^4-17*x^2;

You could also do the same thing with, say,

    save p, "boo.txt";

That plaintext can be used with the read command. And in fact it's the very same plaintext that my Answer's second fprintf example constructed.

The .m extension (dotm) is a proprietary form, mostly unreadable without special knowledge. One of its virtues is that some large structures can be stored/accessed reasonably quickly. Another is that some non-text structures can be stored.

A more complicated mechanism is that of Maple Library Archives, which are files with .mla filename extension. Those are contained for multiple .m structures. It doesn't sound to me that (at present) you are in need of that extra complication. See the Help page for LibraryTools, if wanted. Not only is access quite different for that mechanism, but it's awkward for retrieval other than once-per-session for each name. And it uses libname, whose Help page mentions the older savelib & march rather than the newer (simpler/safer) LibraryTools. Sigh.

ps. Regarding loading of the plots package. Maple has many packages. Some different packages export the "same" name. But even without such inter-package collision, there are other reasons why packages are not loaded by default: they are a form of encapsulation; they preserve the global name-space.

@dharr That's nice. I vote up.

If you don't mind my following up on your suggestion for inert %Determinant, etc, (and a couple of edits),

restart;

ZehfussReplace := proc(expr) uses LinearAlgebra;
  subsindets(expr,
    specfunc(And(specfunc('Matrix'('square'),{%KroneckerProduct,KroneckerProduct}),
                 2 &under nops),{%Determinant,Determinant}),
    proc(q) local A:=op([1,1],q), B:=op([1,2],q);
      Determinant(A)^(upperbound(B)[1])*Determinant(B)^(upperbound(A)[1])
    end proc);
end proc:

 

with(LinearAlgebra):

A := Matrix(2, 2, symbol = a): B := Matrix(3, 3, symbol = b):

 

EX1 := %Determinant(%KroneckerProduct(A, B))
       + 2*%Determinant(%KroneckerProduct(A, A)):

A1 := ZehfussReplace(EX1);

(a[1, 1]*a[2, 2]-a[1, 2]*a[2, 1])^3*(b[1, 1]*b[2, 2]*b[3, 3]-b[1, 1]*b[2, 3]*b[3, 2]-b[1, 2]*b[2, 1]*b[3, 3]+b[1, 2]*b[2, 3]*b[3, 1]+b[1, 3]*b[2, 1]*b[3, 2]-b[1, 3]*b[2, 2]*b[3, 1])^2+2*(a[1, 1]*a[2, 2]-a[1, 2]*a[2, 1])^4

 

simplify( value(EX1) - A1 );

0

 

EX2 := 'Determinant'('KroneckerProduct'(A, B))
       + 2*'Determinant'('KroneckerProduct'(A, A)):

A2 := ZehfussReplace( eval(EX2,1) );

(a[1, 1]*a[2, 2]-a[1, 2]*a[2, 1])^3*(b[1, 1]*b[2, 2]*b[3, 3]-b[1, 1]*b[2, 3]*b[3, 2]-b[1, 2]*b[2, 1]*b[3, 3]+b[1, 2]*b[2, 3]*b[3, 1]+b[1, 3]*b[2, 1]*b[3, 2]-b[1, 3]*b[2, 2]*b[3, 1])^2+2*(a[1, 1]*a[2, 2]-a[1, 2]*a[2, 1])^4

 

simplify( EX2 - A2 );

0


Download ZehfussReplace_ac.mw

Someone keeps removing all the tags on this Question.

Please stop doing that.

It's data that has a use (to Maplesoft). If this is a deliberate action (repeated four or five times now), then the member's ability to edit tags might itself need revising.

Try it without special characters like & in the file name.

If all that's needed are the plots then it seems as if one might add an option like,

    epsilon=1e-4

to the Int calls. I suspect that, or 1e-3, would retain decent visual accuracy while being quicker.

What exactly (and in detail) do you mean by, "I need this functionality since maple returns results with e^(...) instead of exp(...)"?

It's not clear what you mean by that, and what precisely you need to accomplish and why.

What is the purpose of your attempted substitution? I mean, why do you need to do it? (...the explanation of which seems more pressing that to reply how you could do it.)

ps. I've edited your Question, to mark is as Product=Maple 2024, since that's the version in which your attachment was last saved.  Maple 2024.2 gets your first result (with exp), directly and without adjustment to the table. Why does your worksheet try to add that form, for the exp example?

Your expression assigned to V contains several instances of k(L-x) which is a function call. It is the name k applied to argument L-x .

Did you intend that as the product k*(L-x) ?

@FDS_ERT 

I was only able to import a single character from your original .txt file, with the usual Maple Library commands for that (ImportMatrix, or Import). So I opened it in my Linux with the vi editor. That treated it as UTF-8, and showed all the interspersed zero-byte null characters (as ^@ ).

My Linux spreadsheet LibreOffice opened your file directly, as (unicode) UTF-16, and It seems that's what your Excel does too. Nice.

There are a few places in Maple (eg. StringTools) where it specifically mentions that it expects UTF-8 (only). I didn't see any notes like that on the Maple Help-pages of, say, its Import or ImportMatrix commands.

See this Help-page (also available in your Maple's own Help system), for the angle-bracket constructors that can horizontally augment and vertically stack blocks into a larger Vector/Matrix.

The blocks can be scalars, Vectors, or Matrices, as long as the dimensions agree.

What do you mean by the "...does the _a belong to the outermost RootOf"?

The _a is not a placeholder for any RootOf. It is not acting like _Z, say.

The _a is a variable-of-integration.

Are you wanting to change the name(s) of the variable of integration, going from inside to out?

@EdmondR You're very welcome.

If your response means that (very close to) the full contents of your documents are now once again available to you, then great.

Moving forward, you might want periodically to copy aside backup snapshops of your documents, to avoid apparent/full loss at some future date.

I'll investigate whether Maple Flow 2026 does a better job than your Maple Flow 2025 at content recovery, and if inadequate file a bug report, etc.

Fwiw, you could also do that with the command,

    Matrix(9, (i, j) -> ifactor(j*i))

There is no attachment.

Note the a substitution involving, say,   sec(I*x)  would get turned back into the sech form upon an evaluation.

It should be possible to do a substitution by the "inert"  %sec, etc, but it's not clear whether that would help you; it depends on what further symbolic manipulation/solving you'd want to do with it remaining (or not!) in that form.

nb. There are three patterns, for the collection of relevent functions, with/without additional factors of I&-I. But there's little point in coding up the substitutions if the %-forms won't serve you adequately. So, it really might make a big difference what you need to do with it subsequently. Note the simplify as well as value could also revert them.

@FDS_ERT You didn't actually answer any of my particular queries, which I suspect may be key to answering better. Also, details are absent of what it would mean to "clean up" this file.

1 2 3 4 5 6 7 Last Page 1 of 607