acer

33193 Reputation

29 Badges

20 years, 211 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@mmcdara You have read and interpreted it correctly.

Also, that's a usual feature of truefalse keyword options -- supplying only the name acts like supplying it as equal to true. That's documented [1, 2] under the procedural parameter-processing Help pages.

Could you attach a worksheet or otherwise show us the definitions of f and g?

Upload and attach a worksheet that constructs these and reproduces the problem.

It is possible that your two instances of P[psi] are actually different names (eg. created with different assumptions on them, or as different escaped locals, or through some other means, etc). But it's really only helpful if you provide the means for us to see and reproduce the issue.

How far have you gotten with this coursework?

How far have you gotten with this coursework?

@Spirithaunter I suspect that your actual example is something larger and more involved, whose full details you have unfortunately not yet shown us.

So I shall guess as to what kind of thing your are trying to accomplish. Sorry if I guess poorly.

restart;
A1 := Vector(8,i->1.0*i);
A2 := map(sin, A1);
M := <A1|A2>;
Mnew := Matrix(remove(t->is(t[2] < 0),convert(M,listlist)));
plot(Mnew);

#DocumentTools:-Tabulate(Mnew, widthmode=pixels, width=300):

DocumentTools:-Tabulate(<<"x"|"f(x)">,Mnew>,
                        fillcolor=((M,i,j)->`if`(i=1,"Orange","PeachPuff")),
                        widthmode=pixels, width=300):

I actually was thinking of DocumentTools:-Tabulate acting on just a Matrix, as I find a DataFrame unnecessarily awkward for this.

In Maple 2015.2 this command crashes the kernel:

   sort(Vector(0))

and that seems to be what happens in your example.

That command does not crash in Maple 2016.2 and Maple 2020.1, as far as I can see so far.

At ten characters  sort(<[]>)  is pretty short, but not a record.

@binbagsss  Here are equations that you provided. The first equation you stated in your Question. The rest you provided in one of your posts on stackoverflow. You can easily change them.

eq1 :=  Uo/(sqrt(Go*Ho)) = Fr:
eq2 := (rho*Go*Ho^2)/sigma = W:
eq3 := St = (To*Uo)/Ho:
eq4 := Ca = (mu*Uo)/sigma:
eq5 := mu/sqrt(rho*sigma*Ho) = Oh:

The following deals with mu/To*Ho which is one of your input examples. It is a "one-liner".

eval( mu/To*Ho, [eliminate({eq1,eq2,eq3,eq4},{Go,Ho,To,Uo})][1,1] );

                            Ca sigma
                            --------
                               St  

The following deals with Go*Ho/Uo^2 which is your other input example. It is done the same as the example above.

eval( Go*Ho/Uo^2, [eliminate({eq1,eq2,eq3,eq4}, {Go,Ho,To,Uo})][1,1] );
                               1 
                              ---
                                2
                              Fr 

The following adds the 5th equation to the example above, and shows that the answer is not unique.

eval( Go*Ho/Uo^2, [eliminate({eq1,eq2,eq3,eq4,eq5}, {Go,Ho,To,Uo})][1,1] );
                                 2
                             W Oh 
                             -----
                                2 
                              Ca  

The non-uniqueness of the answer is because of Maths, not because of Maple. When the input example has more than one answer (ie. more than one dimensionless representation) then only you can resolve the ambiguity. Only you could decide which equations should be used.

@Joel19 I assigned the result from ImportMatrix to the name M, and you have assigned it to name A.

But you didn't adjust other places in the code that used the name M. Those need agree with your earlier choice.

@vv Thank you.

@Carl Love You wrote, "My opinion is that all algebraic equations eq given as input to any Maple program should be preprocessed with (lhs-rhs)(eq)."

As a blanket suggestion even just for user programming, and despite the fact that it might be useful in the context of Rouben's approach to this problem, that doesn't sound like a very good idea.

There are many cases in which an algebraic equation is sensibly and usefully used to represent a substitution/evaluation rule or an identity/equivalence/lookup. The lhs-rhs action would remove that wanted information.

@Kitonum The order of results from RealDomain:-solve is not guaranteed here, so extracting the y-values from Sol individually by position is problematic.

In Maple 2020.1 I get the reverse order using that code, which makes the final Area result negative, ie. an incorrect answer.

simplify(fnormal(int(g[1]-f[1], y=op([2,2],Sol[2])..op([2,2],Sol[1]))),zero);

            -0.75833670466253534952

As I realize that you know, there are lots of ways to extract the min and max values, eg. one possible fix-up is:

ymin,ymax := [min,max](map[2](eval,y,[Sol]))[];
simplify(fnormal(int(g[1]-f[1], y=ymin..ymax)), zero);

@mmcdara You can submit a Software Change Request directly from this forum by using the forms on its SCR page. (The format is more like a Bug Report, but whoever reads it will likely understand if you phrase it as a Feature Request, aka Request For Enhancement.)

I don't quite understand why not to mention up front in the Mapleprimes Question if you need a solution specifically in terms of the Maplets Plotter.

@Joel19 You can add this option, after a comma, into the end of the plot(...) call.

     labels=[b, ""]

where "" is the empty string (ie. two doublequotes).

How should it handle abs(1,x) ?

First 155 156 157 158 159 160 161 Last Page 157 of 607