MaplePrimes Questions

In a post of April 15, 2013 by Kitonum, the procedure named Picture accepts a list of polygon segments, creates a plot of these as a 2D polygon's boundaries and fills the polygon with a color.

The code below attempts to modify Picture to produce a 3D filled polygon in a plane parallel to the xy plane.

When invoked by the code below the procedure, the filling color conforms to the straight line boundaries but overflows the curved, parabolic boundary. How can this be corrected?

Picture:=proc(L, C, N::posint:=100, Boundary::list:=[linestyle=1])

 local i, var, var1, var2,e, e1, e2,e3, P, h ;

 global Q,Border;

 for i to nops(L) do    

#` set P`[i] = list of points for each segment.    

#` for a segment defined as a list of points, P[i] = the segment's definition`

#` for a curve definition, approximate it with a list of [x,y] points of its function evaluated at N even intervals in its

# range`  

  if type(L[i],listlist(algebraic))  then P[i]:=op(L[i]);   else  

  #` for curve def'n, set var = def'n and h= `(variable range)/(2)

  var:=lhs(L[i,2]);  var1:=lhs(rhs(L[i,2]));  var2:= rhs(rhs(L[i,2])); h:=(var2-var1)/(N);

  #` for function def'n, set e=function`

 if type(L[i,1], algebraic) then  e:=L[i,1];

  #` for polar function r=f(t) create N values of the [cos*r,sin*r] i.e. the equivalent [x,y] values for r valued at N even

  # divisions of its range`  

 if nops(L[i])=3 then P[i]:=seq(subs(var=var1+h*i,[e*cos(var), e*sin(var)]), i=0..N);  else

    #` for non-polar function y=f(x) create N values of [x,y] for x values at N even divisions of its range`  

 P[i]:=seq([var1+h*i, subs(var=var1+h*i,e)], i=0..N)  fi;  else

 #` for parametric function [f`(t),g(t)] create N values of [f(t),g(t)] for t values at N even divisions of its range.

     e1:=L[i,1,1];  e2:=L[i,1,2];

#` P`[i]:=seq(subs(var=var1+i*h,[e1, e2]), i=0..N):

 P[i]:=seq([subs(var=var1+i*h,e1), subs(var=var1+i*h,e2),0], i=0..N) fi; fi; od;  #`  MODIFIED FOR 3 D `[f(t), g(t), 0] 

  Q:=[seq(P[i], i=1..nops(L))];

 Border:=plottools[curve]([op(Q), Q[1]],  op(Boundary));

     #` the shaded figure is a polygon whose vertices are Q, whose interior color is C`  

 #` return a list of the polygon and its border`

   [plottools[polygon](Q, C),  Border];

 end proc: 

L := [[[0, 0, 0], [0, 1, 0]], [[x, x^2+1, 0], x = 0 .. 2], [[2, 5, 0], [2, 2, 0]], [[x, x, 0], x = 2 .. 0]]:

plots[display](Picture(L, color = yellow), axes = normal, scaling = constrained)

Hello,

I would like to extract from a equation only the list of variables depending of time.

eq:= x0(t)+sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))*xb[1]-sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))*zb[1]-sin(alpha0(t))*cos(beta0(t))*yb[1]+cos(alpha0(t))*sin(gamma0(t))*zb[1]+cos(alpha0(t))*cos(gamma0(t))*xb[1]-l2[1]*(sin(psi[1](t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))-cos(psi[1](t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))+sin(psi[1](t))*cos(alpha0(t))*cos(gamma0(t))+cos(psi[1](t))*cos(alpha0(t))*sin(gamma0(t)))-l3[1]*(sin(theta[1](t))*sin(psi[1](t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))+sin(theta[1](t))*cos(psi[1](t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))+cos(theta[1](t))*sin(psi[1](t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))-cos(theta[1](t))*cos(psi[1](t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))-sin(theta[1](t))*sin(psi[1](t))*cos(alpha0(t))*sin(gamma0(t))+sin(theta[1](t))*cos(psi[1](t))*cos(alpha0(t))*cos(gamma0(t))+cos(theta[1](t))*sin(psi[1](t))*cos(alpha0(t))*cos(gamma0(t))+cos(theta[1](t))*cos(psi[1](t))*cos(alpha0(t))*sin(gamma0(t)))-xp[1](t) = 0;

