DJJerome1976

540 Reputation

12 Badges

18 years, 107 days

MaplePrimes Activity


These are questions asked by DJJerome1976

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]]):

I am using the ColumnSpace command (from the LinearAlgebra package) to generate a basis for the column space of a matrix. Is there any way to "force" the command to express the basis in terms of columns of A and not in the canonical form with leading 1's?

For example, for

A:=Matrix([[-3,6,-1,1-7],[1,-2,2,3,-1],[2,-4,5,8,-4]]):

I would like to obtain the following basis for the column space:

{[-3,1,2],[-1,2,5]}

 

I've been playing around with the Basis command in the LinearAlgebra package. It's very easy to get a Basis for any subspace of R^n. However, if you're dealing with finite-dimensional polynomial or matrix spaces, the Basis command doesn't work. Due to some basic isomorphism theorems, we can always associate these vectors with those in R^n. I was wondering if there is a way to get Maple, via the Basis command, to handle "other types" of vectors. For example, how might one get Maple to return a basis of {x^2+x+4,x+3,2x^2-x-5,5x^2+x-7} in P_2, the space of polynomials of degree less than or equal to 2, or, a basis for {[[2,3],[5,6]],[[3,2],[0,1]],[[1,1],[0,5]]} in M_{2,2}, the space of 2 x 2 matrices, without converting to R^n?

First 8 9 10 11 12 13 14 Page 10 of 16