acer

32328 Reputation

29 Badges

19 years, 318 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

How do you feel about t=0 ?

The odeplot command makes it easy to specify what goes on which axis.

restart;

ode := diff(x(t), t) = 16250.25391*(1 - (487*x(t))/168 + 4*Pi*x(t)^(3/2) + (274229*x(t)^2)/72576 - (254*Pi*x(t)^(5/2))/21 + (119.6109573 - (856*ln(16*x(t)))/105)*x(t)^3 + (30295*Pi*x(t)^(7/2))/1728 + (7.617741607 - 23.53000000*ln(x(t)))*x(t)^4 + (535.2001594 - 102.446*ln(x(t)))*x(t)^(9/2) + (413.8828821 + 323.5521650*ln(x(t)))*x(t)^5 + (1533.899179 - 390.2690000*ln(x(t)))*x(t)^(11/2) + (2082.250556 + 423.6762500*ln(x(t)) + 33.2307*ln(x(t)^2))*x(t)^6)*x(t)^5:

ics := x(0) = xlow:

sol := dsolve({ics, ode}, numeric, parameters=[xlow], method=rosenbrock):
sol(parameters=[xlow=8e-2]):

sol(1);

Error, (in sol) cannot evaluate the solution further right of .30133640, probably a singularity

sol(last);
tmax := eval(t,%);

[t = HFloat(0.3013364074642204), x(t) = HFloat(2.3363766640055337)]

HFloat(0.3013364074642204)

plots:-odeplot(sol, [[t,x(t)],[x(t),t]], 0 .. tmax,
               color=[red,blue], view=[0..0.5,0..0.5]);

plots:-odeplot(sol, [x(t),t], 0 .. tmax,
               color=[blue], view=[0..0.5,0..0.5]);

 

Download odeplot_v.mw

A small modification of your code gets you the following. Is it something like your goal?

You could easily make it a procedure.

restart;

with(LinearAlgebra):

A := Matrix([[2, 3, -4], [0, -4, 2], [1, -1, 5]]);

Matrix(3, 3, {(1, 1) = 2, (1, 2) = 3, (1, 3) = -4, (2, 1) = 0, (2, 2) = -4, (2, 3) = 2, (3, 1) = 1, (3, 2) = -1, (3, 3) = 5})

Ad := Matrix(3,3):
for i to 3 do for j to 3 do
  Ad[j,i] := (-1)^(i+j)*Minor(A, i, j);
end do end do:
Ad;

Matrix(3, 3, {(1, 1) = -18, (1, 2) = -11, (1, 3) = -10, (2, 1) = 2, (2, 2) = 14, (2, 3) = -4, (3, 1) = 4, (3, 2) = 5, (3, 3) = -8})

Adjoint(A);

Matrix(3, 3, {(1, 1) = -18, (1, 2) = -11, (1, 3) = -10, (2, 1) = 2, (2, 2) = 14, (2, 3) = -4, (3, 1) = 4, (3, 2) = 5, (3, 3) = -8})

Download adjoint.mw

restart;

ee := cos( sqrt(Lr1+Lr2)*t/(sqrt(Cr)*sqrt(Lr1)*sqrt(Lr2)));

cos((Lr1+Lr2)^(1/2)*t/(Cr^(1/2)*Lr1^(1/2)*Lr2^(1/2)))

combine(ee,radical,symbolic);

cos(t*((Lr1+Lr2)/(Cr*Lr1*Lr2))^(1/2))

combine(ee) assuming Lr1<0, Lr2<0, Cr<0:
normal(%);

cos(t*((Lr1+Lr2)/(Cr*Lr1*Lr2))^(1/2))

combine(ee) assuming Lr1>0, Lr2>0, Cr>0;

cos(t*((Lr1+Lr2)/(Cr*Lr1*Lr2))^(1/2))

 

Download rad_combine.mw

I have not utilized the cosine property cos(-z)=cos(z) however.

You can represent this operation with a call to %.  as an inert noncommutative multiplicaion.

The dot symbol renders in gray by default, but you can also use InertForm:-Display to render it in black.

The value command is one mechanism (of several) that turns it into an active computation.

restart;

A:=Matrix([[1,2,3],[4,5,6],[7,8,9]]):
b:=Vector([1,2,3]):
X:=Vector([x,y,z]):

eq := A %. X = b:

eq;

`%.`(Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 4, (2, 2) = 5, (2, 3) = 6, (3, 1) = 7, (3, 2) = 8, (3, 3) = 9}), Vector(3, {(1) = x, (2) = y, (3) = z})) = (Vector(3, {(1) = 1, (2) = 2, (3) = 3}))

InertForm:-Display(eq, inert=false);

`?` = (Vector(3, {(1) = 1, (2) = 2, (3) = 3}))

value(eq);

(Vector(3, {(1) = x+2*y+3*z, (2) = 4*x+5*y+6*z, (3) = 7*x+8*y+9*z})) = (Vector(3, {(1) = 1, (2) = 2, (3) = 3}))

