Scott03

784 Reputation

10 Badges

19 years, 185 days

MaplePrimes Activity


These are answers submitted by Scott03

To get the first part you should be able to do something like the following:

MyRand := rand(10):
A := Vector(100, fill = 0):
for i from 2 to 100 do A[i] := A[i-1]+MyRand(): end do:

Now to plot these points you can use this command

Statistics:-PointPlot(A);

 

Scott
Application Developer
Maplesoft
 

Was there a typo in the ssystem call that you did above?

Did you mean something like

ssystem("gedit /Documents/ZipLinux/Maple13/license/Activation.txt");

Also, make sure that the file is in the location that you typed.  If there isn't anything there, then your edit program will likely open a blank document thinking that you are wanting to create a new document in that location.

Scott
Application Developer
Maplesoft

You can also change the command that Robert had suggested to

 ssystem("c:/windows/notepad.exe");

Looking at the help page, the system[launch] command is likely that what you want if you want to be able to pass other arguements to the process.

Scott
Application Developer
Maplesoft

You really don't need to do this with a procedure.  If you want to do this by creating a list, you would need to do something like the following

n:=3:
L:=[seq((i*b+a*(n-i))/n,i=1..n)];
                L := [(1/3)*b+(2/3)*a, (2/3)*b+(1/3)*a, b]

If you really want to create a procedure, you can just wrap the above into a procedure like the following

MyProc:=proc(MyN)
[seq((i*b+a*(MyN-i))/MyN,i=1..MyN)];
end proc;

L:=MyProc(3);

Here you don't need to define a variable n, we can have that as the input of your procedure.

Scott
Applicaiton Developer
Maplesoft

On the help page for limit you have two commands, there is the normal limit(...) command and the Limit(...) command.  The first one Maple automatically evalutes while the second one Maple holds off evaluation so that a user can have the limit shown in the worksheet.  What you have copied was the inert limit (notice that your limit is gray in colour).  As you would notice from the ?limit help page the first two examples are inert while the later ones are not.  You can also get the normal limit from the Expressions palette in Maple's standard interface.

To evaluate the inert limit, just pass it to the value() command.  So in your example

value(%);

Scott
Application Developer
Maplesoft

What version of Maple did you use?  On Maple 13.02 on windows using the standard GUI the following worked for me

plots:-densityplot(prova, a = .16 .. .25, b = 4 .. 100, grid = [25, 25], labels = [eta, `ℳ`], colourstyle = HUE, axes = box);

Scott
Application Developer
Maplesoft

First off, the error that you are getting is because yo uappear to have imported the Units:-Standard package that is trying to simplify the equation for you.  Do you need this units package imported at this time?

If you choose to not use this package at this point you have two methods to get the result you are looking for.  The first method I will mention will make use of the Right-Click menu that is available in the Maple 13 standard interface (this will work in both worksheet and document mode).

First enter the problem you are using:

4*Unit(m)=3*Unit(m)+p/(1000*Unit(kg/m^3)*9.86*Unit(m*s^(-2)));

Now Right-Click and choose Solve> Isolate for > p.  Now you will get your answer but the units aren't simplified.  Now Right-Click on the answer and choose Simplify > Simplify.  If you want to choose to have the answer in something other than the default unit (in this case Unit(Pa)). You can Right-click on the answer and choose Right-hand Side to just get the right hand side of the equation.  Then Right-click and select Units > Replace Units and enter the unit you want to use, say something like bar.

 

The second method is by entering the following commands to get the same results.

isolate(4*Unit(m)=3*Unit(m)+p/(1000*Unit(kg/m^3)*9.86*Unit(m*s^(-2))), p);

convert(combine(rhs(%), 'units'), 'units', bar);

 

Scott
Application Developer
Maplesoft

