acer

28080 Reputation

29 Badges

17 years, 242 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@C_R Your requirements have changed.

Here is one very crude way to "nudge the Y up a bit". It's not very flexible.

The results render better in my actual Maple GUI (2023.0), without being cut off on the left.

This is all pretty hackish, because it wasn't designed for arbitrary layout. So, YMMV.

restart;

 

`print/myfun` := proc(ee, {offset::float:=-1.1,
                           size::posint:=17,
                           under::{algebraic,NoUserValue}:=_})
 uses Typesetting;
 mrow(`if`(under=':-NoUserValue',Typeset(ee),
           mover(mo(under,':-mathcolor'="white"),Typeset(ee))),
      mspace(':-width'=sprintf("%gem",offset)),
      mo("○",':-mathsize'=size));
end proc:

 

myfun(Y);

myfun(Y)

lprint(%);

myfun(Y)

myfun(exp(x), offset=-1.6, size=25, under=`-`);

myfun(exp(x), offset = -1.6, size = 25, under = `-`)

Download ts_negmspace2.mw

You should explain how you want the surface data that is to be exported, ie. your desired format.

For example, do you want it in three columns (x-y-z triples)?

Or could it just be the z-values (heights), since the x&y values follow the pattern of regularly sampling from their corresponding ranges.

You specified certain step-sizes in the call to pdsolve. But you also asked about exporting the data from the 3d plot (which by default has a different resolution). You should be clear about which spacing of x- and t-values you want for the exported data.

Or perhaps you have some other format in mind. You should be clear about what you want here.

Please don't spawn a separate Question thread for supplying the details.

@C_R Please don't spawn a wholly separate new Question thread on the issue of what your sheet looks like in M2015.

@Michael If you know that you only need to deal with a single factor then you could avoid the unnecessary expense of a complete factorization (eg. using ifactors) and just do divisions.

I would have suggested this earlier but the OP didn't originally give such details of the goal.

Please put close followups on your underlying problem in this (or one of your related previous Question threads), instead of spawning whooly new and separate Question threads for your problem.

@nicolesharp100 Please do not post a duplicate of this in an alternate Mapleprimes forum.

Feel free to submit an SCR (software change request).

@Linhuchong As Tom mentioned, there are several ways. I like his use of geometry.

I also like vv's approach.

For fun, keeping with implicitplot for no particular reason (and now more clumsily calling solve twice),

restart;
f:=2.96736996560705*10^(-12)*p^2+1.31319840299485*10^(-13)*t^2
   -8.89549693662593*10^(-7)*p+8.53128393394231*10^(-7)*t
   -3.65558815509970*10^(-30)*p*t-1:
P:=remove(has,solve(f<0,[p,t])[],t);
T:=remove(has,solve(f<0,[t,p])[],p);
p1,p2:=rhs(P[1]),lhs(P[2]);
t1,t2:=rhs(T[1]),lhs(T[2]);
plots:-implicitplot(f,p=p1..p2,t=t1..t2,scaling=constrained);

@Bennyjay You're welcome. We all make mistakes now and then.

By the way, if you're looking for a solution with all values nonnegative,

eqs := {Why, Do, It, Today, When, Its, Due, Tomorrow}:
vars := indets({Why, Do, It, Today, When, Its, Due, Tomorrow},name):
solve(eqs union (vars>=~0));

   {Cl = .8562628337e-2, H = .6579879116e-8, H2PO4 = .9122851784e-3,
    H3PO4 = .7913134254e-9, HPO4 = .8548948565e-2, Na = .2657618944e-1,
    OH = .1519784760e-5, PO4 = .6218631025e-6}

@FDS You are welcome. There's no reason to apologize, and I don't think that is was a basic query. The file is unusual.

@FDS The code that I provided works fine for me, even if the original input file has no filename extension.

As far as I can see, your issue isn't caused by the filename extension (or lack of it). Rather, it's caused by having all the text characters in your input file be separated by null characters, which may confuse some import mechanisms. I show a way to remove them. There are other ways.

(In contrast, your older Question thread had an example in which every character was separated by a space, which is different.)

The initial commands below import the data from the extensionless file, get rid of the null separators, and then write out the remaining content to a new plaintext file which can be imported in usual ways.

For example,

restart;
interface(rtablesize=100):

U:=FileTools:-Binary:-ReadFile("Spiking2011622"):
Q:=Array(remove(type,convert(U,list),0),datatype = integer[1]):
FileTools:-Binary:-WriteFile("Spiking2011622Q.txt",Q):

M:=ImportMatrix("Spiking2011622Q.txt"):

# And now the Matrix may be split by groups of rows,
# at the headers.
L:=[ListTools:-SearchAll("Id",convert(M[..,1],list))];
numelems(L);
All:=[seq(M[L[i]..L[i+1]-1,..],i=1..nops(L)-1)]:
map(numelems,All);
All[5][1..10,..], All[16][1..11,..];
All[5][11..,..], All[16][12..,..];

I have submitted a bug report.

A shorter example that fails the first time, in my Maple 2023.0:

restart;
expr := (x^2)^(1/2)/((x+y)*sqrt(x^2+1)+x^2*(1/2*y^2-1))^2:

simplify(expr);
Error, (in simplify/size/collect_and_recurse) invalid arguments to coeffs

In my Maple 2022.2 (64bit Linux) this example and the OP's worksheet run without error.

@MDD You could create a re-usable procedure (to handle the entries individually, via map, or which itself maps across F).

Such a procedure could accept a list of names, L, so that the sort could be done with plex(op(L)).

Let me know if you'd like the whole thing shown.

@C_R Why do you write it as , "new options" in the context of your example? Your smaller example works in many older versions.

How would you use your suggestion of convert (sincos and/or tan, etc) to handle the OP's original example to get a form as he expected?

@C_R I meant what I wrote in the first snippet, addressing the OP's actual example and literal query about cot(90 - alpha/2).

I wrote only the second snippet because I wasn't sure whether the "-90" was intentional (in radians).

5 6 7 8 9 10 11 Last Page 7 of 520