Items tagged with plot plot Tagged Items Feed

Hi,

sorry for that question, i'm a beginner in maple but i think my question is not as simple.

So, i want to solve numerically this first equation :

but the second term is present only if k*(U*t-x)>μc*m*g  (stick-slip problem)

initial conditions : U=1m/s; x=0m; k=10 for example

My problem is simple, i don't know how to use conditional statement for such an ode in maple.

I've tried > Xr := U*t-x;
> k := 10; m := 1; g := 10; mu := .2;
> if k*Xr > mu*m*g then ode1 := m*(diff(x(t), t, t)) = k.Xr-mu*m*g else ode1 := m*(diff(x(t), t, t)) = k.Xr end if;

But, of course, too optimistic.

Thank to anyone who will solve that (isuppose) simple problem

Philippe

Hi,

i make an attempt to plot the solution to

Here is my code :

> with(plots); with(DEtools);
> ode1 := diff(x(t), t) = v(t); ode2 := diff(v(t), t) = -(.8*9.8)*v(t)/abs(v(t))-cos(t)^2;
> MODEL := {ode1, ode2}; VARS := {v(t), x(t)}; DOMAIN := t = 0 .. 150; RANGE := x = -1 .. 1, v = -5 .. 5; COLORS := [BLACK, BLUE]; IC1 := [x(0) = .5, v(0) = .25]; IC2 := [x(0) = 2.5, v(0) = 3];
> DEplot(MODEL, VARS, DOMAIN, RANGE, [IC1, IC2], stepsize = .1, linecolor = COLORS, scene = [t, x]);
>

and the message cannot evaluate the solution further right of .16015784, maxfun limit exceeded (see ?dsolve,maxfun for details)

Any other attemp has failed.

Have you got somme ideas

Thanks

Phil

Hi, does anyone know how to plot a Bode diagram (phase and amplitude plot)? I am not looking for preparation of data but rather for the technicality of producing a plot that looks like I want, given I have data in the right form (which in my case are three Vectors: frequency, amplitude and phase).