Download inertmatmul.mw

[edit] Changed to an infix call, see comments below.

simplify(eval([y,z],aa[1])-eval([y,z],bb[2]))
   assuming alpha[1,8]>0;

                [0, 0]

radnormal(eval([y,z],aa[1])-eval([y,z],bb[2]))
   assuming alpha[1,8]>0;

                [0, 0]

I do not recommend in general your original approach of comparing a pair of simplify results using evalb, ie. testing whether they are the identical same structure. In general there may not be a definitive normal form, and so it is an unnecessarily weakened test -- despite the fact that it succeeds in this example involving radicals.

Under the assumption used above,

# I don't much like this first one, even if
# it works for your polynomial solutions.
evalb(simplify(aa[1,1])=simplify(bb[2,1]))
   assuming alpha[1,8]>0;

                true

# I'd prefer a check more like this.
is(simplify(aa[1,1]-bb[2,1]))
   assuming alpha[1,8]>0;

                true

# Alternatively,
is(simplify(eval(y,aa[1])-eval(y,bb[2]))=0)
   assuming alpha[1,8]>0;

                true

You didn't state what you wanted the titles to be.

restart;

dim:=3:
flat:=(j - 1 + dim*(i - 1))+1;

pltopts:=color=blue,size=[250,250],tickmarks=[0,0]:
s:=[seq(
    [seq(plot(diff(x^9,[x$(flat)]),pltopts,
              title=typeset(InertForm:-Display(%diff(x^9,[x$(flat)]),
                                               inert=false)
                            = diff(x^9,[x$(flat)])),
              titlefont=["Times",10]
       )
    ,j=1..dim)],
i=1..dim)]:
A:=Array(1..dim,1..dim,s):

j+3*i-3

plots:-display(A)

 

 

 

 

 

``

Download QuestionTabulation_ac.mw

Put both in one more call to plots:-display.

You have mistmatched brackets in the expression assigned to wres.

You forgot the colon in the colon-minus ( := ) in the line that seems to define z3. As you have it, that line is just an equation, rather than as assignment.

You used lowercase pi when perhaps you intended the popular constant Pi which is capitalized in Maple.

From the Help page (Maple 18) for the Compiler,
   "Arrays can only appear as parameters of a procedure that is to be compiled."

In other words, you can construct your Array outside of the procedure, and pass it in as an argument. You shouldn't be able to assign an Array to a local variable within the compiled procedure. (The same should go for Vector and Matrix.)

You may have already noticed that you can drag the borders of the inlined plotting window to re-size (or set that size in modern Maple). You can right-click on the plot and change the Manipulator so as to zoom in/out or pan. This is all manual work, done using the mouse-pointer -- and some may have to be re-done if you re-execute.

So you might also wonder whether it can be done programmatically, so that you don't need to repeat manual mouse-work. See below.

You can use the commands Layout:-InlinePlot and Components:-Plot from the DocumentTools package to embed a 3D plot where you programmatically specify any offset (pan) or scaling factor (zoom).

The is just rendering, in effect. The result from the plot3d call is generated just the same (and doesn't itself contain the zoom and pan information), and gets used as one of the arguments to those commands.

The embedding is done using the InsertContent command. You can encapsulate it within a borderless GUI Table, so that the end result looks very much the same as a regularly displayed plot.

There are examples on the Help pages.

The Components:-Plot command's last example involves an animation where the the axes are oblong (long and narrow), and the idea there is that -- if you don't want to rotate it -- extra white space can be avoided. (That example may not show the effect in the actual Help page, but you can run it to see what I mean.)

Unfortunately the pan and zoom levels are not Properties of a PlotComponent, and so cannot be set using SetProperty as far as I know. But the commands I mentioned earlier can get you a way to accomplish it all programmatically.

You need to enter your procedure in just one single Document Block (or Execution Group).

From your image it appears that you've accidentally split it across two blocks, instead. You may have inadvertantly type the Enter/Return key too soon.

You can move to a new line (while typing code) using Ctl-Enter (possibly Cmd-Enter on Mac OSX), instead of Enter.

You can upload and attach a worksheet to this site using the Green up-arrow in the Mapleprimes editor. You don't have to paste it in.

The solve command has a relevant (and documented) option that can help for this example.

restart;

solve({x^2-x-2=0},x) assuming x>0;

{x = 2}, {x = -1}

solve({x^2-x-2=0},x,useassumptions) assuming x>0;

{x = 2}

 

Download solve_assumptions.mw

Here is the answer to your question about how MESH behaves (when the PLOT3D structure is printed):

The Array within a MESH substructure has to have datatype=float[8].

Invert_Torus_ac.mw

Try entering it as,

    'layout'=':-interactive'

The apostrophes (single right-quotes) protect againgst evaluation (in case you'd assigned values to the names).

The key thing is the colon-minus, where :-interactive references the original global name and not that of the export of the plots package. When you load the plots package you rebind the name.

First 103 104 105 106 107 108 109 Last Page 105 of 336