djc

571 Reputation

12 Badges

17 years, 356 days
Technical professional in industry or government
Budapest, Hungary

MaplePrimes Activity


These are answers submitted by djc


In Maple 13 you  can you use the command convert/phaseamp :

expr:=-I0*sqrt(L)*sin(t/(sqrt(L)*sqrt(C)))/sqrt(C)+V0*cos(t/(sqrt(L)*sqrt(C)));

convert(expr, 'phaseamp', t);
 


For the first two questions:
 

Sum(k*x[i], i = 1 .. n);

simplify(%);

 

with(student): # with student package

Sum(x[i]+y[i], i = k .. n);
 

expand(%);

 combine(%); # opposite direction


Try the following:

restart;

init:=x(0)=2,D(x)(0)=-2;

eq:=diff(x(t),t$2)+5*diff(x(t),t)+4*x(t)=Dirac(t-2);

dsolve({eq,init},x(t));



You can also use the Laplace-transformation:

restart;
eq:=diff(x(t),t$2)+5*diff(x(t),t)+4*x(t)=Dirac(t-2);
eqs:=inttrans[laplace](eq,t,s);# equation in s-domain
sols:=solve(eqs,laplace(x(t), t, s));# solve for L(x(t))
solt:=inttrans[invlaplace](sols,s,t);#inverse tansform
subs([(D(x))(0)=-2,x(0)=2],solt);# substitute the initial conditions in the solution
plot(%);# plot the solution
 

Try this:

LinearAlgebra[Determinant](C);

or

with(LinearAlgebra):

Determinant(C);


Instead of the following:

ns:=Remove(c->evalb(c="."),convert(p,string));

one can also write this:


ns:=Substitute(convert(p,string),".","");

Just type:

plot(exp(-t)+t, t=-2..2);


I'm sorry for misunderstanding. Is this closer to that you want for the pdf expression t?
 

restart;with(Statistics):with(plots):Stop:=-10;m:=0;std:=20;
NumericEventHandler(invalid_operation = `Heaviside/EventHandler`(value_at_zero = 0)):
NormalPDF:= PDF(Normal(m, std), x);x1:=evalf(eval(CDF(Normal(m, std),x),x=Stop));
customPDF:=Heaviside(x-Stop)*NormalPDF+x1*Dirac(x-Stop);
customProbdist:= Distribution(PDF = unapply(customPDF,x));
R := RandomVariable(customProbdist);
customCDF:=CDF(R,x):
_cdfatstop=eval(customPDF,x=Stop):evalf(%);
int(customPDF,x=-infinity..infinity);

We also used the terminology of mixed type probability distribution for such things.
We plot the discrete part of the mixed probability distribution the same way as in case of a simple discrete distribution i.e the diracs are represented with vertical lines..
Some years ago there was a topic for plotting Dirac generalized functions in this way in Mapleprimes. Based on this thread one can plot the pdf in the following way too.
Using the Alec's technic for substituting Diracs by vertical lines the plot of pdf:


diracs:=[select(has,customPDF,Dirac)];S:=diracs:
F:=S->map(x->plottools[line]([-op([2,1,2],x),0],[-op([2,1,2],x),op(1,x)],color=red),[op(S)]);# by Alec
display(F(S),plot(convert(remove(has,customPDF,Dirac),piecewise),x=-25..30,y=-0..0.4));
 

Another way for calculating pdf expression for the above custom distribution: 

restart;with(Statistics):
NormalCDF := CDF(Normal(0, 10), x);
customCDF:=piecewise(x<-10,0,NormalCDF);
customProbdist := Distribution(CDF = unapply(customCDF, x));
R := RandomVariable(customProbdist);
PDF(R,x);# direct way for calculating pdf in Maple
diff(customCDF,x);# by definiton
diff(convert(customCDF,Heaviside),x);# by definition and with conversion as suggested above.
 

 

Hello,

The ReadMe.htm says that you should change the maple.ini located in the ....Maple 13\users directory:

' Copy the initialization file “Maple.ini” (from subdirectory “UserLibn/Users“) into subdirectory USERS of the root Maple directory (by default, “C:/Program Files/Maple n/USERS”)'

If it works correctly you can see a New Means section in the Maple-help contents.

I don't need to load the Aladjev's library manually after starting Maple. Just type the desired command of Aladjev's library.

Try for example difff command from Aladjev's library:

difff(sin(a(t)),a(t));

cos(a(t))


For example:

L:=[1,3,6,7];

L:=[L[],5];

 

 

Use Pi instead of pi.

Thank you all for your help, that was useful.

The original question in the math forum referred to all integer solutions. I didn't give a link to it, because it is not in English.
Interestingly, in Mathematica the Reduce command gives all the possible a,b,c,d values explicitly. It would be useful if solve or isolve could handle these problems.
 

 


I don't know there is a pause command or something similar in Maple, but you can write an own procedure for this purpose using the time() command for example as follows:
 

pause:=proc(sec::nonnegative)
   local a,i:# pause in secundum
   a:=time():
   for i  do: if time()>=a+sec then return;end if: end do:
end proc;

For example if you want to set  0.5 secundum pause:  pause(0.5).


Thanks for the comments.
I tried Acer's  suggestion, it works ok,



I am not sure what your problem with the integral is: it is not correct if you typed simple e or pi instead of exp()  and Pi , and I also recommend you to type always the multiplication sign * before of after the open or close bracket () , when you mean multiplication.

1 2 3 4 5 Page 3 of 5