Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 364 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@tomleslie 

Using Google Chrome as my browser, there is an icon in the lower left of the Question. I right click on it and select "Open image in new tab." I checked with Firefox, and the icon doesn't appear there.

@Kitonum 

Thank you. I think that it's unfortunate that what I did above seems to be the simplest method for the OP's request. There should be an easier command for this.

Do you mean that you have trouble reading the Maple help pages? If so, then you've certainly learned quite a lot nonetheless.

@Honigmelone 

Argh! This is an example of what I hate about pattern matching. The issue is not your use of functions; rather, it's that abs is reversing the order of the subtraction (abs(a(t)-b) becomes abs(-a(t)+b)). A second rule can catch this:

rule1:= abs(''a''::algebraic)*abs(1, ''a''::algebraic)= ''a'':
rule2:= abs('expand'(-''a'')::algebraic)*abs(1, ''a''::algebraic)= ''a'':

ex:= sin(x)*abs(a(t)-b)*abs(1,a(t)-b):
applyrule([rule1, rule2], ex);

There's probably a way to combine the two rules into one and avoid the redundancy, but it's not occuring to me at the moment.

 

@vv 

x||(1..200);

@tomleslie Your anomalies are explained by operator precedence: assuming has lower precedence than 
->, so in the expression

p:= x-> Re(x) assuming x::real;

the assuming is outside of the procedure defintion. This can be corrected with parentheses, by using a proc ... end proc procedure definition, or by using `assuming` in prefix form.

See ?operators,precedence

@Przemek 

It's not possible to evaluate N(j,n,t,T) for j=2 and any numeric t because you get a division-by-zero error. If you fix that error, then my integral will work fine. For example, this works fine:

int(t-> N(i,n,t,T)^2, 0..1, numeric);

     0.109313886113886

The problem is in procedure N, not in the int command.

@vv 

Maple can reproduce your solution with some coaxing and hand holding. The two tricks are to make a symbolic constant during the maximization and to replace 5 with a variable during the simplification. These steps will produce exactly the solution that you gave:

f:= cos(2*t/m) + cos(2*(t+5)/m):
M:= maximize(eval(f, m= gamma));
M1:= combine(M);
M2:= simplify(expand(subs([10= 2*x, 20= 4*x], M1))) assuming x > 0;
subs([gamma= m, x= 5], M2);

@zishihuandi 

It's not really a system of PDEs. It's a single, simple one-dimensional heat equation with some complicated boundary conditions (complicated because they involve integrals of the unknown function). I don't know how to proceed from there, but this observation substantially reduces the apparent complexity from the original nine equations.

Can you show an example that doesn't use a restart between the withs and doesn't work correctly?

Your eq1 isn't an equation. Did you mean for it to be equated to 0?

@tomleslie I think that it's only easy if the color scheme is zgradient, as it is in your example. To do a custom colorscheme gradient based on another function requires something like this:

FuncGradient:= proc(P::specfunc([realcons,realcons], POINTS), f, minMAX::range(realcons))
local m:= lhs(minMAX), R:= rhs(minMAX) - m, p;
     COLOR(HUE, hfarray([seq((f(p[]) - m)/R, p= P)]))
end proc:

To apply this to the example that I used in my Answer, do

XY:= RandomTools:-Generate(list(list(float(range= -9..9), 2), 2^12)):
plots:-pointplot(XY, colorscheme= [FuncGradient, (x,y)-> sin(x), -1..1]);

(The plot that this produces is exactly like the one in my Answer.)

This does run faster than the code that I gave in my Answer.

For the OP to apply this to their situation, use

plots:-pointplot(XY, colorscheme= [FuncGradient, f, 0.1..1]);

What do you mean by the "roots" of a multivariate polynomial?

What does "run a two for" mean?

I'm probably not the typical Maple user, but, FWIW, I find the syntax :-keyword= keyword completely intuitive, and I find the syntax keyword= keyword counterintuitive. Indeed, the first time that I encountered a situation similar to yours (it was a recursive procedure with a keyword parameter), 
:-keyword= keyword was the first thing that I tried. 

If you read through Maple library code of recent years, you'll see that it's rife with examples of 
':-keyword'= value, even in cases where that colon-dash makes no difference.

@Doug Meade 

Why not the following single command?

ans:= GenerateMatrix(eqns, [x,y](t))[2];

The OP expressed concern about memory usage. Both of your two-command solutions prevent the garbage collection of the coefficient matrix.

 

Maple can't even differentiate HankelH1 with respect to its first argument, let alone get a series. Note that diff(HankelH1(x,y), x) returns unevaluated whereas diff(HankelH1(x,y), y) does not.

First 436 437 438 439 440 441 442 Last Page 438 of 709