Robert Israel

6522 Reputation

21 Badges

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

MaplePrimes Activity


These are answers submitted by Robert Israel

Not surprisingly, Maple does not find a closed-form solution for your differential equations. All it can do is reduce the two first-order equations to a single, very complicated, second-order equation. This is of no help in terms of plotting.
Just one thing to correct in Doug's comment: the name of the package is "plots", not "Plots". As usual, Maple is case-sensitive.
Yes, "Solve DE Interactively" is nice, but as for the original question... I really don't see what is the use of the initialcondition command, whether executed from the context menu or entered directly. Who needs a command to insert an equation (D@@n0)(y)(0)=0? The n0 on the left side will certainly have to be changed to make this usable, and possibly both 0's will need to be changed if this isn't the initial condition you had in mind. So wouldn't it be simpler to just type in the initial condition by hand?
"if" is not the same as "if and only if". If y = 2, then y^2 = 4. If y^2 = 4, then y could be 2, but it also could be -2.
I'm not quite sure what you mean by "choppy": it may simply be the limited resolution of your screen. If you look closely, a nearly vertical curve will appear to be made up of vertical segments with one-pixel "steps". There is no real cure for this, but you can improve it by making the plot wider, using a smaller interval for x, or getting a screen with higher resolution.
Suppose your surfaces S1 and S2 are given by equations f1(x,y,z) = 0 and f2(x,y,z) = 0. Given x and y, consider maximizing (or minimizing) z = z1*z2 subject to constraints f1(x1,y1,z1) = 0 and f2(x/x1, y/y1, z2) = 0. It's a nonlinear constrained optimization problem. We might hope to do it using Maximize or Minimize in the Optimization package. Unfortunately, this didn't work as well as I had hoped in the examples I tried. First of all, Optimization doesn't like nondifferentiable functions, so I smoothed out max. Also, it turned out to be better to not try to deal with both positive and negative values of the variables in the same call, so here's just part of the surface.
> ma:= (a,b) -> (a+b + sqrt((a-b)^2 + 1e-6))/2;
  f1:= (x,y,z) -> ma(z,x+y) - 1;
  f2:= (x,y,z) -> ma(y,x+z) - 1;
  G:= proc(xp,yp) 
    local R; 
    R:= traperror(Maximize(z1*z2, {f1(x1,y1,z1)=0,   
     f2(xp/x1,yp/y1,z2)=0}, x1=xp .. 1, y1 = yp .. 1, 
     z1 = 0 .. 1, z2 = 0 .. 1));
    if type(R,list) then R[1] else undefined end if
 end; 
  plot3d(G, 0..1, 0..1,axes=box);
I doubt that there is any such function. AFAIK Export to HTML is available only from the menus.
I don't see why PB(S1,S2) should be composed of surfaces: it should be a solid (generically), even if S1 is a surface and S2 is a curve. Perhaps you're talking about the boundary of PB(S1,S2). And surely it's a mistake to use
PTS12 := zip( (v,w)->[v[1]*w[1],v[2]*w[2],v[3]*w[3]], PTS1, PTS2 ): 
because this only pairs up each point of PTS1 with one corresponding point of PTS2. You really should consider all pairs in PTS1 x PTS2. BTW, the code for your attempt to extract the points from an implicitplot3d was garbled, due to the blog's problem with < and >.
What I suspect you're trying to do is multivariate regression. The Statistics package contains several commands for doing this, in particular "Fit" which lets you fit an arbitrary (linear or nonlinear) model to your data.
As Paulina said, it would be easier if we could see the exact input, but my suspicion is that for some values of the variables your deltasolved(alpha,beta,Omega) returns either no solution or more than one. That would certainly mess up the transform. I don't understand what you mean about "It should all be on one line", and I don't think it's a good idea to call solve each time you need to transform a point, if you can avoid that. If you know g (explicitly) then use g. If there isn't a closed-form expression for g, you should use fsolve rather than solve. If fsolve doesn't always work [in particular if g is not everywhere defined], you'll want to use a "wrapper" for fsolve that will return undefined when fsolve doesn't return a numerical result.
As you say, in general these equations have no algebraic solution (and in fact no closed-form solution) for p. To do it numerically (for particular values of the other variables), use fsolve. For example:
eq1:= 2^(1-p)+(1-x)^(1-p)/(1-p)=2;
fsolve(eval(eq1, x=0.9));

     .1073785840
Or more simply
> map(f, A);
I'm coming into this discussion late, but why not just do it this way?
> A:= Array([ 2*i $ i=1..10 ]);

  A[[3*i $ i=1..floor(rhs(ArrayDims(A))/3)]];
or
> A[select(t-> (t mod 3 = 0), [$ArrayDims(A)])];
Standard plot3d with cylindrical coordinates gives you height as a function of radius and angle. You want to use a parametric plot3d.
> plot3d([3,angle,height], angle=0 .. 2*Pi, 
    height = 0 .. cos(angle)+2, coords=cylindrical, axes=boxed,
    labels=["","",""]);
Note: without specifying the labels option, you get "angle" and "height" on the x and y axes. This is a bug.
.m is a special file format that is not human-readable. Saving as .mpl (or really, any extension other than .m) gives you just an ordinary text file consisting of Maple commands. The .m files may be somewhat smaller and perhaps faster to read, but for casual use I don't think there are very significant advantages in using the .m format.
First 133 134 135 136 137 138 Page 135 of 138