Items tagged with plot

Feed

Hi every body,

I have a function "p(v,T)" which I evaluated its critical point. after calculating when I want to plot diagram of "p-v" for some values of "T" around critical value of "T" I expect the shape of diagram for "T" bigger and smaller than critical value of "T" be different. but it not happened. Are here anyone can help me? The function "p(v,T)" is in the file. if you want calculate critical point and check I am right or wrong. Thanks criticalpoint.mw

Hi! I have the system of differential equations

restart; with(plots); with(DEtools);

a := 1;

deq1 := u(s)*(diff(varphi(s), s, s))+2*(diff(u(s), s))*(diff(varphi(s), s))+sin(varphi(s)) = 0;

deq2 := diff(u(s), s, s)-u(s)*(diff(varphi(s), s))^2-cos(varphi(s))+a*(u(s)-1) = 0;

sol := dsolve({deq1, deq2, u(0) = 1, varphi(0) = (1/4)*Pi, (D(u))(0) = 0, (D(varphi))(0) = 0}, {u(s), varphi(s)}, numeric)

 

which is perfectly solved, but I need to convert it to Cartesian coordinates and draw a plot, so what I tried is

x := u(s)*sin(varphi(s));

y := -u(s)*cos(varphi(s));

plot([x, y, s = 0 .. 20])

 

But I'm getting an error "Warning, expecting only range variable s in expressions [u(s)*sin(varphi(s)), -u(s)*cos(varphi(s))] to be plotted but found names [u, varphi]"

I don't know why is this happens if I have a solution. For example, I can get solution for 2 seconds:

sol(2)

[s = 2., u(s) = 2.33095721668252, diff(u(s), s) = 1.02513293353371, varphi(s) = .213677391510693, diff(varphi(s), s) = -.242430995691885]

 

Hello!

I crwated a polyhedron from by grouping vertices to faces, and faces to a shell. My goal is to convert the obtained object into a polyhedron, which behaves similarly as e.g. Archimedean solids generated by Maple. Is it possible? Thank you in advance!

Bests,

Andrzej

hi, learners of maple like me, i was handling a project,but i came across this problem,and i began to doubt the accuracy of maple-plot,,,

very simply expression,result3,changing with the parameter f,

i first plot the f from 100 to 5000,

than i need to watch closer,

so i change the define domain of parameter f, plot f from 100 to 1000,  

and the result of plot definitely  differs from the previous one. 

low vally in the first figure (f in the scale of 100-1000),disappears! that's insane...

 

you can see below,

anyone see it, can you give me some clue? i really do not understand this. why ,why why,,

result3 := 3.269235506947450*10^11*sqrt(-1/(0.975698207102e-3*cos(0.19042716640833e-1*f)^2*cos(0.9521358320417e-2*f)^4-0.975698207102e-3*cos(0.19042716640833e-1*f)^2*cos(0.9521358320417e-2*f)^2+5.099915851388520*10^(-8)*cos(0.9521358320417e-2*f)^4-5.099915851388520*10^(-8)*cos(0.9521358320417e-2*f)^2+1.311634114532540*10^12*sin(0.19042716640833e-1*f)*sin(0.9521358320417e-2*f)*cos(0.9521358320417e-2*f)*cos(0.19042716640833e-1*f)+4.405792916762340*10^26*cos(0.19042716640833e-1*f)^2-4.406861706842330*10^26))

326923550694.745*(-1/(0.975698207102e-3*cos(0.19042716640833e-1*f)^2*cos(0.9521358320417e-2*f)^4-0.975698207102e-3*cos(0.19042716640833e-1*f)^2*cos(0.9521358320417e-2*f)^2+0.509991585138852e-7*cos(0.9521358320417e-2*f)^4-0.509991585138852e-7*cos(0.9521358320417e-2*f)^2+1311634114532.54*sin(0.19042716640833e-1*f)*sin(0.9521358320417e-2*f)*cos(0.9521358320417e-2*f)*cos(0.19042716640833e-1*f)+0.440579291676234e27*cos(0.19042716640833e-1*f)^2-0.440686170684233e27))^(1/2)

(1)

plot(result3, f = 100 .. 5000);

 

 

plot(result3, f = 100 .. 1000);

 

 

 

``


 

Download test.mw

 

 

 

A question was raised recently on Stewart Gough platforms.  I decided to tidy up some old code to show platform position and leg lengths for any given displacement.
 

restart

``

Hexapod Setup Data

 

