Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

In addition to the ways pointed out by Robert Lopez, here are four other methods to calculate the dot product without complex conjugation:

  1.  LinearAlgebra:-DotProduct(<a,b>, <c,d>, conjugate=false);
  2. LinearAlgebra:-DotProduct(<a,b>, <c,d>) assuming real;
  3. <a,b>^%T . <c,d>;
  4. <a,b>^+ . <c,d>;

My preferred method is #4 since it requires the least amount of typing.

 

@Earl If all you want is the final graphics that you have shown in your worksheet, then it can be done through a direct evaluation of parameter ranges.  This produces better-looking graphics, without the need for "cheating" with a hi-res grid.

Here are the details: mw2.mw
Edit: removed a couple of lines of unused code from an earlier version

restart;

with(LinearAlgebra):

Example 1: We have two equations in three unknowns:

eqns :=
   1*x + 2*y + 3*z = 4,
   5*x + 6*y + 7*z = 8;

x+2*y+3*z = 4, 5*x+6*y+7*z = 8

The augmented matrix of our system of equations:

M := GenerateMatrix({eqns}, {x,y,z}, augmented);

_rtable[18446884503773816462]

Here is the solution, expressed as the parametric equations of a line in 3D:

<x, y, z> =~ LinearSolve(M, free=t);

_rtable[18446884503773811046]

Example 2:  The equations are expressed as Ax=B, where A is an `&x`(m, n) matrix and

and B is an m-vector:

m, n := 3, 5;

3, 5

A := RandomMatrix(m,n);

_rtable[18446884503773806830]

B := RandomVector(m);

_rtable[18446884503773809230]

The augmented matrix:

M := < A | B >;

_rtable[18446884503773810190]

Here is the solution -- an afine manifold in R^n:

<(x[i] $i=1..n)> =~ LinearSolve(M, free=t);

_rtable[18446884503773805494]

Are you sure that's Maple?  To me it looks like a mupad notebook.

How do I know that?

Rename Bugged.mw to Bugged.mw.zip , unzip it, then examine the contents.

 

 

 

  • You don't need Maple to see that { θ(r,z) ≡ 0 and σ(r,z)  ≡ 0 } is the solution of your equations. Perhaps you meant something else?
  • Although you label your equations as PDEs, they are not PDEs.  They are ODEs because they involve derivatives with respect to r only.
  • As to Maple's error message, you need to change
    pdsolve(PDE1, PDE2, IBC, numeric);
    to
    pdsolve({PDE1, PDE2}, IBC, numeric);
    but that's not really needed if all you have are ODEs.

 

Your ibc consist of three boundary conditions but no initial condition.  You don't mean that, do you?  In the following I will ignore the first of the three conditions. It turns out at the end that the first conditions is implied by the other two.

restart;

pde := diff(u(x,t),t) = diff(u(x,t),x,x);

diff(u(x, t), t) = diff(diff(u(x, t), x), x)

Let's try solving with the help of PDEtools:

sols := PDEtools:-SimilaritySolutions(pde) assuming t>0, x::real;

u(x, t) = _C1, u(x, t) = _C1*x+_C2, u(x, t) = _C1/(t^(1/2)*exp((1/4)*x^2/t)), u(x, t) = _C1+erf((1/2)*abs(x)/t^(1/2))*_C2, u(x, t) = (_C1*x+_C2*t)/(t^(3/2)*(1/x)^(1/2)*exp((1/4)*x^2/t)*x^(1/2))

We are presented with five options:

nops([sols]);

5

The fourth option looks promising:

sols[4];

u(x, t) = _C1+erf((1/2)*abs(x)/t^(1/2))*_C2

Unfortunately that is not correct.  The absolute value sign should not be there.

I have reported this to Maple Support as a bug.  The correct solution is:

sol := u(x,t) = A + B*erf(x/(2*sqrt(t)));

u(x, t) = A+B*erf((1/2)*x/t^(1/2))

We determine A and B by applying the boundary conditions at infinity:

conds := {
    c[1] = limit(rhs(sol), x=-infinity),
    c[2] = limit(rhs(sol), x=+infinity) } assuming t>0;

{c[1] = A-B, c[2] = A+B}

Solve for A and B

ans := solve(conds, {A, B});

{A = (1/2)*c[1]+(1/2)*c[2], B = (1/2)*c[2]-(1/2)*c[1]}

Plug A and B into the solution:

eval(sol, ans);

u(x, t) = (1/2)*c[1]+(1/2)*c[2]+((1/2)*c[2]-(1/2)*c[1])*erf((1/2)*x/t^(1/2))

 

 

The argument of the complexplot is malformed.  Here is the corrected version.

restart;
with(plots):
z := polar(1.05, (1/10)*Pi);
p1 := polarplot(1, color = grey, axis[radial] = [color = "Blue"]):
p2 := complexplot([seq(evalc(z)^n, n = 1..21)],
    style=point, symbol=solidcircle, symbolsize=15, color=red):
display([p1,p2], scaling=constrained);

 

Here is a rush answer to a rush question I don't expect it to make much sense to you if this is your first contact with Maple.

