acer

32358 Reputation

29 Badges

19 years, 331 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@gretchenp08@gmail.com Can you run the attached worksheet and get the same output?

I created this with Maple 14.01, as a Document with 2D Math input.

DEplot01.mw

@gretchenp08@gmail.com Can you run the attached worksheet and get the same output?

I created this with Maple 14.01, as a Document with 2D Math input.

DEplot01.mw

It would be interesting to know what grade Kitonum gets for completing a significant portion of the assignment.

acer

It would be interesting to know what grade Kitonum gets for completing a significant portion of the assignment.

acer

@elango8 I don't have DirectSearch installed, so don't have much to say about how uou might use it. But in my Answer above I showed that fsolve could reasonably quickly find solutions for a1..a6 and t, given a w (less than w_critical which drives a6 to zero, which I computed using `Q`).

@elango8 I don't have DirectSearch installed, so don't have much to say about how uou might use it. But in my Answer above I showed that fsolve could reasonably quickly find solutions for a1..a6 and t, given a w (less than w_critical which drives a6 to zero, which I computed using `Q`).

@Christopher2222 Well, this post was about rotating the whole view, and you seem to be asking about rotating objects. (If I've understood you, then this earlier post on more efficient rotation of GRID and MESH might pertain.)

This reminds me that there may be yet another efficient way (in recent versions of Maple) to get rotation of the whole plot (objects + axes). That is to use the ?plot3d,viewpoint option to control the path. It might look the same, for the observer to move in a particular path about the "plot" as it would be for the observer to stay fixed and have the orientation change dynamically.

So then we have a vector calculus computation, in general. Suppose that we want to animate a "rotation" (movement) of a plot, and using the `orientation` option we'd have a parameterization like,

orientation=[f(t),g(t),h(t)]

as a `plot3d` optional argument. Here the center is (0,0,0), I suppose. How shall we most naturally convert this to a `viewpoint` optional argument of another `plotd3` call?

This has almost as good performance as the third (best) version in the post above. But, what could a sequence of `upvectors` be instead, to get a view where the axes appear always tilted and pointing in the same direction (relative to the user!) like above?

restart:
st,ba:=time(),kernelopts(bytesalloc):
plot3d(1+x+1*x^2-1*y+1*y^2+1*x*y, x=-5..5, y=-5..5,
          axes=normal, labels=[x,y,z],
          viewpoint=[look = [0,0,0],
                     upvector=[0,0,1],
                     location=[seq([3000*cos(t),3000*sin(t),0],
                               t=0..evalf(2*Pi),.02)], fieldofview=0.4]);
time()-st,kernelopts(bytesalloc)-ba;

                         0.062, 2096768

@elango8 Sorry, but I don't understand exactly what you mean. Could you post whatever code that you're running, and show how it isn't doing what you need? Thanks.

@elango8 Sorry, but I don't understand exactly what you mean. Could you post whatever code that you're running, and show how it isn't doing what you need? Thanks.

At the risk of being a bore, I ought to mention that the performance improvements may depend on the actual example to be plotted.

That is to say, for a very expensive expression or procedure then the cost of computing the data for just the first frame would be much higher. And so the total time saved by not recomputing those numeric results for each and every subsequent frame would be much greater.

Also, the memory savings would depend on the resolution of each plotted frame, be that in terms of grid-size or number of points plotted, etc. The greater the resolution and data per frame, the greater the savings.

The timing and memory allocation for the given example might seem small and unimportant. But more costly 3D plotting examples do arise. Also, there is the matter of scaling. If we want Maple's plotting to scale up well (or, just better) to huge examples then we should always strive to improve performance when practical.

acer

That is not a full working answer (for the Standard GUI at least).

[deleted grumpy humbug on my part]

It just doesn't seem to work in Maple 13's Standard GUI. It produces a sequence of plots which don't vary as the animation counter changes -- it's just a static view of the first frame.

And it was already discussed that the Questioner had Maple 13 and that the problem depends on the release.

The problem also occurs for the programmatic `gif` plot-output and the `maplet` drivers in Maple 13 Standard.

It is possible that it would work in Maple 13's Classic GUI. But I cannot say for sure, as I don't have that installed right now (just using 64bit, without Classic).

It does work and successfully produce a working animation, using Christopher2222's suggestion of only 2 parameters for the orientation option, in the command-line interface (CLI) of Maple 13.02. (Well done, Christopher.) This suggests that it would work in the Maple 13.02 Classic interface as well, as that shares plot export facilities with the CLI.

acer

That is not a full working answer (for the Standard GUI at least).

[deleted grumpy humbug on my part]

It just doesn't seem to work in Maple 13's Standard GUI. It produces a sequence of plots which don't vary as the animation counter changes -- it's just a static view of the first frame.

And it was already discussed that the Questioner had Maple 13 and that the problem depends on the release.

The problem also occurs for the programmatic `gif` plot-output and the `maplet` drivers in Maple 13 Standard.

It is possible that it would work in Maple 13's Classic GUI. But I cannot say for sure, as I don't have that installed right now (just using 64bit, without Classic).

It does work and successfully produce a working animation, using Christopher2222's suggestion of only 2 parameters for the orientation option, in the command-line interface (CLI) of Maple 13.02. (Well done, Christopher.) This suggests that it would work in the Maple 13.02 Classic interface as well, as that shares plot export facilities with the CLI.

acer

I haven't given it much thought, but can ode and ode2 be coupled, and then solved more efficiently with dsolve(...,numeric) using its `parameters` functionality?

acer

restart:

wvals:=[1.2,1.6,2,2.5,3,3.5,4]:

S:=[seq({w=wvals[i]},i=1..7)]:

sys := {exp(-.1204819277*(2.4039*t+15.44745000*t^2-11.03552334*t^3+2.595300000*
t^4+.508258/t-44.6834-(2.40397*ln(t)+30.8949*t-16.55325000*t^2+3.460399999*t^3+.2541195000/t^2
-49.812126)*t)/t)*a2*a4-a1*a3, exp(-.1204819277*(-2.071844454/t+.3999293136/t^2+2.897999999*
t^3-0.2404762368e-1/t^3-6.278629824*t^2+1.49670934*t-.7274250000*t^4+4.532401680*ln(1000*t)
+4.532401680*ln(298)+134.6934679-(-4.532276160/t-1.035931727/t^2-.9699000000*
t^3+.2666044800/t^3+4.347000000*t^2-12.55719488*t-0.1794936000e-1/t^4-27.04489066*ln(1000*t)
+27.04489066*ln(298)+28.54167*ln(t)+190.6774129)*t)/t)*a4*((1/2)*a1+(1/2)*a2+(1/2)*a3+(1/2)*
a4+(1/2)*a5)-a1*a2, (1/4)*exp(-.1204819277*(95.3768*t-71.65195000*t^2+24.69369999*t^3
-3.579500000*t^4+1.105339/t+179.76736-(95.37701*ln(t)-143.3039*t+37.04055000*t^2-4.772666666*
t^3+.5525695000/t^2+363.377422)*t)/t)*(a1+a2+a3+a4+a5)^2*a5*a4-a1^3*a2, 2*a1+2*a4+4*a5-1.6-2*
w, a2+a3+a5+a6-1, a2+2*a3+a4-.77-w, -202.86-180.476*w-a1*(33.0661*t-5.681700000*
t^2+3.810933333*t^3-.6932000000*t^4+.158558/t-9.9807)-a2*(25.5675*t+3.048050000*
t^2+1.351533333*t^3-.6678250000*t^4-.1310/t-118.0118)-a3*(24.9973*t+27.59345000*t^2
-11.23045667*t^3+1.987075000*t^4+.1366/t-403.5951)-a4*(30.092*t+3.416250000*t^2+2.264466667*
t^3-.6336000000*t^4-0.821e-1/t-250.8806)-a5*(-.703*t+54.23865000*t^2-14.17383333*
t^3+1.465675000*t^4-.678565/t-76.84066)-a6*(27.04489066*t+.2287298242*t^2-4.532401680*ln(1000*
t)+2.181502454/t-.3999293136/t^2+0.2404762368e-1/t^3-11.80536790-4.532401680*ln(298))}:

Q:=proc(W)
option remember;
local sol;
   sol:=fsolve(eval(sys,w=W),{a1=0..5,a2=0..5,a3=0..5,a4=0..5,
                              a5=0..0.01,a6=0..1,t=0..10});
   if type(sol,specfunc(anything,fsolve)) then return infinity; end if;
   userinfo(1,Q,`w: `,SFloat(W),` a6: `,eval(a6,sol));
   eval(a6,sol);
end proc:

infolevel[Q]:=1:
seq(Q(W), W=wvals);

Q: w:  1.2  a6:  .7517956383
Q: w:  1.6  a6:  .6785304588
Q: w:  2.  a6:  .6048390436
Q: w:  2.5  a6:  .5123765780
Q: w:  3.  a6:  .4196778172
Q: w:  3.5  a6:  .3268293547
Q: w:  4.  a6:  .2338801069

    0.7517956383, 0.6785304588, 0.6048390436, 0.5123765780, 

      0.4196778172, 0.3268293547, 0.2338801069

Digits:=25:
#infolevel[Q]:=0:
bestw:=Optimization:-Minimize(w->Q(w)^2, 4.0..5.5, evaluationlimit=1000);

Q: w:  4.750000000000000000000000  a6:  0.9432920823737770920383573e-1
Q: w:  4.6000000000000000330  a6:  .1222489966063624783865032
Q: w:  4.8999999999999999670  a6:  0.6640540360969581612635774e-1
Q: w:  5.1999999999999999835  a6:  0.1054699500801678343604655e-1
Q: w:  5.207462449804077120503378  a6:  0.9157357390875404820782231e-2
Q: w:  5.217053042742124003482895  a6:  0.7371411210113695352313544e-2
Q: w:  5.226810877117608229829761  a6:  0.5554308483958523215588129e-2
Q: w:  5.235359085728641370834348  a6:  0.3962451322739621103744091e-2
Q: w:  5.242122633590410804178822  a6:  0.2702928607649564905334537e-2
Q: w:  5.247098435625523355564968  a6:  0.1776319841750556792206673e-2
Q: w:  5.250566106592425147856027  a6:  0.1130557763443463589611914e-2
Q: w:  5.252884282731984909057095  a6:  0.6988578051239328936689900e-3
Q: w:  5.254383967095018246723003  a6:  0.4195802431188276069159383e-3
Q: w:  5.255328797107586247545547  a6:  0.2436298468071556057656181e-3
Q: w:  5.255911244193198125923985  a6:  0.1351639309075331254300514e-3
Q: w:  5.256263832572096252520510  a6:  0.6950331478014708798835004e-4
Q: w:  5.256474016927888983822312  a6:  0.3036181732445063492170901e-4
Q: w:  5.256597672194150296093724  a6:  0.7334162097749632411748103e-5
Q: w:  5.256605163889973413359217  a6:  0.5939023807664598330459472e-5
Q: w:  5.256612892461751190231369  a6:  0.4499773372343510584122660e-5
Q: w:  5.256619725229378462722800  a6:  0.3227343728548901476691799e-5
Q: w:  5.256625166154515951144404  a6:  0.2214109437077906051483203e-5
Q: w:  5.256629187652926055280815  a6:  0.1465207365589411599266267e-5
Q: w:  5.256632000173841209782138  a6:  0.9414466848882062288426848e-6
Q: w:  5.256633885551984153117712  a6:  0.5903428278826666356849762e-6
Q: w:  5.256635107928129012022444  a6:  0.3627062758920563138299327e-6
Q: w:  5.256635879426013942357952  a6:  0.2190343633960873090688642e-6
Q: w:  5.256636355725876141421800  a6:  0.1303355950760237162773895e-6
Q: w:  5.256636644416356515002338  a6:  0.7657431552455497703954369e-7
Q: w:  5.256636816692452974310978  a6:  0.4449226220794789254696128e-7
Q: w:  5.256636918138089384772480  a6:  0.2560058551412829082784443e-7
Q: w:  5.256636977190863453382295  a6:  0.1460350416970467037616338e-7
Q: w:  5.256637011222506828774813  a6:  0.8265973775933530203568246e-8
Q: w:  5.256637030662054626898215  a6:  0.4645851066747551300755468e-8
Q: w:  5.256637041679662147121867  a6:  0.2594101118677601899145947e-8
Q: w:  5.256637047880554713273803  a6:  0.1439342158774916548616673e-8
Q: w:  5.256637051348714616551256  a6:  0.7934853438124990315636785e-9
Q: w:  5.256637053277523293635290  a6:  0.4342936503503359042384550e-9
Q: w:  5.256637054344744765058769  a6:  0.2355507204918190327542489e-9
Q: w:  5.256637054932498065326818  a6:  0.1260965761954674033113475e-9
Q: w:  5.256637055254816459292479  a6:  0.6607295066004139848471163e-10
Q: w:  5.256637055306536219279970  a6:  0.5644145719150079662863247e-10
Q: w:  5.256637055346633610854782  a6:  0.4897433504801449213808810e-10
Q: w:  5.256637055375694729140130  a6:  0.4356243887870340262522906e-10
Q: w:  5.256637055395718731932851  a6:  0.3983347625090165864130435e-10
Q: w:  5.256637055408986514455987  a6:  0.3736268828234876813655990e-10
Q: w:  5.256637055417508872121442  a6:  0.3577561532973973494655039e-10
Q: w:  5.256637055422846989761947  a6:  0.3478152631615522985267680e-10
Q: w:  5.256637055426121855543666  a6:  0.3417166562858644645872149e-10
Q: w:  5.256637055426438088566320  a6:  0.3411277524910528662345077e-10

      [                             -21                              ]
      [1.163681435195970249846016 10   , [5.256637055426438088566320]]

fsolve(eval(sys,w=bestw[2][1]),{a1=0..5,a2=0..5,a3=0..5,a4=0..5,
                              a5=0..0.01,a6=0..1,t=0..10});

            /                                 
           { a1 = 1.744892730385765416291333, 
            \                                 

             a2 = 0.2846704517694181108534820, 

             a3 = 0.7152203437523213833081690, 

             a4 = 4.311525916152377211096500, 

             a5 = 0.0001092044441477305892437208, 

                                               -11  
             a6 = 3.411277524910528662345077 10   , 

                                           \ 
             t = 1.091241531285591797803840 }
                                           / 

Digits:=10:
infolevel[Q]:=0:
plot(Q,4..5.5,numpoints=20);

So, without add-ons and using only stock routines from Maple, it doesn't seem very hard to establish that the w which approximately drives a6 to zero is about,

evalf[12](bestw[2][1]);
                         5.25663705543

acer

restart:

wvals:=[1.2,1.6,2,2.5,3,3.5,4]:

S:=[seq({w=wvals[i]},i=1..7)]:

sys := {exp(-.1204819277*(2.4039*t+15.44745000*t^2-11.03552334*t^3+2.595300000*
t^4+.508258/t-44.6834-(2.40397*ln(t)+30.8949*t-16.55325000*t^2+3.460399999*t^3+.2541195000/t^2
-49.812126)*t)/t)*a2*a4-a1*a3, exp(-.1204819277*(-2.071844454/t+.3999293136/t^2+2.897999999*
t^3-0.2404762368e-1/t^3-6.278629824*t^2+1.49670934*t-.7274250000*t^4+4.532401680*ln(1000*t)
+4.532401680*ln(298)+134.6934679-(-4.532276160/t-1.035931727/t^2-.9699000000*
t^3+.2666044800/t^3+4.347000000*t^2-12.55719488*t-0.1794936000e-1/t^4-27.04489066*ln(1000*t)
+27.04489066*ln(298)+28.54167*ln(t)+190.6774129)*t)/t)*a4*((1/2)*a1+(1/2)*a2+(1/2)*a3+(1/2)*
a4+(1/2)*a5)-a1*a2, (1/4)*exp(-.1204819277*(95.3768*t-71.65195000*t^2+24.69369999*t^3
-3.579500000*t^4+1.105339/t+179.76736-(95.37701*ln(t)-143.3039*t+37.04055000*t^2-4.772666666*
t^3+.5525695000/t^2+363.377422)*t)/t)*(a1+a2+a3+a4+a5)^2*a5*a4-a1^3*a2, 2*a1+2*a4+4*a5-1.6-2*
w, a2+a3+a5+a6-1, a2+2*a3+a4-.77-w, -202.86-180.476*w-a1*(33.0661*t-5.681700000*
t^2+3.810933333*t^3-.6932000000*t^4+.158558/t-9.9807)-a2*(25.5675*t+3.048050000*
t^2+1.351533333*t^3-.6678250000*t^4-.1310/t-118.0118)-a3*(24.9973*t+27.59345000*t^2
-11.23045667*t^3+1.987075000*t^4+.1366/t-403.5951)-a4*(30.092*t+3.416250000*t^2+2.264466667*
t^3-.6336000000*t^4-0.821e-1/t-250.8806)-a5*(-.703*t+54.23865000*t^2-14.17383333*
t^3+1.465675000*t^4-.678565/t-76.84066)-a6*(27.04489066*t+.2287298242*t^2-4.532401680*ln(1000*
t)+2.181502454/t-.3999293136/t^2+0.2404762368e-1/t^3-11.80536790-4.532401680*ln(298))}:

Q:=proc(W)
option remember;
local sol;
   sol:=fsolve(eval(sys,w=W),{a1=0..5,a2=0..5,a3=0..5,a4=0..5,
                              a5=0..0.01,a6=0..1,t=0..10});
   if type(sol,specfunc(anything,fsolve)) then return infinity; end if;
   userinfo(1,Q,`w: `,SFloat(W),` a6: `,eval(a6,sol));
   eval(a6,sol);
end proc:

infolevel[Q]:=1:
seq(Q(W), W=wvals);

Q: w:  1.2  a6:  .7517956383
Q: w:  1.6  a6:  .6785304588
Q: w:  2.  a6:  .6048390436
Q: w:  2.5  a6:  .5123765780
Q: w:  3.  a6:  .4196778172
Q: w:  3.5  a6:  .3268293547
Q: w:  4.  a6:  .2338801069

    0.7517956383, 0.6785304588, 0.6048390436, 0.5123765780, 

      0.4196778172, 0.3268293547, 0.2338801069

Digits:=25:
#infolevel[Q]:=0:
bestw:=Optimization:-Minimize(w->Q(w)^2, 4.0..5.5, evaluationlimit=1000);

Q: w:  4.750000000000000000000000  a6:  0.9432920823737770920383573e-1
Q: w:  4.6000000000000000330  a6:  .1222489966063624783865032
Q: w:  4.8999999999999999670  a6:  0.6640540360969581612635774e-1
Q: w:  5.1999999999999999835  a6:  0.1054699500801678343604655e-1
Q: w:  5.207462449804077120503378  a6:  0.9157357390875404820782231e-2
Q: w:  5.217053042742124003482895  a6:  0.7371411210113695352313544e-2
Q: w:  5.226810877117608229829761  a6:  0.5554308483958523215588129e-2
Q: w:  5.235359085728641370834348  a6:  0.3962451322739621103744091e-2
Q: w:  5.242122633590410804178822  a6:  0.2702928607649564905334537e-2
Q: w:  5.247098435625523355564968  a6:  0.1776319841750556792206673e-2
Q: w:  5.250566106592425147856027  a6:  0.1130557763443463589611914e-2
Q: w:  5.252884282731984909057095  a6:  0.6988578051239328936689900e-3
Q: w:  5.254383967095018246723003  a6:  0.4195802431188276069159383e-3
Q: w:  5.255328797107586247545547  a6:  0.2436298468071556057656181e-3
Q: w:  5.255911244193198125923985  a6:  0.1351639309075331254300514e-3
Q: w:  5.256263832572096252520510  a6:  0.6950331478014708798835004e-4
Q: w:  5.256474016927888983822312  a6:  0.3036181732445063492170901e-4
Q: w:  5.256597672194150296093724  a6:  0.7334162097749632411748103e-5
Q: w:  5.256605163889973413359217  a6:  0.5939023807664598330459472e-5
Q: w:  5.256612892461751190231369  a6:  0.4499773372343510584122660e-5
Q: w:  5.256619725229378462722800  a6:  0.3227343728548901476691799e-5
Q: w:  5.256625166154515951144404  a6:  0.2214109437077906051483203e-5
Q: w:  5.256629187652926055280815  a6:  0.1465207365589411599266267e-5
Q: w:  5.256632000173841209782138  a6:  0.9414466848882062288426848e-6
Q: w:  5.256633885551984153117712  a6:  0.5903428278826666356849762e-6
Q: w:  5.256635107928129012022444  a6:  0.3627062758920563138299327e-6
Q: w:  5.256635879426013942357952  a6:  0.2190343633960873090688642e-6
Q: w:  5.256636355725876141421800  a6:  0.1303355950760237162773895e-6
Q: w:  5.256636644416356515002338  a6:  0.7657431552455497703954369e-7
Q: w:  5.256636816692452974310978  a6:  0.4449226220794789254696128e-7
Q: w:  5.256636918138089384772480  a6:  0.2560058551412829082784443e-7
Q: w:  5.256636977190863453382295  a6:  0.1460350416970467037616338e-7
Q: w:  5.256637011222506828774813  a6:  0.8265973775933530203568246e-8
Q: w:  5.256637030662054626898215  a6:  0.4645851066747551300755468e-8
Q: w:  5.256637041679662147121867  a6:  0.2594101118677601899145947e-8
Q: w:  5.256637047880554713273803  a6:  0.1439342158774916548616673e-8
Q: w:  5.256637051348714616551256  a6:  0.7934853438124990315636785e-9
Q: w:  5.256637053277523293635290  a6:  0.4342936503503359042384550e-9
Q: w:  5.256637054344744765058769  a6:  0.2355507204918190327542489e-9
Q: w:  5.256637054932498065326818  a6:  0.1260965761954674033113475e-9
Q: w:  5.256637055254816459292479  a6:  0.6607295066004139848471163e-10
Q: w:  5.256637055306536219279970  a6:  0.5644145719150079662863247e-10
Q: w:  5.256637055346633610854782  a6:  0.4897433504801449213808810e-10
Q: w:  5.256637055375694729140130  a6:  0.4356243887870340262522906e-10
Q: w:  5.256637055395718731932851  a6:  0.3983347625090165864130435e-10
Q: w:  5.256637055408986514455987  a6:  0.3736268828234876813655990e-10
Q: w:  5.256637055417508872121442  a6:  0.3577561532973973494655039e-10
Q: w:  5.256637055422846989761947  a6:  0.3478152631615522985267680e-10
Q: w:  5.256637055426121855543666  a6:  0.3417166562858644645872149e-10
Q: w:  5.256637055426438088566320  a6:  0.3411277524910528662345077e-10

      [                             -21                              ]
      [1.163681435195970249846016 10   , [5.256637055426438088566320]]

fsolve(eval(sys,w=bestw[2][1]),{a1=0..5,a2=0..5,a3=0..5,a4=0..5,
                              a5=0..0.01,a6=0..1,t=0..10});

            /                                 
           { a1 = 1.744892730385765416291333, 
            \                                 

             a2 = 0.2846704517694181108534820, 

             a3 = 0.7152203437523213833081690, 

             a4 = 4.311525916152377211096500, 

             a5 = 0.0001092044441477305892437208, 

                                               -11  
             a6 = 3.411277524910528662345077 10   , 

                                           \ 
             t = 1.091241531285591797803840 }
                                           / 

Digits:=10:
infolevel[Q]:=0:
plot(Q,4..5.5,numpoints=20);

So, without add-ons and using only stock routines from Maple, it doesn't seem very hard to establish that the w which approximately drives a6 to zero is about,

evalf[12](bestw[2][1]);
                         5.25663705543

acer

First 416 417 418 419 420 421 422 Last Page 418 of 592