Robert Israel

6577 Reputation

21 Badges

18 years, 215 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are answers submitted by Robert Israel

DEplot wants the initial conditions, not the solution.  You also have to tell it the variables to plot.

> DEplot(deq, v(t), t = 0 .. 10, [[ics11],[ ics12], [ics13]], 
      linecolour=[red,green,blue]);

If you want arrows (i.e. a direction field), that requires converting your second order differential equation into a system of two autonomous first order equations.

> sys:= [D(v)(t)=p(t), D(p)(t) = -p(t) - v(t)];
   DEplot(sys, [v(t), p(t)], t = 0 .. 10, 
       subs(D(v)=p, [[ics11],[ics13]]),
       colour=blue, linecolour=[red,green], arrows=MEDIUM);

 

 

If there's no friction in the pulleys, and the ropes themselves are massless, then the tension in all parts of the rope must be the same.  Note also that there are two pieces or rope pulling on m1, and the total length of rope is 2*x1(t) + x2(t) + constant.  So your equations should be:

(for mass m1): m1*diff(x1(t),t$2) = m1*g - 2*T

(for mass m2): m2*diff(x2(t),t$2) = m2*g - T

(the rope doesn't extend) 2*x1(t) + x2(t) = C.

Substituting x2(t) = C - 2*x1(t) in the second equation:

-2*m2*(diff(x1(t), t, t)) = m2*g-T

Eliminating T between this and the first equation:

(diff(x1(t), t, t))*(m1+4*m2) = g*(m1-2*m2)

 etc...

If you click on a 2D plot, the plot toolbar should show the (cartesian) coordinates of the current position of the cursor. 

One of the new features of Maple 12 is the ability to have Maple capture those coordinates from an embedded Plot component.  That takes some work to set up.  For example:

Insert a Plot component from the Components palette. 

Right-click the Plot component and select Component Properties

In the Plot Expression field, enter some 2D plotting command, e.g.

   plot([(t+1)*cos(t),(t+1)*sin(t), t = -2*Pi .. 2*Pi]);  

Click on the check box for  "Make "execute code" the default manipulator".

Click on the Edit button for "Action When Clicked".  Before the "end use;" enter

  Do( P = [%Plot0(clickx), %Plot0(clicky)]);

(assuming the name of this Plot component, as shown in Component Properties, is Plot0).

Click OK to accept this edit, and OK again to accept all changes.

Now after clicking on a point in the plot, the variable P should contain the x and y coordinates of the point where you clicked.

I think what you mean is something like this:

 

>  V := [seq(plot([[subs(t = (1/40)*sol[2]*k, xp), 0], 
   [subs(t = (1/40)*sol[2]*k, xp), subs(t = (1/40)*sol[2]*k, yp)], 
   [0, subs(t = (1/40)*sol[2]*k, yp)]], 
     colour = green), k = 0 .. 40)]: 

 

I assume your Match1 should be -k1*D[1](T1)(L1,t) = -k2*D[1](T2)(L1,t).

A change of spatial variable would be helpful here.  Let x = k1*z for 0 < z <= L1,
k1*L1 + k2*(z-L1) for L1 < z < L1+L2.  Then the match condition is just that T and its first derivative wrt x are continuous across the boundary.  The PDE is

diff(T(x,t),t) = u(x)*diff(T(x,t),x$2)

with u(x) = piecewise(x<k1*L1, k1^3/(rho1*Cp1), k2^3/(rho2*Cp2))

and boundary conditions D[1](T)(0,t) = 0, - D[2](T)(k1*L1+k2*L2) = qs.

pdsolve(..., numeric) ought to work (assuming all parameters are given numerical values.

Write the second equation as 2 y (1 + z) = 0,  So either y = 0 or z = -1.

But z=-1 doesn't work in the first equation (it would become 6 = 0).

Now substitute y=0 in the third equation, solve the resulting quadratic for x, and go back to the first equation...

 

Lists (i.e. square brackets) work with expressions as well as functions.

> plot([z,fr(z),ff(z)],z=0..1,legend=[front,rear,ideal]);

Your function is given by two cubic polynomials, on for x <= 20 and the other for 20 < x <= r where r is a point where the second polynomial is 0.  You don't say what the function should be for x > r.  The function is not one-to-one, but its restriction to the interval [20/3*(1-sqrt(13)), r] is one-to-one, so I assume that's what you want the inverse of.

> f1 := 100-3*x-3/80*x^2+3/1600*x^3;
   f2 := 1495/16-201/64*x+33/1280*x^2-3/25600*x^3;
   r := fsolve(f2 = 0);
> x1 := 20/3*(1-sqrt(13));
   y1 := simplify(eval(f1, x = x1));
   y2 := eval(f1,x=20);
> S1 := simplify(evalc([solve(f1=y,x)])) assuming y>y2, y<y1;

S1 := [40/3*13^(1/2)*cos(1/3*arctan(300*(-31600+1420*y-9*y^2)^(1/2),-71000+900*y))+20/3, -20/3*13^(1/2)*cos(1/3*arctan(300*(-31600+1420*y-9*y^2)^(1/2),-71000+900*y))+20/3-20/3*3^(1/2)*13^(1/2)*sin(1/3*arctan(300*(-31600+1420*y-9*y^2)^(1/2),-71000+900*y)), -20/3*13^(1/2)*cos(1/3*arctan(300*(-31600+1420*y-9*y^2)^(1/2),-71000+900*y))+20/3+20/3*3^(1/2)*13^(1/2)*sin(1/3*arctan(300*(-31600+1420*y-9*y^2)^(1/2),-71000+900*y))]

> evalf(eval(S1,y=y2));

[39.99999999, -40.00000000, 20.00000000]

Oops, there goes the <maple> tag again: that should be [39.99999999, -40.00000000, 20.00000000].

So we want the third branch of the solution.

> S2 := simplify(evalc([solve(f2=y,x)])) assuming y<y2,y>0;
> evalf(eval(S2, y=y2));

[20.00000006, 99.99999999-113.1370850*I, 99.99999999+113.1370850*I]

That should be [20.00000006, 99.99999999-113.1370850*I, 99.99999999+113.1370850*I].

So we want the first branch of this solution.

> finverse:= piecewise(y <= y2, S2[1], y <= y1, S1[3]);

finverse := PIECEWISE([-4/3*(2*(10000+225*y+75*(40000+800*y+9*y^2)^(1/2))^(2/3)-1000-55*(10000+225*y+75*(40000+800*y+9*y^2)^(1/2))^(1/3))/(10000+225*y+75*(40000+800*y+9*y^2)^(1/2))^(1/3), y <= 40],[-20/3*13^(1/2)*cos(1/3*arctan(300*(-31600+1420*y-9*y^2)^(1/2),-71000+900*y))+20/3+20/3*3^(1/2)*13^(1/2)*sin(1/3*arctan(300*(-31600+1420*y-9*y^2)^(1/2),-71000+900*y)), y <= 710/9+130/9*13^(1/2)])

 

 

 

> W:= eval(exp(sqrt(1+z^(-2)))/(z*(1+sqrt(1+z^(-2)))),z=x+I*y);

> plots[implicitplot](abs(W)=1, x=-2..2, y=-2..2, gridrefine=3);

I don't know what you find confusing, but these are not linear equations.

> sys := { 2*x + z*(2*x-6) = 0, 2*y + 2*y*z = 0, x^2 - 6*x + y^2 = -23};
> solve(sys);

{x = RootOf(_Z^2-6*_Z+23), y = 0, z = 3/14*RootOf(_Z^2-6*_Z+23)-23/14}

> allvalues(%);

{x = 3+14^(1/2)*I, y = 0, z = -1+3/14*I*14^(1/2)}, {x = 3-I*14^(1/2), y = 0, z = -1-3/14*I*14^(1/2)}

> E1 := x^2-y = 5; E2 := x-y^2 = -13;
> S:= [solve({E1,E2},{x,y})];

S := [{y = 4, x = 3}, {x = RootOf(_Z^3+3*_Z^2-_Z-4,label = _L1), y = RootOf(_Z^3+3*_Z^2-_Z-4,label = _L1)^2-5}]

> allvalues(S[2]);

{x = 1/6*(108+12*I*687^(1/2))^(1/3)+8/(108+12*I*687^(1/2))^(1/3)-1, y = (1/6*(108+12*I*687^(1/2))^(1/3)+8/(108+12*I*687^(1/2))^(1/3)-1)^2-5},
{y = (-1/12*(108+12*I*687^(1/2))^(1/3)-4/(108+12*I*687^(1/2))^(1/3)-1-1/2*I*3^(1/2)*(1/6*(108+12*I*687^(1/2))^(1/3)-8/(108+12*I*687^(1/2))^(1/3)))^2-5, x = -1/12*(108+12*I*687^(1/2))^(1/3)-4/(108+12*I*687^(1/2))^(1/3)-1-1/2*I*3^(1/2)*(1/6*(108+12*I*687^(1/2))^(1/3)-8/(108+12*I*687^(1/2))^(1/3))}

,

{y = (-1/12*(108+12*I*687^(1/2))^(1/3)-4/(108+12*I*687^(1/2))^(1/3)-1+1/2*I*3^(1/2)*(1/6*(108+12*I*687^(1/2))^(1/3)-8/(108+12*I*687^(1/2))^(1/3)))^2-5, x = -1/12*(108+12*I*687^(1/2))^(1/3)-4/(108+12*I*687^(1/2))^(1/3)-1+1/2*I*3^(1/2)*(1/6*(108+12*I*687^(1/2))^(1/3)-8/(108+12*I*687^(1/2))^(1/3))}

 > simplify(evalc([%]));

[{x = 4/3*3^(1/2)*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))-1, y = -4-8/3*3^(1/2)*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))+16/3*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))^2}, {y = 4/3*3^(1/2)*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))-4*sin(1/3*arctan(1/9*3^(1/2)*229^(1/2)))-8/3*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))^2-8/3*3^(1/2)*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))*sin(1/3*arctan(1/9*3^(1/2)*229^(1/2))), x = -2/3*3^(1/2)*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))-1+2*sin(1/3*arctan(1/9*3^(1/2)*229^(1/2)))}, {y = -8/3*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))^2+8/3*3^(1/2)*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))*sin(1/3*arctan(1/9*3^(1/2)*229^(1/2)))+4*sin(1/3*arctan(1/9*3^(1/2)*229^(1/2)))+4/3*3^(1/2)*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2))), x = -2/3*3^(1/2)*cos(1/3*arctan(1/9*3^(1/2)*229^(1/2)))-1-2*sin(1/3*arctan(1/9*3^(1/2)*229^(1/2)))}]