I think the indets function should help be.

indets(lhs(eq)-rhs(eq), function(t))

The last argument of the indets is wrong but should enable to explain my need.

Thanks a lot for your help

Hello,

I have this list :
T:=[alpha(t),beta(t)]

I would like to create this list automatically:

Tmod:=[alpha_,beta_]

In other words, how can I remove the 3 characters "(t)" and replace it by "_"

Do you have ideas to do so ?

Thanks a lot for your help

I tried to solve a system of two equations using fsolve in Maple, however Maple didn't return any result (yet there is the result of that equation's system):

Maple is returning the command if there are no roots but that isn't my case.

How can I obtain the result in Maple?

worksheet.mw

solution of system of differential equations

is {a(t) = 1, b(t) = exp(t), c(t) = 0}

1 = exp(t), since t = 0, is characteristic equation = (y-0)?
0 = exp(t), how to find this characteristic equation when division is zero?
exp(t) = exp(t), is characteristic equation = (y-t)?

after solved, 

diff(a(t), t) = diff(a(t), t)

diff(b(t), t) = 0

diff(c(t), t) = -b(t)/c(t)

 

there is a diff(a(t), t) term 

how to plot this kind of system?

can diff(a(t), t) be ignore so that only consider two equations, diff(b(t),t) and diff(c(t),t) ?

if so, i use below to plot, it can not show the arrow clearing , i can only see arrow near origin, but not far point

with(plots):
fieldplot([0, y/x], x = -2 .. 2, y = -2 .. 2);
fieldplot([0, y/x], x = -2 .. 2, y = -2 .. 2, arrows = SLIM,grid = [1, 1]);
fieldplot([0, y/x], x = -10 .. 10, y = -10 .. 10);

 about how to calculate vector field of system of 3 differential equations which in terms of a(t), b(t), c(t) , diff(a(t),t), diff(b(t),t), diff(c(t),t)?

is the only method is the express diff(a(t),t), diff(b(t),t), diff(c(t),t) in terms of a(t), b(t), c(t) ?

for example 

<diff(a(t),t), diff(b(t),t), diff(c(t),t)>

if result is

diff(a(t),t) = a(t)*b(t)

diff(b(t),t) =b(t)*c(t)

diff(c(t),t) =c(t)*a(t)

<a(t)*b(t), b(t)*c(t), c(t)*a(t)>

then

is it the vector field <a*b, b*c, c*a> ?

 

When I put maximize(cos(t)), everything is fine.

When I put maximize(cos(Pi)), everything is fine.

When I put maximize(cos(t*Pi)), it says invalid limiting point??? What went wrong?

 

Suppose I have a function like this: f=cos(2t/m)+cos(2(t+5)/m).

 

Now for each fixed m, we get the maximum value of f. Then I want to build a plot where x-axis is m and y-axis is f, how could I do that? Please help!

 

Hello,

I want to solve a optimization problem with maple/maplesim.

A car has to move a defined distance on a plane, straight road in a defined time. Given is the mass of the car, the maximum force to accelerate the car, the distance and the time. The rolling resistance and the drag force should be considered. At start-point speed v = 0m/s and also at the end-point speed should be v= 0m/s.

So there are the following model parameters:

mass                            m = 2000kg
distance                        d  = 1000m
time                              t_max = 120s
                                    v_0 = 0m/s
                                    v_d = 0m/s
accelerating force           -1m/s2 <= F_acc/m <= 1m/s2
resistance to rolling        F_rol = C + A*v2                      C and A are later defined
resulting force at mass   F_res = F_acc - F_rol

The energy consumption  integral F_acc(s) ds (from 0 to d) should be minimized and I want to print the graph of F_acc(s) 