Below is a rough sketch of what I am looking for. Note that the amplitude is on a log scale. It would be acceptable having to take the log of the data "by hand" to allow both vertical scales to be linear (I'd just convert the amplitudes to dB). The important things are the common frequency scale (horizontal) and the separation of amplitude and phase. I know plots has  dualaxisplot, and I know I can use plots:-transform to move a curve around, but I want the two axes on the left side, below each other, rather on the left and right. I'd like the frequency scale in the middle between the two curves, although I could settle on that scale to be below both curves.

I had some look around the Maple applications but did not find anything looking like this.

Thanks,

Mac Dude

Trying to use the Explore() to parametrize a couple of plots simultaneously.

According to the help: "A plotting command to be explored can be a function call to plot, plot3d, a command in the plots package, or any user-defined procedure which returns a two- or three-dimensional plot structure or an Array of such plot structures."

However with the definitions

restart;
with(plots):
with(plottools):
Parab1 := ''plot(a*x^2, x = -1 .. 1, y = -3 .. 3)'';
Parab2 := ''plot(a*x^2+1, x = -1 .. 1, y = -3 .. 3)'';
L:=Array(1..2);
L[1]:=Parab1;L[2]:=Parab2;

I then find the following:

Explore(L[1], parameters = [a = -1.0 .. 1.0]);
gives the expected parabola, and the slider updates the parabola dynamically, as expected, and of course the same with L[2] in place of L[1]. However,

Explore(L, parameters = [a = -1.0 .. 1.0])

does not work, giving "Warning, expecting only range variable x in expression a*x^2 to be plotted but found name a". If I use display(L) in the command above, I receive two adjacent plots, as expected but they do not update as the parameter a is changed via the slider.

I'd guess I need to delay or promote variable evaluation somehow, but I can't seem to make it work. What am I missing?

 

 

 

 

 

 

I would like to overwrite a plot that's updated within a loop over time. 

I used animate already, but the problem is that it's  only updated at specific points in time (not regularly distributed) and with animate I can only use frames that are equally divided over the wholre range. To update each time step costs unneeded memory and time. 

I hope that there exists a better solution.

thanks for your help.

Is it possible to make scatter-histogram plots in Maple13 like these

http://stackoverflow.com/questions/6508769/matplotlib-scatter-hist-with-stepfilled-histtype-in-histogram ?

I achieved the scatter-plot, but what about the additional histograms?

I found some codes for drawing my Graph in Maple:

[>  with(GraphTheory);

     W := Graph(undirected, {{0, 1}, {0, 2}, {0, 3}}):

     HighlightEdges(W, W, black):

     HighlightVertex(W, [1, 2, 3, 0], gray):

     DrawGraph( W);

 The way that the graph was plotted was not what I wanted to have. In fact, I expected to have something like this one:

http://i.stack.imgur.com/JMfmd.png

I mean the vertexes are shaped by circles not by boxs. Moreover, one may want to see labels below (or above) the circled nodes. My question is 

" Is there any certain codes we can use to have this graph like the picture above? Can we manage the labels to be appeared near the nodes in Maple?

Thanks for your time!

Hi all,

I would like to plot a solution of differentiel equation in its three ranges [-10,-6^(2/3)/4[,[-6^(2/3)/4,6^(2/3)/4], ]6^(2/3)/4,10] .

When plotting using unapply(piecewise) I got an error like

Error, (in plot) offset to _Inert_LOCAL outside of range

See below my code.

Thanks for hellp.

HYP.mw

A small piece of code for fun before the weekend, inspired by some recent posts:

http://www.johndcook.com/blog/2015/06/03/mystery-curve/

http://mathlesstraveled.com/2015/06/04/random-cyclic-curves-5/

http://www.walkingrandomly.com/?p=5677

 

cycler := proc(t, k, p, m, n, T) local expr, u, v;
  u := exp(k*I*t);
  expr := exp(I*t) * (1 - u/m + I*(u^(-p))/n);
  v := 1 + abs(1/n) + abs(1/m);
  plots:-complexplot( expr, t = 0 .. T, axes = none,
                      view = [-v .. v, -v .. v] );
end proc:

cycler(t, 5, 3, 2, 3, 2*Pi);

And that can be made into a small application (needs Maple 18 or 2015),

Explore( cycler(t, k, p, m, n, T),
         parameters = [ k = -10 .. 10, p = -10 .. 10,
                        m = -10.0 .. 10.0, n = -10.0 .. 10.0,
                        [ T = 0 .. 2*Pi, animate ] ],
         initialvalues = [ k = 5, p = 3, m = 2, n = 3, T = 2*Pi ],
         placement = left, animate = false, numframes = 100 );

cyclerapp.mw

The animation of parameter T from 0 to 2*Pi can also be fun if the view option is removed/disabled in the call to complexplot. (That could even be made a choice, by adding an additional argument for calling procedure cycler and an accompanying checkbox parameter on the exploration.)

acer

Hey there!

I uploaded a solid drawing from a CAD software (like solidworks, inventor, stl files, etc) into Maple using plottools:-importplot("drawing.stl"). 

Also, I know Maple can give me the normal vector (and point of intersection) using line and intersection commands, for example.

Now, is it possible to find a point of intersection (and the normal vector at that point) of a line that crosses the uploaded CAD solid?

I guess that to accomplish that, it would be necessary to somehow "map" the solid and that's the part that I am lost.

Many thanks!

 

 

given a scalar field function f(x,y,z), how to plot it in maple?

I can't find a suitable command, if I missed, please tell me.

thank you for any advice.

Hey there,

I've a numerical solved system of differential equations, which depend on one argument and one index. I can solve it, but when I try plot it I have this error: Error, (in plot) two lists or Vectors of numerical values expected.

Could anyone help me figure out what I'm doing wrong?

 

> restart;
> A := 115.1558549; B := .3050464658; n := 3; f0 := 0.5e-4;
               
>f:=theta->f0*(cos(arcsin(sin(theta)/n)))^2;
  I0:=Ir(z)+sum(Is[k](z),k=1..20);

> alpha := [0, 1, 2, 3, 4, 5, 6];

Theta := [3*Pi*(1/180), 6*Pi*(1/180), 9*Pi*(1/180), 12*Pi*(1/180), 15*Pi*(1/180), 18*Pi*(1/180), 21*Pi*(1/180), 24*Pi*(1/180), 27*Pi*(1/180), 30*Pi*(1/180), 33*Pi*(1/180), 36*Pi*(1/180), 39*Pi*(1/180), 42*Pi*(1/180), 45*Pi*(1/180), 48*Pi*(1/180), 51*Pi*(1/180), 54*Pi*(1/180), 57*Pi*(1/180), 60*Pi*(1/180)];

>G:= theta->A*sin(theta)*cos(2*arcsin((sin(theta)/n)))/((1+sin(theta)^2/B^2)*cos(arcsin(sin(theta)/n)));

>for j from 1 to 7 do
d1 := diff(Ir(z), z) = -sum(G(Theta[k])*Ir(z)*Is[k](z)/I0,k=1..20)-alpha[j]*Ir(z)-sum(f(Theta[k])*Ir(z),k=1..20):
d2 := diff(Is[1](z), z) = G(Theta[1])*Ir(z)*Is[1](z)/I0-alpha[j]*Is[1](z)+f(Theta[1])*Ir(z):
d3 := diff(Is[2](z), z) = G(Theta[2])*Ir(z)*Is[2](z)/I0-alpha[j]*Is[2](z)+f(Theta[2])*Ir(z):
d4 := diff(Is[3](z), z) = G(Theta[3])*Ir(z)*Is[3](z)/I0-alpha[j]*Is[3](z)+f(Theta[3])*Ir(z):
d5 := diff(Is[4](z), z) = G(Theta[4])*Ir(z)*Is[4](z)/I0-alpha[j]*Is[4](z)+f(Theta[4])*Ir(z):
d6 := diff(Is[5](z), z) = G(Theta[5])*Ir(z)*Is[5](z)/I0-alpha[j]*Is[5](z)+f(Theta[5])*Ir(z):
d7 := diff(Is[6](z), z) = G(Theta[6])*Ir(z)*Is[6](z)/I0-alpha[j]*Is[6](z)+f(Theta[6])*Ir(z):
d8 := diff(Is[7](z), z) = G(Theta[7])*Ir(z)*Is[7](z)/I0-alpha[j]*Is[7](z)+f(Theta[7])*Ir(z):
d9 := diff(Is[8](z), z) = G(Theta[8])*Ir(z)*Is[8](z)/I0-alpha[j]*Is[8](z)+f(Theta[8])*Ir(z):
d10 := diff(Is[9](z), z) = G(Theta[9])*Ir(z)*Is[9](z)/I0-alpha[j]*Is[9](z)+f(Theta[9])*Ir(z):
d11 := diff(Is[10](z), z) = G(Theta[10])*Ir(z)*Is[10](z)/I0-alpha[j]*Is[10](z)+f(Theta[10])*Ir(z):
d12 := diff(Is[11](z), z) = G(Theta[11])*Ir(z)*Is[11](z)/I0-alpha[j]*Is[11](z)+f(Theta[11])*Ir(z):
d13 := diff(Is[12](z), z) = G(Theta[12])*Ir(z)*Is[12](z)/I0-alpha[j]*Is[12](z)+f(Theta[12])*Ir(z):
d14 := diff(Is[13](z), z) = G(Theta[13])*Ir(z)*Is[13](z)/I0-alpha[j]*Is[13](z)+f(Theta[13])*Ir(z):
d15 := diff(Is[14](z), z) = G(Theta[14])*Ir(z)*Is[14](z)/I0-alpha[j]*Is[14](z)+f(Theta[14])*Ir(z):
d16 := diff(Is[15](z), z) = G(Theta[15])*Ir(z)*Is[15](z)/I0-alpha[j]*Is[15](z)+f(Theta[15])*Ir(z):
d17 := diff(Is[16](z), z) = G(Theta[16])*Ir(z)*Is[16](z)/I0-alpha[j]*Is[16](z)+f(Theta[16])*Ir(z):
d18 := diff(Is[17](z), z) = G(Theta[17])*Ir(z)*Is[17](z)/I0-alpha[j]*Is[17](z)+f(Theta[17])*Ir(z):
d19 := diff(Is[18](z), z) = G(Theta[18])*Ir(z)*Is[18](z)/I0-alpha[j]*Is[18](z)+f(Theta[18])*Ir(z):
d20 := diff(Is[19](z), z) = G(Theta[19])*Ir(z)*Is[19](z)/I0-alpha[j]*Is[19](z)+f(Theta[19])*Ir(z):
d21 := diff(Is[20](z), z) = G(Theta[20])*Ir(z)*Is[20](z)/I0-alpha[j]*Is[20](z)+f(Theta[20])*Ir(z):
dsys := {d1, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19, d2, d20, d21, d3, d4, d5, d6, d7, d8, d9}:
dSol[j] := dsolve({op(dsys), Ir(0) = 1, Is[1](0) = 0.1e-1, Is[2](0) = 0.1e-1, Is[3](0) = 0.1e-1, Is[4](0) = 0.1e-1, Is[5](0) = 0.1e-1, Is[6](0) = 0.1e-1, Is[7](0) = 0.1e-1, Is[8](0) = 0.1e-1, Is[9](0) = 0.1e-1, Is[10](0) = 0.1e-1, Is[11](0) = 0.1e-1, Is[12](0) = 0.1e-1, Is[13](0) = 0.1e-1, Is[14](0) = 0.1e-1, Is[15](0) = 0.1e-1, Is[16](0) = 0.1e-1, Is[17](0) = 0.1e-1, Is[18](0) = 0.1e-1, Is[19](0) = 0.1e-1, Is[20](0) = 0.1e-1}, [Ir(z), Is[1](z), Is[2](z), Is[3](z), Is[4](z), Is[5](z), Is[6](z), Is[7](z), Is[8](z), Is[9](z), Is[10](z), Is[11](z), Is[12](z), Is[13](z), Is[14](z), Is[15](z), Is[16](z), Is[17](z), Is[18](z), Is[19](z), Is[20](z)], numeric);
end do:


>for j from 1 to 7 do
dSol[j](0.4);
as:='as':
for l from 1 to 20 do
as[l]:=[Theta[l],rhs(dSol[j](0.4)[2+l])];
od:
plo[j]:=convert(as,listlist);
od:


>plot(plo[2],plo[1]);
Error, (in plot) two lists or Vectors of numerical values expected

 

why can not draw graph in maple in this case and how to plot graph with matlab in maple

with(StringTools);
with(FileTools);
with(Matlab);
openlink();
evalM(sprintf("load fisheriris;X = meas(:,3:4);figure;plot(X(:,1),X(:,2),'k*','MarkerSize',5);"));
closelink();

Hi all,

 

I'm trying to create the 3D animation which can show the idea of rotating 2D function plot, such as:

 

with(plots):

display(seq(surfdata([seq([seq([x, cos(2*p*Pi*(1/25))*x^(1/2), -sin(2*p*Pi*(1/25))*x^(1/2)], x = 0 .. 4, .1)], p = 0 .. t)]), t = 1 .. 25), insequence = true);

But it's too inconvenient because of too many seq functions in this commond, is there any easier way to plot this animatiton?

Thank you.

Hi guys,

I'm studying a system of six differential equations. Given the fact that the system cannot be solved symbolically, I've tried the numeric procedure, and it works. I proceeded like this :

soleqd:=dsolve(sysd2,numeric,var);

then i checked if maple could calculate the solutions for given values of t. It works for t=0, t=0.5, t=1,t=2,...,t=5. The solutions are all real numbers.

But when i try to draw a graphic representation of the solutions, it doesn't work. I do :

ff1:=t->subs(soleqd(t),u[1](t));
gg1:=t->subs(soleqd(t),nu[1](t));

Then :

plot(['ff1(t)','gg1(t)',t=0..5],u[1]=0...1,nu[1]=0...1);

(The square brackets are indices)

Now maple answers that it is "unable to evaluate the function to numeric values in the region". I went to the help page but no solution seems to work. I can't figure it out by myself. Does anybody notice something wrong with my code ?

Thank you for your time,

Best regards,

Louis

1 2 3 4 5 6 7 Last Page 1 of 162