> evalf(%);

[{x = 1.114907542, y = -3.756981177}, {x = -1.254101689, y = -3.427228957}, {y = 3.184210131, x = -2.860805853}]

Delimiters are things such as [ and ] or ( and ) that should always occur in matched pairs.  For example, in 2D math input, the following will produce an "unable to match delimiters" error, because there is no "(" to match the ")":

> 3 + 5);

If you still can't find the error, post your actual code, and we should be able to spot it.

I assume your v(t) is supposed to be the same as dx(t).

Your initcond contains cost(theta) ,  which I assume is supposed to be cos(theta).

You need to replace the commas with colons or semicolons in
h:=1,v0:=25,theta:=15,w:=20:eta:=1:

After correcting these errors, it works for me.

Take another look at what I said. 

What's the region where f(x,y) > 0? 

What's the region where f(x,y) < 0? 

 

With F(t,x,x') = (x')^2/t^3, the Euler-Lagrange equation is
0 = diff(2 x'/t^3, t), i.e. 2 x''/t^3 - 6 x'/t^4 = 0. 

> dsolve({2*(D@@2)(x)(t)/t^3 - 6*D(x)(t)/t^4 = 0, 
     x(1) = 2, x(2) = 17});

x(t) = 1+t^4

The <maple> tag is still broken: that should be

x(t) = 1 + t^4
 

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