How can or can Maple help me solving this optimization problem?

 

 

Can we get it in MapleSim, not in exactly this form, but in substance? (Not in Maple)
The line of intersection of surfaces:
(x1-0.5) ^ 4 + x2 ^ 4 + x 3 ^ 4-1. ^ 2 = 0.;
x1 ^ 2 + (x2-0.25) ^ 2 + x3 ^ 2-1. ^ 2 = 0.;
(Red) rotates about an axis oX3. During rotation, the line intersects with the fixed sphere ((0., 1.5, 0 .5); R = 1.725). One of the points of intersection is drawn in green. Green Dot and the center of the sphere connected to the blue segment.  In the sphere  of  fixed  trajectory of  the green point.
In other words, the geometric model  3d  cam mechanism and its kinematics.


I'm looking for the 3-D integral formulae for Convolution, and Cross Correlation, between pairs of functions, which are each in spherical polar coordinates, for implementation in a MAPLE worksheet. Each function is normalized and symmetric around the origin.

Thank you for your consideration.

 

``

``

M := diff(T(r), r, r)+(diff(T(r), r))/r+u*(-8*B*U+N)*T(r)+P*(r^4+r^2) = 0

diff(diff(T(r), r), r)+(diff(T(r), r))/r+u*(-8*B*U+N)*T(r)+P*(r^4+r^2) = 0

(1)

``

dsolve(M)

T(r) = BesselJ(0, (-8*B*U*u+N*u)^(1/2)*r)*_C2+BesselY(0, (-8*B*U*u+N*u)^(1/2)*r)*_C1+64*P*(1+(r^2+1)*(B*U-(1/8)*N)^2*r^2*u^2+2*(B*U-(1/8)*N)*(r^2+1/4)*u)/(u^3*(8*B*U-N)^3)

(2)

``

ics := (D(T))(0) = 0

(D(T))(0) = 0

(3)

``

dsolve({M, ics})

T(r) = 64*P*(1+(r^2+1)*(B*U-(1/8)*N)^2*r^2*u^2+2*(B*U-(1/8)*N)*(r^2+1/4)*u)/(u^3*(8*B*U-N)^3)

(4)

``

 

Download nonhomogeneous_Solution.mwnonhomogeneous_Solution.mw

 

Hi everybody,

I want to solve this nonhomogeneous equation. Please tell me if it is true? I'm sure the BesselJ will not be disapper when the boundary condition is exerted... But the final solution showes the opposite one. BesselY must be disappear, because the boundary condition says in r=0, the solution is finite....

 

Thanks a lot.

 

sys := {diff(b(t),t) = 0,diff(c(t),t) = -b(t)/a(t)};
DEplot(sys, [b(t),c(t)], t=0..5, x=-5..5, y=-5..5);
Error, (in DEtools/DEplot) Option keyword (x) was not in the allowed set of options, consisting of: iterations, arrows, dirgrid, obsrange, scene, colour, linecolour, stepsize, a dependent variable range, a list of initial conditions or one of the allowed plot options: {animate, axes, color, colour, coords, font, scaling, style, symbol, title, view, animatecurves, animatefield, axesfont, dirfield, labelfont, linestyle, numframes, resolution, thickness, tickmarks, titlefont, xtickmarks, ytickmarks}, or one of the allowed dsolve/numeric options: {abserr, control, ctrl, initial, itask, maxder, maxfun, maxkop, maxord, maxpts, maxstep, method, mi..

diff(a(t), t) = diff(a(t), t);
diff(b(t),t) = 0;
diff(c(t),t) = -b(t)/a(t);

[diff(rhs(sol[1][2]), a(t)),diff(rhs(sol[1][2]), b(t)),diff(rhs(sol[1][2]), c(t))];
Error, (in VectorCalculus:-diff) invalid input: diff received a(t), which is not valid for its 2nd argument

 

 

First 1162 1163 1164 1165 1166 1167 1168 Last Page 1164 of 2434