pagan

5147 Reputation

23 Badges

17 years, 122 days

 

 

"A map that tried to pin down a sheep trail was just credible,

 but it was an optimistic map that tried to fix a the path made by the wind,

 or a path made across the grass by the shadow of flying birds."

                                                                 - _A Walk through H_, Peter Greenaway

 

MaplePrimes Activity


These are replies submitted by pagan

Is this closer to what you want?

restart:
with(plots):

plot3d([cos(t)*r,sin(t)*r,cos(t)*sin(t)*r^2], t=-Pi/2..0, r=-2*Pi..Pi,axes=boxed, labels=[x,y,z]);

Is this closer to what you want?

restart:
with(plots):

plot3d([cos(t)*r,sin(t)*r,cos(t)*sin(t)*r^2], t=-Pi/2..0, r=-2*Pi..Pi,axes=boxed, labels=[x,y,z]);

Notice that in your original example you have only the single parameter t. You can supply a second (dummy) argument to plot3d, r=-Pi..Pi, and get a plot. But it would just be a plot of the space curve that `spacecurve` produces (without that dummy argument), because your expressions for x,y, and z only contain the single parameter t.

Notice that in your original example you have only the single parameter t. You can supply a second (dummy) argument to plot3d, r=-Pi..Pi, and get a plot. But it would just be a plot of the space curve that `spacecurve` produces (without that dummy argument), because your expressions for x,y, and z only contain the single parameter t.

`is` by itself is not the correct test. First, you need to eval the equation at the solution. And second, you need to accomodate the fact that the result will be a floating-point approximation.

> eq1:=-2*C-B=0:
> eq2:=A-5*C=0:
> eq3:=5*B+2*A=0:
> eq4:=A^2+B^2+C^2-1=0:
> fsolve([eq2,eq3,eq4],{A=-1..1,B=-1..1,C=-1..1});
           {A = -0.9128709292, B = 0.3651483717, C = -0.1825741858}

> is(fnormal(eval(-2*C-B=0,%)));
                                     true

> fsolve([eq1,eq3,eq4],{A=-1..1,B=-1..1,C=-1..1});
           {A = -0.9128709292, B = 0.3651483717, C = -0.1825741858}

> fsolve([eq1,eq2,eq4],{A=-1..1,B=-1..1,C=-1..1});
           {A = -0.9128709292, B = 0.3651483717, C = -0.1825741858}

The first 3 equations are not independent.

> fsolve([eq1,eq2,eq3],{A=-1..1,B=-1..1,C=-1..1});
               {A = A, B = -0.4000000000 A, C = 0.2000000000 A}

It seems that fsolve is doing some symbolic manipulation to attain that last result. So perhaps it could be trained to attempt the following.

> fsolve([eq1,eq2,eq3],{A=-1..1,B=-1..1,C=-1..1});
               {A = A, B = -0.4000000000 A, C = 0.2000000000 A}

> fsolve({eq4} union remove(t->type(t,name=name),%),
>        {A=-1..1,B=-1..1,C=-1..1});;
           {A = -0.9128709292, B = 0.3651483717, C = -0.1825741858}

`is` by itself is not the correct test. First, you need to eval the equation at the solution. And second, you need to accomodate the fact that the result will be a floating-point approximation.

> eq1:=-2*C-B=0:
> eq2:=A-5*C=0:
> eq3:=5*B+2*A=0:
> eq4:=A^2+B^2+C^2-1=0:
> fsolve([eq2,eq3,eq4],{A=-1..1,B=-1..1,C=-1..1});
           {A = -0.9128709292, B = 0.3651483717, C = -0.1825741858}

> is(fnormal(eval(-2*C-B=0,%)));
                                     true

> fsolve([eq1,eq3,eq4],{A=-1..1,B=-1..1,C=-1..1});
           {A = -0.9128709292, B = 0.3651483717, C = -0.1825741858}

> fsolve([eq1,eq2,eq4],{A=-1..1,B=-1..1,C=-1..1});
           {A = -0.9128709292, B = 0.3651483717, C = -0.1825741858}

The first 3 equations are not independent.

> fsolve([eq1,eq2,eq3],{A=-1..1,B=-1..1,C=-1..1});
               {A = A, B = -0.4000000000 A, C = 0.2000000000 A}

