Robert Israel

6577 Reputation

21 Badges

18 years, 217 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

I suspect you are using Document mode, and "Display output from Evaluate (Document Blocks)" is turned off.  From the Tools menu, choose Options..., Display, and click to put a check mark in the box for this, then "Apply Globally".

Alternatively, use Worksheet mode.

I suspect you are using Document mode, and "Display output from Evaluate (Document Blocks)" is turned off.  From the Tools menu, choose Options..., Display, and click to put a check mark in the box for this, then "Apply Globally".

Alternatively, use Worksheet mode.

For the cubic x^3 + a x + b (with a and b real), there is one real root if the discriminant -4 a^3 - 27 b^2 < 0.  There are three if the discriminant > 0.

The solutions will be x = u - a/(3*u) where t=u^3 is a solution of  t^2 + b*t - a^3/27 = 0.  In the first case that quadratic has real roots, so for the real solution we can use the real cube root of t.  Thus for example:

> p:= x^3 + 15*x - 4; 
  a:= 15; b:= -4;
  q:= t^2 + b*t - a^3/27;
  solve(q, t);

2+sqrt(129) , 2-sqrt(129)

> u := %[1]^(1/3);
  r:= u - a/(3*u);

r := (2+129^(1/2))^(1/3)-5/(2+129^(1/2))^(1/3)

For the second case, we must take the cube root of a non-real complex number.  There's no way around that: in general the roots of your cubic can't be expressed in real radicals.

For the cubic x^3 + a x + b (with a and b real), there is one real root if the discriminant -4 a^3 - 27 b^2 < 0.  There are three if the discriminant > 0.

The solutions will be x = u - a/(3*u) where t=u^3 is a solution of  t^2 + b*t - a^3/27 = 0.  In the first case that quadratic has real roots, so for the real solution we can use the real cube root of t.  Thus for example:

> p:= x^3 + 15*x - 4; 
  a:= 15; b:= -4;
  q:= t^2 + b*t - a^3/27;
  solve(q, t);

2+sqrt(129) , 2-sqrt(129)

> u := %[1]^(1/3);
  r:= u - a/(3*u);

r := (2+129^(1/2))^(1/3)-5/(2+129^(1/2))^(1/3)

For the second case, we must take the cube root of a non-real complex number.  There's no way around that: in general the roots of your cubic can't be expressed in real radicals.

You can do it with the annuity command and solve, as follows:

> with(finance):
  solve(annuity(c, .019/12, 48) = 21000, c);
   

                 454.6817498

You can do it with the annuity command and solve, as follows:

> with(finance):
  solve(annuity(c, .019/12, 48) = 21000, c);
   

                 454.6817498

I suspect the code is something like this:

> for i from 1 to 3 do for j from 1 to 3 do M(i,j):= i+j od od;

(but in 2D math, with typesetting level Extended, and "Allow shortcut function definition" set to Query).

 

I suspect the code is something like this:

> for i from 1 to 3 do for j from 1 to 3 do M(i,j):= i+j od od;

(but in 2D math, with typesetting level Extended, and "Allow shortcut function definition" set to Query).

 

1D input looks like this (in Maple 12, Standard GUI):

4541_1Dinput.gif

2D input looks like this:

4541_2Dinp.gif

You can also switch from one to the other: at an input prompt, press Ctrl-M (i.e. the Ctrl key and the M key at the same time) for 1D input, or Ctrl-R for 2D input.

1D input looks like this (in Maple 12, Standard GUI):

4541_1Dinput.gif

2D input looks like this:

4541_2Dinp.gif

You can also switch from one to the other: at an input prompt, press Ctrl-M (i.e. the Ctrl key and the M key at the same time) for 1D input, or Ctrl-R for 2D input.

> simplify(-1/6*q^2*(p^3*(-ln(-q*p)+ln(-p*(2-p)^2*q/(-2+p)^2))+p*ln((2-p)^24/(-2+p)^24)+
           p^2*ln((-2+p)^12/(2-p)^12)+ln(1/(2-p)^16*(-2+p)^16))) 
   assuming p>0,p<1,q>0,q<1;

                  0
> simplify(-1/6*q^2*(p^3*(-ln(-q*p)+ln(-p*(2-p)^2*q/(-2+p)^2))+p*ln((2-p)^24/(-2+p)^24)+
           p^2*ln((-2+p)^12/(2-p)^12)+ln(1/(2-p)^16*(-2+p)^16))) 
   assuming p>0,p<1,q>0,q<1;

                  0

It's not recommended that the user mess about with PLOT structures when the same effect can easily be produced with standard plot commands.
In this case:

> plot([seq([t[i],y[i]],i=0..200)], colour=cyan, thickness=2);

 

It's not recommended that the user mess about with PLOT structures when the same effect can easily be produced with standard plot commands.
In this case:

> plot([seq([t[i],y[i]],i=0..200)], colour=cyan, thickness=2);

 

That would work in Maple 12.  You must be using an earlier version of Maple.  Try this:

> ode := {diff(y(t), t) = -3*y(t), y(0) = 2};
  soln := dsolve(ode, y(t), numeric, method = classical[foreuler], stepsize = .2);
  soln(0.2);
  plots[odeplot](soln,[t,y(t)],0 .. 5, numpoints = 25, style=point);

Note that I used the numpoints option here, otherwise odeplot would in effect use a smaller step size to get a smoother curve.

First 105 106 107 108 109 110 111 Last Page 107 of 187