Preben Alsholm

13728 Reputation

22 Badges

20 years, 241 days

MaplePrimes Activity


These are answers submitted by Preben Alsholm

Here is a way that works under the assumption that the summand is of type `+`.

map(op(0,ans),op(ans));
isolate(%=0,op(1,%));

It seems that occasionally something similar to IntegrationTools:-Expand could be useful.

The problem is that you declare U, S, and Vt local, and that SingularValues expects the global names.

So change the local names to U1, S1, and Vt1, but keep the global U, S, and Vt in SingularValues.

I just tried Tools/Options/General/Browser

There you can select a "browser" which does absolutely nothing, provided you create an entirely empty file with an .exe extension, e.g. do_nothing.exe.

That will of course give you problems if you need a browser in Maple for another purpose.

But you are right, these hyperlinked error messages are at the moment rarely useful as far as the hyperlinking is concerned.

I wouldn't want the error messages to disappear of course.

(Added: The Maple Cloud and export to html are unaffected by the change to a do_nothing browser.)

Is collect what you need?

u:=(x+k-n+5)*(x-3*k+n^2+2);
collect(u,k);
collect(u,[k,n]);
collect(u,[k,n],distributed);

How about

ExtractRadicands:=proc(u::algebraic,{[roots,root]::{fraction,{list,set}(fraction),identical('all')}:='all' }) local r,R;
  R:=map([op],indets(u,`^` ));
  if type(roots,fraction) then r:={roots} elif roots<>'all' then r:=convert(roots,set) end if;
  if roots='all' then R else select(x->member(op(2,x),r),R) end if
end proc;

The output is a set of lists of the form [radicand, power]

Examples:

q:=1+2*sqrt(x+1)+1/sqrt(y^2+98)+89^(-1/3)+t^(5/7);
ExtractRadicands(q);
ExtractRadicands(q,roots=1/2);
ExtractRadicands(q,roots=2/3);
ExtractRadicands(q,roots=[-1/2,1/3]);
ExtractRadicands(q,roots=[-1/2,1/3,1/7]);
ExtractRadicands(q,roots=1/7);
g := 1+2*sqrt(x+sqrt(7));
ExtractRadicands(g);
ExtractRadicands(1/sqrt(1+x));

I didn't write a procedure, but that should be easy to do by using the following examples:

u:=1+2*sqrt(x+1);
indets(u,algebraic^(1/2));
op(map2(op,1,%));
w:=1+2*sqrt(x+1)+1/sqrt(y^2+98);
indets(w,{algebraic^(1/2),algebraic^(-1/2)});
op(map2(op,1,%));

I have to guess at your intention (see my comment to your question). Supposing you meant

equ2 := (w*.87)*(1-(1/x)^.2385)-(288*(x^.3174-1))/(.85);

Then you could do

seq(fsolve(equ2=0,x=1..10),w=[600,700,800,900]);

#An illustration

plots:-animate(plot,[equ2,x=0..10,-5..1],w=600..900);

I noticed that you already answered your question yourself by replacing sum by add, which is the better idea.

However, sum can be used like this:

sum('numbcomb(80, x)*numbcomb(100, 27-x)', x = 1 .. 27);

The use of unevaluation quotes prevents numcomb from complaining prematurely.

Dams := proc (f, x, c)
local A;
printf("\nDin funktion er %a", f);
A := diff(f, x);
printf("\nDen differentierede funktion er %a", A);
printf("\nFunktionens værdi i %a", c);
printf(" er %a",eval(f,x=c));
printf("\nFunktionen f(x) ser således ud:"); plot(f,x=-10..10)
end proc;

It could be that replacing Transpose with LinearAlgebra:-Transpose solves the problem, since the error message seems to suggest that Transpose is not acting. Inside procedures you need the full name, in this case  LinearAlgebra:-Transpose.

I got one. I don't consider it in any way perfect, but since you ask I have uploaded a worksheet containing that and two procedures which it uses. Examples are provided. I haven't had time to translate text in the procedures from Danish into English. It was never meant for a large audience. I use it myself as part of a large package. I tested the worksheet's first few examples to see if MultiAnimate depended on other private procedures than Chop and NestDo, but I didn't test all the examples.  MultiAnimate.mw

In the usual sense (Lebesgue/improper Riemann or what have you) the function exp(I*(k-q)*x) is not integrable on the interval -infinity..infinity (of course).

Thus it is entirely appropriate for Maple to return 'undefined'.

However, FunctionAdvisor is aware of the connection to Dirac:

FunctionAdvisor(Dirac,definition);
FunctionAdvisor(Dirac,integral_form);

f[1] := x[2]+x[3]+x[5]+x[6]=16; f[2] := x[1]+x[2]-x[3]+x[4]+3*x[6]+x[7]=28;
var:=indets({f[1],f[2]},And(name,Not(constant)));

#The maximal index:
max(op(op~(var)));
#The corresponding variable:
op(select(has, var,%));

You can use implicitplot3d.

with(plots):
f:=x^a * y^b * z^c ;
fk:=eval(f,{a=1/2,b=1/2,c=1/2});
implicitplot3d(fk=50, x=0..40 ,  y=0..40, z=0..40,axes=boxed);
implicitplot3d([fk=50,fk=100,fk=150] ,x=0..40 ,  y=0..40, z=0..40,axes=boxed);
animate(implicitplot3d,[fk=L, x=0..40 ,  y=0..40, z=0..40,axes=boxed],L=50..150);
animate(implicitplot3d,[eval(f,{a=1/2,b=1/2})=50, x=0..40 ,  y=0..40, z=0..40,axes=boxed],c=0..1);

Without redirecting I tried your code and it produced the attached matlab output together with the warnings

Warning, the function names {`theta[1]`, `theta[2]`, `theta[3]`, `theta[4]`} are not recognized in the target language
Warning, the following variable name replacements were made: ["cg0", "cg2", "cg4"] = ["&Delta;x", "&Delta;y", "&Delta;z"]


matlab.txt

First 143 144 145 146 147 148 149 Last Page 145 of 160