It seems that fsolve is doing some symbolic manipulation to attain that last result. So perhaps it could be trained to attempt the following.

> fsolve([eq1,eq2,eq3],{A=-1..1,B=-1..1,C=-1..1});
               {A = A, B = -0.4000000000 A, C = 0.2000000000 A}

> fsolve({eq4} union remove(t->type(t,name=name),%),
>        {A=-1..1,B=-1..1,C=-1..1});;
           {A = -0.9128709292, B = 0.3651483717, C = -0.1825741858}

Please note the difference.

> cosh(x)(2+(2*1-1)*(2-(-2))/4); evalf(%);
                                  cosh(x)(3)
 
                                  cosh(x)(3)
 
> cosh(2+(2*1-1)*(2-(-2))/4); evalf(%);
                                    cosh(3)
 
                                  10.06766200

You passed cosh(x) as f in your example. But cosh(x) is not an operator, it as an application of the cosh operator to x.


Please note the difference.

> cosh(x)(2+(2*1-1)*(2-(-2))/4); evalf(%);
                                  cosh(x)(3)
 
                                  cosh(x)(3)
 
> cosh(2+(2*1-1)*(2-(-2))/4); evalf(%);
                                    cosh(3)
 
                                  10.06766200

You passed cosh(x) as f in your example. But cosh(x) is not an operator, it as an application of the cosh operator to x.


Thanks. Maybe a piecewise result could be returned for the more general symbolic case. Eg, piecewise(condz,5,condy,4,condx,3,...) where the conditions are built up as conjoined cases where a progressive number of coefficients of the minimal polynomial all vanish.

Thanks. Maybe a piecewise result could be returned for the more general symbolic case. Eg, piecewise(condz,5,condy,4,condx,3,...) where the conditions are built up as conjoined cases where a progressive number of coefficients of the minimal polynomial all vanish.

Do you really think that it is surprising, that you can find integers which approximate this over at least some range in this way? Could you please state the reasons for that surprise, based upon some explicit mathematics? (It is not to be found in other documents you've so far produced.)

In other news,

> printf("%g\n", evalf[100]( 239432496618343/10346816338556 - exp(Pi) ));
-8.58700e-29

What is handy?

> convert(PolynomialTools:-Split(x^2+5,x),radical);
                                   1/2       1/2
                          (x - (-5)   ) ((-5)    + x)

> normal(1/convert(convert(1/(x^2+5),fullparfrac),radical));
                                  1/2          1/2
                          -(-x + 5    I) (x + 5    I)

> convert(evala(AFactor(x^2+5)),radical);
                                   1/2       1/2
                          (x - (-5)   ) ((-5)    + x)

> mul(x-t,t=allvalues(RootOf(x^2+5,x)));
                                 1/2          1/2
                           (x + 5    I) (x - 5    I)

> mul(x-t,t=solve(x^2+5,x));
                                 1/2          1/2
                           (x + 5    I) (x - 5    I)

What is handy?

> convert(PolynomialTools:-Split(x^2+5,x),radical);
                                   1/2       1/2
                          (x - (-5)   ) ((-5)    + x)

> normal(1/convert(convert(1/(x^2+5),fullparfrac),radical));
                                  1/2          1/2
                          -(-x + 5    I) (x + 5    I)

> convert(evala(AFactor(x^2+5)),radical);
                                   1/2       1/2
                          (x - (-5)   ) ((-5)    + x)

> mul(x-t,t=allvalues(RootOf(x^2+5,x)));
                                 1/2          1/2
                           (x + 5    I) (x - 5    I)

> mul(x-t,t=solve(x^2+5,x));
                                 1/2          1/2
                           (x + 5    I) (x - 5    I)

It would make guessing the intended meaning easier if you supplied the missing pieces of the post.

> convert(1/(z^2+9),parfrac,I);
                               1/6 I      1/6 I
                              -------- + -------
                              -z + 3 I   z + 3 I
> normal(1/%);
                             -(-z + 3 I) (z + 3 I)

> factor(z^2+9,I);
                             -(-z + 3 I) (z + 3 I)
First 60 61 62 63 64 65 66 Last Page 62 of 81