RotZ := proc (delta) options operator, arrow; Matrix(1 .. 3, 1 .. 3, {(1, 1) = cos(delta), (1, 2) = -sin(delta), (1, 3) = 0, (2, 1) = sin(delta), (2, 2) = cos(delta), (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1}, datatype = anything, storage = rectangular, order = Fortran_order, subtype = Matrix) end proc

a[1] := Vector(3, [.5, 3.0, 0]); a[2] := evalf(RotZ(20*((1/180)*Pi)).a[1]); a[3] := evalf(RotZ(100*((1/180)*Pi)).a[2]); a[4] := evalf(RotZ(20*((1/180)*Pi)).a[3]); a[5] := evalf(RotZ(100*((1/180)*Pi)).a[4]); a[6] := evalf(RotZ(20*((1/180)*Pi)).a[5])

b[1] := evalf(.7*RotZ(-40*((1/180)*Pi)).a[1]); b[2] := evalf(RotZ(100*Pi*(1/180)).b[1]); b[3] := evalf(RotZ(20*Pi*(1/180)).b[2]); b[4] := evalf(RotZ(100*Pi*(1/180)).b[3]); b[5] := evalf(RotZ(20*Pi*(1/180)).b[4]); b[6] := evalf(RotZ(100*Pi*(1/180)).b[5])

Zeroposn := Vector(3, [0, 0, 3])

Tx := Vector(3, [1, 0, 0]); Ty := Vector(3, [0, 1, 0]); Tz := Vector(3, [0, 0, 1])

``

``

NULL

Procedures

 

PlatPosn := proc (x := 0, y := 0, z := 0, alpha := 0, beta := 0, delta := 0) local i, v, Rot, L1, L2, L3, L4, L5, L6; global txn, tyn, tzn, ctrp; description "Calculates the platform position in the Global Coordinates, Unit normals and Leg Lengths"; v := Vector(3, [x, y, z]); ctrp := Zeroposn+v; Rot := Matrix(1 .. 3, 1 .. 3, {(1, 1) = cos(delta)*cos(beta), (1, 2) = -sin(delta)*cos(alpha)+cos(delta)*sin(beta)*sin(alpha), (1, 3) = sin(delta)*sin(alpha)+cos(delta)*sin(beta)*cos(alpha), (2, 1) = sin(delta)*cos(beta), (2, 2) = cos(delta)*cos(alpha)+sin(delta)*sin(beta)*sin(alpha), (2, 3) = -cos(delta)*sin(alpha)+sin(delta)*sin(beta)*cos(alpha), (3, 1) = -sin(beta), (3, 2) = cos(beta)*sin(alpha), (3, 3) = cos(beta)*cos(alpha)}, datatype = anything, storage = rectangular, order = Fortran_order, subtype = Matrix); for i to 6 do bn || i := Zeroposn+v+Rot.b[i] end do; txn := Rot.Tx; tyn := Rot.Ty; tzn := Rot.Tz; print(" Platform centre Global", ctrp); print(" Platform corner Co-ords Global", bn1, bn2, bn3, bn4, bn5, bn6); print("Platform Triad Vectors  ", "X green ", txn, "Y blue", tyn, "Z red ", tzn); L1 := sqrt((bn1-a[1])^%T.(bn1-a[1])); L2 := sqrt((bn2-a[2])^%T.(bn2-a[2])); L3 := sqrt((bn3-a[3])^%T.(bn3-a[3])); L4 := sqrt((bn4-a[4])^%T.(bn4-a[4])); L5 := sqrt((bn5-a[5])^%T.(bn5-a[5])); L6 := sqrt((bn6-a[6])^%T.(bn6-a[6])); print("Leg Lengths"); print("L1= ", L1); print("L2= ", L2); print("L3= ", L3); print("L4= ", L4); print("L5= ", L5); print("L6= ", L6) end proc

``

PlatPlot := proc () local Base, Platformdisplacement, picL1, picL2, picL3, picL4, picL5, picL6; global tx0, ty0, tz0; description "Displays the Hexapod"; Base := plots:-polygonplot3d(Matrix([a[1], a[2], a[3], a[4], a[5], a[6]], datatype = float), color = black, transparency = .5); Platformdisplacement := plots:-polygonplot3d(Matrix([seq(bn || i, i = 1 .. 6)]), color = cyan, transparency = .5); picL1 := plots:-arrow(a[1], bn || 1-a[1], colour = green); picL2 := plots:-arrow(a[2], bn || 2-a[2], colour = blue); picL3 := plots:-arrow(a[3], bn || 3-a[3], colour = blue); picL4 := plots:-arrow(a[4], bn || 4-a[4], colour = blue); picL5 := plots:-arrow(a[5], bn || 5-a[5], colour = blue); picL6 := plots:-arrow(a[6], bn || 6-a[6], colour = orange); tx0 := plots:-arrow(ctrp, txn, colour = green); ty0 := plots:-arrow(ctrp, tyn, colour = blue); tz0 := plots:-arrow(ctrp, tzn, colour = red); plots:-display(Base, picL1, picL2, picL3, picL4, picL5, picL6, Platformdisplacement, tx0, ty0, tz0, axes = box, labels = [X, Y, Z], scaling = constrained) end proc

``

NULL

``

``

PlatPosn()

"L6= ", 3.586394355

(1)

PlatPlot()

 

NULL

PlatPosn(.52, -.89, .7, .2, .67, .3)

"L6= ", 3.055217994

(2)

PlatPlot()

 

NULL

NULL

 

NULL

print('tzn' = LinearAlgebra:-CrossProduct(txn, tyn), `= `, tzn)

tzn = Vector[column](%id = 18446744074564617750), `= `, Vector[column](%id = 18446744074328082542)

(3)

``

``NULL

NULL

Rotation Matrices

NULL

``

 

RotZ := Matrix(3, 3, {(1, 1) = cos(delta), (1, 2) = -sin(delta), (1, 3) = 0, (2, 1) = sin(delta), (2, 2) = cos(delta), (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

RotY := Matrix(3, 3, {(1, 1) = cos(beta), (1, 2) = 0, (1, 3) = sin(beta), (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (3, 1) = -sin(beta), (3, 2) = 0, (3, 3) = cos(beta)})

RotX := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = cos(alpha), (2, 3) = -sin(alpha), (3, 1) = 0, (3, 2) = sin(alpha), (3, 3) = cos(alpha)})

NULL

ROT := RotZ.RotY.RotX

Matrix(%id = 18446744074564619310)

(4)

``

``

``


 

Download Reverse_Kinematics_Stewart_Gough_Platform.mw

I want(ed) to plot a surface gievn by f(x,y,z),g(x,y,z),h(x,y,z) where k(x,y,z) =0. I suspect that is not possble but I thought I might ask.

 

thanks

[[1000, 20], [2000, 25], [3000, 24], [4000, 23], [5000, 24]];
  [[1000, 20], [2000, 25], [3000, 24], [4000, 23], [5000, 24]]
data1 := [[1000, 20], [2000, 21], [3000, 32], [4000, 23], [5000, 23]]; 'data1';
                             data1
a*x^3+b*x^2+c*x+d;
                        3      2          
                     a x  + b x  + c x + d
x;
                               x
Equn1 := CurveFitting[LeastSquares]([[1000, 20], [2000, 25], [3000, 24], [4000, 23], [5000, 24]], x, curve = a*x^3+b*x^2+c*x+d);
plot(Equn1,x= 1000..5000)


 

Least Squares Approximation

 

 

Calculate a least squares approximation using specified data points.

 

 

Theoretical Curves for the Two-Stroke Engines and Four-Stroke Engines Brake Power Vs Brake Efficiency

List of Data Points:

[[1000, 20], [2000, 25], [3000, 24], [4000, 23], [5000, 24]]

[[1000, 20], [2000, 25], [3000, 24], [4000, 23], [5000, 24]]

(1)

data1 := [[1000, 20], [2000, 21], [3000, 32], [4000, 23], [5000, 23]]; 'data1'

data1

(2)

Fitting Curve:

a*x^3+b*x^2+c*x+d

a*x^3+b*x^2+c*x+d

(3)

Independent Variable:

x

x

(4)

Least Squares Curve:

Equn1 := CurveFitting[LeastSquares]([[1000, 20], [2000, 25], [3000, 24], [4000, 23], [5000, 24]], x, curve = a*x^3+b*x^2+c*x+d)

plot(Equn1,x= 1000..5000)

 

 

 

 

NULL

Equn1

31/5+(83/4200)*x-(23/3500000)*x^2+(1/1500000000)*x^3

(5)

 

 

Least Squares Fit of Data by a Specified Curve

List of Data Points:

[[3, -1], [5, 3], [6, -7], [7, 5], [9, -2]]

[[3, -1], [5, 3], [6, -7], [7, 5], [9, -2]]

(6)

Fitting Curve:

a*x^2+b*x+c

a*x^2+b*x+c

(7)

Independent Variable:

x

x

(8)

Least Squares Curve:

CurveFitting[LeastSquares]([[3, -1], [5, 3], [6, -7], [7, 5], [9, -2]], x, curve = a*x^2+b*x+c)

-901/210+(213/140)*x-(11/84)*x^2

(9)
 

 

a*x^2+b*x+c

a*x^2+b*x+c

(10)

plot(sin(x), x = 0 .. 4*Pi)

 

``


 

Download LeastSquareApproximation_2nd_and_3rd_Order.mw

The above command plots one curve alright. I want four such curves to go in the same figure using command like

plot(Equn1,Equn2,Equn3,Equn4,view(x=1000..5000)

I am not getting by the above command what I want. Can any one help. A shortcut method is required for me to repeat many times.

Thanks for help.

Ramakrishnav V
 

Hello

I have question. How can I rotate this 2-D plot and create 3-D plot?

plot(exp(-(x-3)^2*cos(4*(x-3))),x=1..5)

Thank you.

hi my friend. i want to find a approximately function of this plot. how i can get this. and i have numerical value in this excel

Book1.xlsx

 

Dear community, 

I'm new to maple and was wondering if you could help me out.

I have this curve where I want to make a line that goes from x=0.5 up to its value on the curve in this case 1.60 and then all the way to the y-axis so there is an area under the curve which I can color if that's even possible?

I have the following in maple:

k := 2.5;
                              2.5
Ca0 := 1;
                               1
v := 20;
                               20
Ca := Ca0*(1-x);
                             1 - x
Fa0 := Ca0*v;
                               20
Cb := Ca0*x;
                               x
ra := k*Ca*Cb;
                         2.5 (1 - x) x
plot(1/ra, x = 0 .. 1);
 

thank you for your help

Best Regards

Saad

I can not understand why the following statement works perfectly:
with (plots);
P1: = plot (f (x), x = xmin .. xmax, y = ymin .. ymax, color = "green");
P2: = plot (orddir, x = xmin .. xmax, y = ymin .. ymax, color = "blue");

Plots [display] (plottools [line] ([ascf, ymin], [ascf, 10]), color = red;
Plot ([5, y, y = 0 .. 10]);
P3: = implicit plot (x = ascf, x = xmin .. xmax, y = ymin .. ymax, color = red, linestyle = 3, thickness = 2);
P4: = plot (points, x = xmin .. xmax, y = ymin .. ymax, style = point, symbol = circle, symbolsize = 20, color = "black");
P5: = plot (h, x = xmin .. xmax, y = ymin .. ymax, color = "yellow");
Display ({p1, p2, p3, p4, p5}, axes = normal, scaling = unconstrained, title = "Parallel, vertice, focus, direction and axis of symmetry", gridlines = true);

While in the following
Points: = [F, V, A, B];
with (plots):
P1: = plot (f (x), x = xmin .. xmax, y = ymin .. ymax, color = "green");
P2: = plot (yd, x = xmin .. xmax, y = ymin .. ymax, color = "blue");
P3: = implicitplot (x = xv, x = xmin .. xmax, y = ymin .. ymax, color = red, linestyle = 3, thickness = 2);
P4: = plot (points, x = xmin .. xmax, y = ymin .. ymax, style = point, symbol = circle, symbolsize = 20, color = "black");

Do (% Plot0 = display ({p1, p2, p3, p4}, axes = normal, scaling = unconstrained, title = "Parallel, vertices, focus, direction and axis of symmetry", gridlines = true));

P4 does not print anything. In thanking you for the kind attention, I cordially greet you. Carmine Marotta ..

Hi everyone,

as a very basis example I've tried to get the equipotential lines of an 1/r² potential in the x-y-plane using contourplot. However, I obtained the following very strange result. Do you get the same mistake or is there something wrong on my end?

Thanks in advance,
Sören


 

with(plots):

plots:-contourplot(1/(x^2+y^2), x = -2 .. 2, y = -2 .. 2)

 

plots:-contourplot(1/(x^2+y^2), x = -2 .. 2, y = -2 .. 2, contours = 5, numpoints = 100)

 

plots:-contourplot(1/(x^2+y^2), x = -2 .. 2, y = -2 .. 2, contours = 5, numpoints = 1000)

 

plots:-contourplot(1/(x^2+y^2), x = -2 .. 2, y = -2 .. 2, contours = 5, numpoints = 10000)

 

``

Download contourplot.mw

hi
i want to draw a plot with to column-numerical that i imported from excel (i import one of the, for x axis and another for y axis)

I have a complex function for both the electric and magnetic fields for 2 laser pluses colliding they are only 2 dimensions z,t;

E(z,t) := -I*a*exp(-(z-Z+t)^2/sigma^2)*sin(omega*(z-Z+t))+a*exp(-(z+Z-t)^2/sigma^2)*sin(omega*(z+Z-t))

B(z,t) := -a*exp(-(z-Z+t)^2/sigma^2)*sin(omega*(z-Z+t))+I*a*exp(-(z+Z-t)^2/sigma^2)*sin(omega*(z+Z-t))

Where a,omegasigma are real constants and Z is the initial offset for the pluses,

I would like to plot them together with there real and imaginary parts on two axes and then extended along the z direction, if possible I would like to animate them. To hopefully get a moving plot like this except it's a laser pluse not a continuous wave,

Hi!

If somebody could help me it would be awesome!

I would like to be able to switch the independent variable onto the vertical axis!

If that is not possible, what i'm trying to do is modelise in a function a set of points, but with multiple values for the same x, but not more than one for the y, so the best option would be to switch the variables, to have x dependant of y. My graphic has to be vertical though, so I can't just switch the points.

Thank you a lot

Charlotte

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