Preben Alsholm

13743 Reputation

22 Badges

20 years, 332 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

No problem with your last attempt except of course if i doesn't have a numerical value, or if k does have a numerical value.

Example.

restart;
i:=5:
for j to i do c[j]:=plot(x^j,x=0..1) end do:
plots:-display(c[k]$k=1..i);

#Since j has a numerical value (in this case 6) you need unevaluation quotes as shown below, therefore the use of seq in place of $ (as suggested by Clare So) is in general better.
plots:-display('c[j]'$'j'=1..i);

The elementwise operation ~ used in Robert Israel's answer was introduced in Maple 13. You can use map instead.

plots[display](map(plottools[scale],{p1,p2,p3},1/(2*Pi*sqrt(2)),1),
            labels=[x/(2*Pi*'sqrt(2)'),h]);

The elementwise operation ~ used in Robert Israel's answer was introduced in Maple 13. You can use map instead.

plots[display](map(plottools[scale],{p1,p2,p3},1/(2*Pi*sqrt(2)),1),
            labels=[x/(2*Pi*'sqrt(2)'),h]);

Why do you want a perfect echo of the input?

In some cases I see the point. As an example it may be a good idea to assign a differential equation to a variable and ending the assignment with a semicolon so the output is seen. This can prevent attempts to solve the wrong equation.

The purpose of seeing an echo of (5*x+4)/(3*x)=7 could be to catch an error like writing (5*x+4)/3*x=7. If that is the problem you could use 2D input, which I personally never do, however.

Why do you want a perfect echo of the input?

In some cases I see the point. As an example it may be a good idea to assign a differential equation to a variable and ending the assignment with a semicolon so the output is seen. This can prevent attempts to solve the wrong equation.

The purpose of seeing an echo of (5*x+4)/(3*x)=7 could be to catch an error like writing (5*x+4)/3*x=7. If that is the problem you could use 2D input, which I personally never do, however.

@Markiyan Hirnyk I said that the discriminant is 8*l^2 and that the roots are correct, and indeed they are, since (when l is real) {l,-l} and {abs(l),-abs(l)} are the same sets.

Maple's answer to the roots has the advantage that it is correct even if l is not real.

 

@Markiyan Hirnyk I said that the discriminant is 8*l^2 and that the roots are correct, and indeed they are, since (when l is real) {l,-l} and {abs(l),-abs(l)} are the same sets.

Maple's answer to the roots has the advantage that it is correct even if l is not real.

 

The discriminant of the polynomial:

pol:=(2+l^2-4*l)*n^2-(4-4*l)*n+2;
discrim(pol,n);
                                 2
                              8 l
and the roots of pol are correct.


The discriminant of the polynomial:

pol:=(2+l^2-4*l)*n^2-(4-4*l)*n+2;
discrim(pol,n);
                                 2
                              8 l
and the roots of pol are correct.


Did you mean

ode1:=(1/r^2)*diff(r^2*diff(u(r,t),r),r) =v(r,t);

ode2:= diff(v(r,t),t)=u(r,t);

IBC:={u(0.2,t)=1,u(0,t)=0.5,v(r,0)=0.01};

?



 

@shinelookat You can use odeplot like this,

plots:-odeplot(sol1,[x(t),y(t),z(t)],0..10,axes=boxed,thickness=3);

Animating the orbit can be done by asking for a number of frames as in

plots:-odeplot(sol1,[x(t),y(t),z(t)],0..10,axes=boxed,thickness=3,frames=50);

@shinelookat You can use odeplot like this,

plots:-odeplot(sol1,[x(t),y(t),z(t)],0..10,axes=boxed,thickness=3);

Animating the orbit can be done by asking for a number of frames as in

plots:-odeplot(sol1,[x(t),y(t),z(t)],0..10,axes=boxed,thickness=3,frames=50);

@Vaclav 

If you try

g:=sum((-p)^n*n/(factorial(k-n)*factorial(n)), n = 1 .. k);

you will see that p=1 is an exceptional case. It could be handled by taking a limit:

limit(g,p=1) assuming k::posint;

but notice that you get the generic result (not valid for k = 1) as mentioned earlier.

@Vaclav 

If you try

g:=sum((-p)^n*n/(factorial(k-n)*factorial(n)), n = 1 .. k);

you will see that p=1 is an exceptional case. It could be handled by taking a limit:

limit(g,p=1) assuming k::posint;

but notice that you get the generic result (not valid for k = 1) as mentioned earlier.

@mehrdadparsapour 

You also need to use D instead of diff in the IBC, e.g.

D[1,1](u[2])(L,t)=0 for the condition that the second derivative w.r.t. the first variable (i.e. x) of u[2] at x=L be zero for all times t.

First 206 207 208 209 210 211 212 Last Page 208 of 231