Carl Love

Carl Love

28070 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

Use a parametric plot, like this:

y := int(1/(-0.4016e-1*m^(2/3)-0.211e-3*m^(5/3)), m):
plot([y, m, m= 0..2], labels= ['y', m]);

Use plots:-spacecurve to plot the 2D curve with a z-coordinate of 0.

plots:-display(
     plot3d(exp(x*y), x= 0..1, y= 0..1),
     plots:-spacecurve([x, exp(x), 0], x= 0..1, color= red, thickness= 2)
);

A complete plot of exp(x+y+z) would require four dimensions. Using three dimensions, you'll have to settle for the function's level surfaces, which can be plotted via

plot3d(-x-y+ln(C), ...)

where C is the level value.

For a < b, Heaviside(x-a) - Heaviside(x-b) is 1 for a <= x < b and 0 otherwise (given your redefinition of Heaviside(0)). Therefore, the integral

Int(f(x), x= a..b)

is equivalent to

Int(f(x)*(Heaviside(x-a) - Heaviside(x-b)), x= -infinity..infinity).

 

Avoiding automatic simplifications is a very tricky thing, and I don't think that there's any perfect solution. Your case is especially tricky because you also want to preserve superfluous parentheses. I think that the best solution is offered by the InertForm package.

macro(IF= InertForm):

Enter the expression as below. The purpose of the ``s is to preserve the parentheses.

ex:=
     ``(IF:-Parse("F^5*alpha[5]+F^4*alpha[4]+F^3*alpha[3]+F^2*alpha[2]+F*alpha[1]")) +
     ``(IF:-Parse(
            "F^4*G*gamma[1]+F*G^4*gamma[3]+F^2*G*gamma[2]+"
            "F*G^2*gamma[4]+F*G*gamma[5]"
     )) +
     ``(IF:-Parse("G^5*beta[5]+G^4*beta[4]+G^3*beta[3]+G^2*beta[2]+G*beta[1]")) +  
     delta[0]
:

To view the expression, use

IF:-Typeset(ex, inert= false);

To use the expression mathematically, use

expand(value(ex));

It's not the complexity that matters. The problem is that (as far as I can tell) geometry:-draw can only plot within the window [-10..10, -10..10]. Your first line doesn't intersect that window.

As a workaround, use implicitplot:

with(geometry):
point(P1, [47+(38+22/60)/60, -(122+(43+4/60)/60)]):
point(P2, coordinates(P1) +~ [cos,sin](30*Pi/180)):
#Specify axes names as 3rd argument to `line` to avoid super-annoying dialogs!
line(L1, [P1,P2], [x,y]):
plots:-implicitplot(Equation(L1), x= -100..100, y= -100..100);

Update: The second sentence above is incorrect: The default view is [-10..10, -10..10], but that can be changed or nullified.

Change the line D:= A to D:= copy(A). The line D:= A doesn't mean what you think it does. It means that D will be A and will stay A until it is reassigned. Thus, any changes to D also change A.

There's a problem with how you entered T: You can't use square brackets for algebraic groupings. Enter T like this:

T:= (r,theta)-> 0.5*alpha+Sum(gamma*n*(r^n+R^(2*n)+r^(-n))*sin(n*theta), n= 1..infinity):

Use PDEtools:-dchange to make the change of variables:

PDEtools:-dchange({theta= arctan(y,x), r= sqrt(x^2+y^2)}, Diff(T(r,theta), y), [x,y]):
value(%);

Notice that Diff is with a capital D. This is necessary to delay the evaluation of the derivative until after the change of variables is applied. The value then performs that evaluation, which takes about three minutes, unfortunately.

 

 

 

What you call a perfect matching, I call a bijection. Here's a little procedure that finds all bijections between lists A and B:

Bijections:= proc(A::list, B::depends(And(list, satisfies(B-> nops(B)=nops(A)))))
     map[3](zip, `[]`, A, combinat:-permute(B))
end proc:

Bijections([1,2,3], [4,5,6]);

[[[1, 4], [2, 5], [3, 6]], [[1, 4], [2, 6], [3, 5]], [[1, 5], [2, 4], [3, 6]], [[1, 5], [2, 6], [3, 4]], [[1, 6], [2, 4], [3, 5]], [[1, 6], [2, 5], [3, 4]]]

If you have Maple 2016, then the following may be more efficient:

Bijections:= proc(A::list, B::depends(And(list, satisfies(B-> nops(B)=nops(A)))))
local b;

     seq(zip(`[]`, A, convert(b[],list)), b= Iterator:-Permute(B))
end proc:

Remove the line

xi:= k[1]*x-k[1]*c[1]*t ;  eta:= k[2]*x-k[2]*c[2]*t ;

Replace it with

PDEtools:-dchange({xi= k[1]*x-k[1]*c[1]*t, eta= k[2]*x-k[2]*c[2]*t}, Diff(u,t), [x,t]):
value(%);

In Maple, the end of a line is treated like a space, so there's no need for any line-continuation symbol. For human readability, the continued parts of the lines should be indented, but the code parser doesn't care. In Maple, your example command could be

A:= [
     3, 4, 5, 6, 6, 45, 37,
     5, 4, 67, 39, -967
];

In the extremely rare situation that you need to end a line at a place where a space wouldn't be allowed, end it with a backslash \. But I can't think of any situation where there's not a more-elegant way to do this.

I assume that you mean that you want to import the drawing of the graph rather than its mathematical description.

First check which formats the other program can import. Left-click on the drawing so that it's selected, but so that no subpart of it is selected (a selected subpart would be highlighted). Right-click to bring up the context menu. Select Export, and select the format from the submenu. If possible, avoid JPEG: it's not a good format for line drawings.

It's possible to automate this process so that it's done programmatically. If that's what you want, let me know.

< <Matrix(S*(dmax-1), S) | Matrix(S*(dmax-1), shape= identity)>,
    -`<|>`(CCnew||(0..dmax-1))
>;

Explanation:

<...|...> or `<|>`(...) is used to separate columns or to separate blocks horizontally; <...,...> or `<,>`(...) is used to separate rows or to separate blocks vertically.

A sequence of global variables with numeric suffixes can be created as V||(a..b).

For reasons that I don't understand, the minus sign can't be right next to CCnew.

The assumptions unfortunately don't help in this case. The equations and inequalities need to be handled separately (as far as I know). Use command isolve on the equations. The Z is to parametrize the solutions.

Sol:= isolve({eq1, eq2}, Z);

     Sol:= {A = 39-49*Z, J = 60+40*Z, T = 1+9*Z}

The parameter Z can be any integer. We need to get the range of Z that satisfies the inequalities.

SolZ:= isolve(rhs~(Sol) >=~ 0);

     {Z = 0}

eval(Sol,  SolZ);

     {A = 39, J = 60, T = 1}

 

spin:= (-1)^~LinearAlgebra:-RandomMatrix(N, generator= 0..1);
to 1000 do
     neighbors:= ArrayTools:-CircularShift(spin, 0, 1) + ...
     ...
end do;

Is this what you want?

u:= x(t)/sqrt(x(t)^2+y(t)^2-2*x(t)+1)*diff(y(t),t);
v:= subsindets(u, specfunc(anything, diff), freeze);
T:= indets(v, name);
w:= subsindets(v, function(identical(T[])), freeze);
var:= indets(w, name);
mtaylor(w, var, 4);
thaw(%);

First 224 225 226 227 228 229 230 Last Page 226 of 395