zenterix

350 Reputation

4 Badges

2 years, 230 days

MaplePrimes Activity


These are questions asked by zenterix

If we use, for example, pointplot3d with an mx3 matrix we get a 3d plot. I can click on the plot and choose the lighting. But how do we do that with code?

I just tried to solve a very simple system of equations using solve but depending on how I write the system the command does out give any output. 

restart

solve({I__cm = m*r^2, r*T = I__cm*a/r, g*m-T = m*a}, {T, a})

solve({r*T = m*r^2*a*(1/r), g*m-T = m*a}, {T, a})

{T = (1/2)*m*g, a = (1/2)*g}

(1)

NULL

Solution with pencil and paper

T := (1/2)*m*g = (1/2)*m*gNULL

a := (1/2)*g = (1/2)*gNULL

Check this solution

evalb(g*m-T = m*a)

true

(2)

evalb(r*T = m*r^2*a*(1/r))

true

(3)

NULL


Notice that if I define I__cm then there is no solution being shown. I can rename I__cm to something else like y, still no output. Then in the second system I simply sub I__cm into the equation that has this variable, and it works.

So what's going on here? Why doesn't the first use of solve work?

Download solveSys.mw

When taking notes I sometimes use the palette to insert a matrix into a worksheet. When I do this, the main aspect that is useful to me is being able to visualize matrix expressions as I would write them.

I would like to do the same but for determinants of matrices. Is there a way to get almost the same thing as with the matrix palette, but with vertical bars denoting a determinant rather than the brackets used for matrices?

How do we compute integrals of functions or expressions that have units attached?
For example

v__1 := proc (t) options operator, arrow; 3*Unit('m'/'s') end proc

proc (t) options operator, arrow; 3*Unit('m'/'s') end proc

(1)

v__2 := 4*Unit('m'/'s')

4*Units:-Unit(m/s)

(2)

s__1 := int(v__1(t), t = 0 .. 5)

15*Units:-Unit(m/s)

(3)

s__2 := int(v__2, t = 0 .. 5)

20*Units:-Unit(m/s)

(4)

NULL


The results of the integrals have the wrong units.

Download integration_with_units.mw

Let's say we have four equations and four unknowns and we use solve to find a solution.

The return value of solve is a set.

Here is an example

solve({T__1 = m__1*a, a = R*alpha, -R*T__1+R*T__2 = I__s*a/R, g*m__2-T__2 = m__2*a}, {T__1, T__2, a, alpha})

{T__1 = R^2*g*m__2*m__1/(R^2*m__1+R^2*m__2+I__s), T__2 = m__2*g*(R^2*m__1+I__s)/(R^2*m__1+R^2*m__2+I__s), a = R^2*g*m__2/(R^2*m__1+R^2*m__2+I__s), alpha = R*g*m__2/(R^2*m__1+R^2*m__2+I__s)}

(1)

NULL


If we want to make the four expressions above procedures, the manual way is to basically copy the right-hand side of each expression and then write

T__1 := (R,m__1, m__2, g, I__s) -> ...

T__2 := (R,m__1, m__2, g, I__s) -> ...

a := (R,m__1, m__2, g, I__s) -> ...

alpha := (R,m__1, m__2, g, I__s) -> ...

Is there a way to do this automatically from the return value of solve?

If the return value were a list, I would use something like

T__1 := unapply(result[1], R, m__1, m__2, g, I__s)

T__2 := unapply(result[2], R, m__1, m__2, g, I__s)

a := unapply(result[3], R, m__1, m__2, g, I__s)

alpha := unapply(result[4], R, m__1, m__2, g, I__s)

But the return value is not a list.

So, in summary my quesions are

1) what, in general, is the best way to obtain the desired procedures?

2) is there a way to use the strategy I suggested if the result were a list, but for sets?

Download solveEqs.mw

5 6 7 8 9 10 11 Last Page 7 of 18