It is possible to do this in Maple.  For Maple, you would have to enter in the system of equations then you can either plot the result of one for the funcitons in that system or you can write a routine that will transfer the information from that system to determine the position of a shape.  As an example, a Maple user has uploaded the following worksheet that deals with an inverted pendulum on the Application center (http://www.maplesoft.com/applications/view.aspx?SID=4490).

If you have a copy of MapleSim, then you can just drag in some multibody components and easily construct an inverted pendulum without needing to deal with the system of equations.  MapleSim will determine the system of equations for you.  Also, with MapleSim 2 and MapleSim 3 you will also get a 3-D animation of your results.

Scott
Applicaiton Developer
Maplesoft

For the last point that you were trying to plot the two curves, try breaking the plot calls into two seperate calls and use plots:-display to combine the two plots.  The following call works for me on 13.02.

P1 := plot(combine(Ca(t*Unit('s')), 'units'), t = 0 .. 600*Unit('s'), color = red, style = point, useunits);
P2 := plot(combine(Cb(t*Unit('s')), 'units'), t = 0 .. 600*Unit('s'), color = blue, style = line, useunits);
plots:-display([P1, P2]);

Scott
Application Developer
Maplesoft

When you add an assistant to the worksheet, Maple is placing a call to that assistant in the worksheet.  By expanding the document block (you can do this by going to View> Expand Document Block) you can see this call.  You can either delete the line containing this call or you can expand the document block and remove the call to the assistant.

Scott
Application Developer
Maplesoft

What do you want the output of this procedure to look like?

Is this roughly what you are looking for:

nestedseq:=proc(numtimes,middle)
return cat(seq(i,i=1..numtimes),middle,seq(j,j in [1,2,3]));
end proc;

nestedseq(5, "seperation");
                             12345seperation123
 

Scott
Application Developer
Maplesoft

Since what you are wanting to do is plot just the intersection of your function on that plane you can use the following command

plots:-intersectplot(x^2+y^2 = 4, z = 0, x = -2 .. 2, y = -2 .. 2, z = -2 .. 2, axes = boxed, thickness = 5);

This will produce the outline of a circle that is the solution.

Scott
Application Developer
Maplesoft

I am sure there is a command that will do this more efficently, but the following code should do what you are looking for.

eq1 := (-42.62500000*omega^2+1400.)*A[1]+(-12.00000000*omega^2-1000.)*A[2] = 0, (-12.00000000*omega^2-1000.)*A[1]+(-5.475000000*omega^2+1000.)*A[2] = 0;
Matrix(2, 2, (i, j)->coeff(collect(lhs(eq1[i]), A[j]), A[j]) );

Scott
Application Developer
Maplesoft

If you want to make changes to certain styles (for example the font or font size that are used for your worksheet) you can look at the styles help page in Maple.  If you would rather just have the fonts appear smaller on your machine, you may want to look at the default zoom for Maple.  This would be a lot easier to set and you can apply it globally on your copy of Maple by going to Tools> Options and look under the Interface tab.

Scott
Application Developer
Maplesoft

It appears that the error that you got has to do with the wrong differentiation used in the ic2.  Once that is fixed you would also have to fix the problem that you have both Theta[1] and Theta[2] along with Theta[1](t) and Theta[2](t) in your equations.  The following code has both of those fixed.

restart;
with(plots):

M[1] := 50; M[2] := 30; L[1] := 100; L[2] := 80; S[1] := (1/2)*L[1]; S[2] := (1/2)*L[2]; e[1] := 5; e[2] := 15; g := 9.81; K[1] := 100; K[2] := 100;

ode1 := (1/2)*M[2]*(2*L[1]*(diff(Theta[1](t), t, t))*S[2]+2*S[2]^2*(diff(Theta[2](t), t, t))+2*e[2]^2*(diff(Theta[2](t), t, t)))-(1/2)*M[1]*g*S[1]*Theta[1](t)^2+K[1]*Theta[1](t)^2=0;
ode2 := M[1]*(diff(Theta[1](t), t, t))*(S[1]^2+e[1]^2)+(1/2)*M[2]*(2*L[1]^2*(diff(Theta[1](t), t, t))+2*L[1]*S[2]*(diff(Theta[2](t), t, t)))-(1/2)*M[2]*g*L[1]*Theta[1](t)^2-(1/2)*M[2]*g*S[2]*Theta[2](t)^2+K[2]*Theta[2](t)^2-2*K[2]*Theta[2](t)*Theta[1](t)+K[2]*Theta[1](t)^2=0;

ic1 := Theta[1](0) = 20, Theta[2](0) = 0;
ic2 := D(Theta[1])(0) = 0, D(Theta[2])(0) = 0;

sys := {ic1, ic2, ode1, ode2};
sol := dsolve(sys, numeric, output = listprocedure);
plots[odeplot](sol,[t,Theta[1](t)],0..60);
 

The error that I am getting now is the following:

Warning, cannot evaluate the solution further right of 3.4552975, probably a singularity

This likely has to do with the system or the initial conditions that are provided.

Scott
Application Developer
Maplesoft

4 5 6 7 8 9 10 Last Page 6 of 30