DJJerome1976

380 Reputation

12 Badges

12 years, 150 days

MaplePrimes Activity


These are questions asked by DJJerome1976

I am using the following commands to create an animation of a simple cardioid being traced out. I would like to add to this an animation of the filling of the region bounded by the curve and the coordinate axes as the curve is being traced out. How might one achieve this?

with(plots):

animatecurve([2-2*sin(theta),theta,theta=0.. 2*Pi],coords=polar,axiscoordinates=polar,frames=250, numpoints=300, scaling=constrained)

Thanks.

I would like to express 2*sin(x+Pi/4) in the form sqrt(2)*sin(x)+sqrt(2)*cos(x). I've tried many variations using simplify/expand/combine/etc. to no avail. Any ideas?

I am playing around with a crude implementation of the bisection algorithm. I am using printf  to display some of the output, however there are a couple extra characters, namely, ()^2, at the end. When the very last line is removed, it goes away. What is causing this?

restart; f := proc (x) options operator, arrow; evalf(x^3-3*x^2+1) end proc; a := 0.; b := 1.0; count := 0; while abs(b-a) > 10^(-8) do count := 1+count; m := (a+b)*(1/2); print([a, m, b]); if f(a)*f(m) < 0 then b := m else a := m end if end do; fval := f(m); printf("\n The function value at %10.10g is %10.10g.\n", m, fval)*printf("\n Number of interations: %d.\n", count)

()^2

(1)

restart; f := proc (x) options operator, arrow; evalf(x^3-3*x^2+1) end proc; a := 0.; b := 1.0; count := 0; while abs(b-a) > 10^(-8) do count := 1+count; m := (a+b)*(1/2); print([a, m, b]); if f(a)*f(m) < 0 then b := m else a := m end if end do; fval := f(m); printf("\n The function value at %10.10g is %10.10g.\n", m, fval)


 The function value at 0.6527036502 is   -1.5e-08.

 

``


Download bisect.mw

The following integral is solved easily via a substitution. Why does Maple not evaluate it?


int(tan(x)^(1/3)*sec(x)^2, x)

int(tan(x)^(1/3)*sec(x)^2, x)

(1)

int(surd(tan(x), 3)*sec(x)^2, x)

int(surd(tan(x), 3)*sec(x)^2, x)

(2)

``


Download intsub.mw

I would like to define a graph in terms of its incidence matrix. It's very easy to go from the graph to the incidence matrix, but is it possible to go the other way? Here is the incidence matrix of interest:

M:=Matrix([[1,1,0,1,0,0,0],[0,1,1,0,1,0,0],[1,0,1,0,0,1,1],[0,0,0,1,1,1,0],[0,0,0,0,0,0,1]]):

2 3 4 5 6 7 8 Page 4 of 11