restart;
G := (y,v) -> [v, g/H*(mu__B + mu__C - sqrt(1 + v^2))];    # v stands for dy/dx
de := diff~([y(x), v(x)], x)[] = G(y(x),v(x))[];
ic := y(0)=0, v(0)=0;
params := g=1, H=1, mu__B=1, mu__C=1;
sys := eval([de,ic], [params]);
dsol := dsolve(sys, numeric, method=rkf45);
plots:-odeplot(dsol, [[x,y(x)],[x,v(x)]], x=0..5);

 

Here are my thoughts regarding your questions.

  • If you live in the US, you may consider taking a remedial math course in your local community college.  These don't cost very much, and I think will be more effective than trying to learn the material on your own.  Having a teacher and classmates whom you can talk to can be very helpful.
  • I don't know of a product that you can buy to test your mathematical ability, but most universities administer a Math Placement Test to entering students to determine their level of mathematical preparation, and then recommend a suitable course within the mathematical hierarchy to begin one's education.
  • You should give some thought as to your reasons for wanting to take a college algebra course.  If it is for the sake of learning some new material, that's fine.  But if you do that as a stepping stone toward a further goal, you should really talk to someone who knows about such matters and seek expert advice before you invest your time, money, and effort toward that goal.

 

@das1404 Kitonum has already answered your question for pyramids with triangular and square bases. The worksheet pyramid.mw shows how to construct and plot pyramids having n-gons for their bases and the altitudes of whose lateral faces are given.  See if it is of use to you.

 

restart;

ode := diff(y(x), x, x)-exp(y(x))+2 = 0;

diff(diff(y(x), x), x)-exp(y(x))+2 = 0

 

dsolve({ode, y(0) = a, (D(y))(0) = b}, y(x), series);

y(x) = series(a+b*x+(-1+(1/2)*exp(a))*x^2+((1/6)*exp(a)*b)*x^3+(-(1/12)*exp(a)+(1/24)*(exp(a))^2+(1/24)*exp(a)*b^2)*x^4+((1/120)*exp(a)*b*(b^2+4*exp(a)-6))*x^5+O(x^6),x,6)

 

Download mw.mw

Do you really need symbolic manipulation capabilities in your research on hyperbolic systems?  To my knowledge, the bulk of computing in that area involves a lot of number crunching but no serious use of symbolic computations.

If that's the case, then the choice between Maple and Mathematica is immaterial.  You may also consider Matlab, or write programs in C or Fortran.  Compilers for C and Fortran are available for free so that choice will cost you $0.

Ultimately the key deciding factor would be which of these languages you feel more comfortable with, and the level of support that you can reasonably expect to receive from its user community.

 

 

@das1404 The mathematical definitions a circle and a disk of radius R centered at the origin in the usual Cartesian x-y coordinate system are:

circle    { (x,y) : x2 + y2 = R2 }

disk      { (x,y) : x2 + y2 ≤ R2 }

Maple uses the terms terms "circle" and "disk" according to these standard mathematical definitions.  These should not be confused with the ordinary "street" use of those terms.

The filled versus outline drawings of the plottools objects are controlled through the options style=surface and surface=line.  Try the following to see:

restart;
with(plots): with(plottools):
display(disk([0,0], 1, color=yellow));
display(disk([0,0], 1, color=yellow, style=surface));
display(disk([0,0], 1, color=yellow, style=line));
display([
  disk([0,0], 1, color=red, style=line, thickness=3),
  disk([0,0], 1, color=yellow, style=surface)
]);

Also try the corresponding constructions with circle and rectangle.

PS: I can't tell whether these will have the intended results on Maple 7. They certainly work on the more recent versions of Maple.

 

restart;

with(VectorCalculus):

F := VectorField(<x,y,z>, coords=cartesian[x,y,z]):

cyl := Surface( <2,phi,z>, phi=0..2*Pi, z=-3..3,
    coords=cylindrical[r, phi, z]):

top := Surface( <r*cos(t), r*sin(t),  3>,
    r=0..2, t=0..2*Pi, coords=cartesian[x,y,z]):

Important!  In the definition of bot below, note the reversal of the order of appearance

of t=... and r=... relative to those in top.  That makes the normal vectors of

top and bot point in opposite directions.

Alternatively, we may keep the order the same, but reverse the sign of the flux

calculated on the cylinder's bottom.

bot := Surface( <r*cos(t), r*sin(t), -3>,
    t=0..2*Pi, r=0..2, coords=cartesian[x,y,z]):

Individual fluxes:

Flux(F, cyl);

48*Pi

 

Flux(F, top);

12*Pi

 

Flux(F, bot);

12*Pi

 

Total flux:

Flux(F, cyl) + Flux(F, top) + Flux(F, bot);

72*Pi

 
 

 

The maximum length of 67.66 cm calculated by vv and kitonum is much too small considering that one side of the box is 118 cm long.  That's because the assumption (given in the problem's statement) that the cylinder's axis coincides with the box's diagonal is not good.  If we calculate without that assumption, we arrive at a maximum length of 118.84 cm which makes better sense.  That means that the rolled carpet of length 120 cm is just a bit too long to squeeze in, but perhaps if you give it a little push it may work ;-)

Here is a picture of the box and the longest carpet:

Worksheet: cylinder-in-a-box.mw

First 34 35 36 37 38 39 40 Last Page 36 of 53