Carl Love

Carl Love

28085 Reputation

25 Badges

13 years, 97 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

I'm not sure exactly what you mean by "according to required desire" (which sounds weird in English), so I'm going to assume that you mean "aesthetically". 

I'd do the following, which I've listed in decreasing order of aesthetic importance (which is of course a matter of personal judgement):

  1. Change the gridlines color from black to gray.
  2. Change the gridlines thickness from to (which isn't as small as it sounds).
  3. Add thickness= 2 to the main part of the plot.
  4. Change the labelfont to ["TIMES", "BOLDITALIC", 13]. The u in Helvetica looks weird to me because its descender (bottom right corner) is barely visible. 

With just those very easy changes, I get this:

With a bit more effort, a legend can be added:

kQs:= k=~ .1*[$4], Q=~ [.5615, .4989, .4365, .3742]: 
plot(
    subs~(kQs, M= .2, N= 2, x= 0, u), eta= -1..1, 
    color= [black, red, blue, green],
    legend= ``~(kQs), legendstyle= [location= right, font= ["TIMES", 8]], 
    thickness= 2, 
    labels= ['eta', 'u'], labelfont= ["TIMES", "BOLD", 13], size= 200*[3,2],
    axis= [gridlines= [8, thickness= 0, color= gray]]
);

This is not a bug in convert (or more precisely in convert(..., list) or `convert/list`); rather, your expectation of what that command is supposed to do is inconsistent with its help page ?convert,list. In particular, read the sections regarding the expected_type option, such as this sentence:

  • The use of the expected_type option enables the convenient extraction of terms, factors or (base, exponent) pairs without worrying about the trivial cases. 

But, in my opinion, there's been an attempt by Maplesoft to overload too much functionality onto convert(..., list), and it's not worth using except in the cases where its first argument is an rtable and the options nested and/or dimension are included. All other functionality can be better achieved by using more-primitive commands (e.g., [op]).

You haven't shown a sufficient number of examples of your intended input and its expected output for your Question to be fully Answered. In particular, what do you expect for each of these inputs?:

  1. 2*U(xi)^2
  2. 2*U(xi)^2*y(xi)^5
  3. sin(U(xi))
  4. sin(U(xi))*cos(y(xi))
  5. U(xi)^2 + y(xi)^5

You can use only parentheses ( ) (round brackets), not square brackets [ ], for algebraic grouping.

All that you need is the command

alias(e[inf]= e[4])

Like this:

plots:-sparsematrixplot(
    Jac_sparse, matrixview, 
    axis[1]= [
        tickmarks= [([$13]=~typeset~([seq](column_lables))), rotation= vertical]
    ],
    labels= [``$2]
);

Change the integration command to 

u[4]:= int((t-Tau)^(-1/2)*u[2], Tau= 0..t) assuming t > 0;

Do you mean that you want to take an equation such as 

F = x^(1/2)*ln(x)

and solve it for x? It can be done for some simple cases, such as the one shown. The command is solve:

solve({F = x^(1/2)*ln(x)}, {x}); 

I think that what you're referring to as "extracting a variable to one side of the formula" is what we usually refer to as "solving an equation for a variable".

Some even shorter code:

AreRowsUnique:= (A::Matrix)-> #Are the rows of A unique?
    evalb(nops({convert(A, 'listlist')[]}) = op([1,1], A))
:
IsRowPerm:= (A::Matrix, B::Matrix)-> #Is A a row permutation of B?
   #evalb(`=`(({op}@convert)~([A,B], 'listlist')[]))
    evalb(`=`((sort@convert)~([A,B], 'listlist')[])) #VV's correction
:

 

I see that convert(..., listlist) is labelled as "deprecated" but that it gets translated directly to convert(..., list, nested). I'd be happy to respect the "deprecated" if someone could tell me What's the point of labelling something as deprecated just to change its name, especially if it's a longer name?

If I expand the integrand and use the multiple-integral syntax where the limits are given as a list, then I get a simple (i.e., with no piecewise) analytic result that agrees with the numeric one:

restart:
R:= 1:  delta:= 1:
f:= 
    R^4*delta*cos(theta)*sin(x)*sin(-x+theta) /
    (8*Pi*(R^2*cos(x)+sqrt(2*R^2*cos(x)+2*R^2+4*delta^2)*delta+R^2+2*delta^2))
:
Int_f:= Int(expand(f), [x= -Pi+theta..Pi+theta, theta= 0..2*Pi]);
<intAna, intNum> =~ <((eval = evalf)@value, evalf)(Int_f)>; 

 

The reasons that this works are:

  • Using expand, the integrand can be expressed as a sum of terms each of the form f1(theta)*f2(x). In other words, the variables can be separated.
  • Using the combined multiple-integral syntax, it can tell that the range of theta is such that the piecewise isn't needed.

Sometimes you want to have a package initialization that is specific to using with; in those cases, give the package an exported nullary (i.e., 0 arguments) procedure named init. This is independent of whether the package also has a ModuleLoad.

restart:
Package:= module()
option package;
local ModuleLoad:= ()-> print("In ModuleLoad");
export init:= ()-> print("In init");
ModuleLoad() #In case module didn't come from an archive
end module
:
                        "In ModuleLoad"

with(Package):
                           "In init"

 

To use frontend practically with solve in these cases, you need to let solve look inside the subexpressions that contain A; but to preserve the original form (as much as is possible) you don't want it to look inside the subexpressions that don't contain A. The way to do that is:

frontend(solve, [A = (1/2+x+y)^3], [{}, {identical(A)}], A);

A more realistic example:

frontend(solve, [A = A^2 + (1/2+x+y)^3], [{}, {identical(A)}], A);

You wrote:

  • Why does this happen? It is the same equation.

But implicitplot is just working numerically, not symbolically. It does not see your input as an equation y - x/(2-x) = 0 but rather as a numeric "black-box" procedure: w:= (x::numeric, y::numeric)-> y - x/(2-x). Using this, all it can do is pass in numeric values of x and y, obtain those numeric results, and use those to make a guess about how many "pieces" (connected curves) the plot has.

Yes, the transformation can be done more easily and more universally like this:

`convert/atan2`:= rcurry(evalindets, ' 'arctan' '(algebraic), arctan@op@[numer,denom]@op):

You can store that in your personal library, module, or initialization file.

Example usage:
eq:= phi = arctan(A/B) - arctan(B/A):
convert(eq, atan2);

             

It makes no difference how complicated the target expression is or how many arctans it has. It'll even work on nested arctans. 

It's very likely that your integrals can be speeded up by adding the option numeric to their integration commands, for example,

int(sin(x), x= 0..Pi, numeric)

But Maple Flow is a listed choice. As you can now see in your Question's header, I edited it so that Maple Flow and MaplePrimes have been checked.

Sorry, I misunderstood your Question (due to my relative lack of familiarity with the "tabs" in MaplePrimes compared to the controls and check boxes that I often use for editing Questions and Posts). You are correct that it's missing and should be listed.

First 44 45 46 47 48 49 50 Last Page 46 of 395