Christopher2222

MaplePrimes Activity


These are replies submitted by Christopher2222

I've partially fixed my issue but still I have a problem with your module in M12

Astronomy:=module() option package;
export GetConstant,GetValue,GetError,GetUnit,Constant;
local ModuleLoad;
   ModuleLoad:=proc()
      ScientificConstants:-AddConstant(':-mass_of_Jupiter',
                                       'symbol'=':-MJupiter',
                                       'value'=1.90e27,'units'=':-kg')
   end proc:
   Constant:=ScientificConstants[Constant];
   GetConstant:=ScientificConstants[GetConstant];
   GetValue:=ScientificConstants[GetValue];
   GetError:=ScientificConstants[GetError];
   GetUnit:=ScientificConstants[GetUnit];
end module:

after replacing the :- with [ ] for the variable assignments it takes care of the error.  So before saving to library I thought to run with(Astronomy) first to see if it's working properly so far.

with(Astronomy)
                           [Constant, GetConstant, GetError, GetUnit, GetValue]

GetConstants(MJupiter)
                          Error, (in ScientificConstants:-GetConstant) `MJupiter` is not a known Constant

 ***edit added*** 
Okay I see, in order for the module to work properly it needs to be saved in the library archive before it can be called on.  It cannot be run properly without saving.  Works good now.  Thanks Acer.

I've partially fixed my issue but still I have a problem with your module in M12

Astronomy:=module() option package;
export GetConstant,GetValue,GetError,GetUnit,Constant;
local ModuleLoad;
   ModuleLoad:=proc()
      ScientificConstants:-AddConstant(':-mass_of_Jupiter',
                                       'symbol'=':-MJupiter',
                                       'value'=1.90e27,'units'=':-kg')
   end proc:
   Constant:=ScientificConstants[Constant];
   GetConstant:=ScientificConstants[GetConstant];
   GetValue:=ScientificConstants[GetValue];
   GetError:=ScientificConstants[GetError];
   GetUnit:=ScientificConstants[GetUnit];
end module:

after replacing the :- with [ ] for the variable assignments it takes care of the error.  So before saving to library I thought to run with(Astronomy) first to see if it's working properly so far.

with(Astronomy)
                           [Constant, GetConstant, GetError, GetUnit, GetValue]

GetConstants(MJupiter)
                          Error, (in ScientificConstants:-GetConstant) `MJupiter` is not a known Constant

 ***edit added*** 
Okay I see, in order for the module to work properly it needs to be saved in the library archive before it can be called on.  It cannot be run properly without saving.  Works good now.  Thanks Acer.

Just trying it out now, but I recieve the error:

                                     Error, second argument to MEMBER must be a NAME

I copied the source module so it's not a typo and I don't see any typos in the original.  I cannot determine the error.

Just trying it out now, but I recieve the error:

                                     Error, second argument to MEMBER must be a NAME

I copied the source module so it's not a typo and I don't see any typos in the original.  I cannot determine the error.

We can get the answer using isolve as well using seq as I found out here http://www.mapleprimes.com/questions/130964-Isolve-Wont-Give-All-Solutions-Here

ineq1:=6*x+2*y>=49:
ineq2:=7*x+3*y<=59:

seq(isolve({ineq1 , ineq2 , y<=k , y>=k }), k=0..5) 

                                             {x = 8, y = 1}

We can get the answer using isolve as well using seq as I found out here http://www.mapleprimes.com/questions/130964-Isolve-Wont-Give-All-Solutions-Here

ineq1:=6*x+2*y>=49:
ineq2:=7*x+3*y<=59:

seq(isolve({ineq1 , ineq2 , y<=k , y>=k }), k=0..5) 

                                             {x = 8, y = 1}

Much appreciate your explanation.  I better understand now.   Thanks!

Much appreciate your explanation.  I better understand now.   Thanks!

Please be more helpful.  Can you explain?  There is nothing in the manual that says how to install a package under an existing package.  And of course I don't want to mess up anything built in. 

with(ScientificConstants[Astronomy]):

GetConstant(M[Jupiter])
              mass_of_Jupiter , symbol=MJupiter , value= 1.90 1027 , units=kg
etc...

If I build the package outside then I can't use the call GetConstant, I don't think.  But this is why I ask the question.
                

Please be more helpful.  Can you explain?  There is nothing in the manual that says how to install a package under an existing package.  And of course I don't want to mess up anything built in. 

with(ScientificConstants[Astronomy]):

GetConstant(M[Jupiter])
              mass_of_Jupiter , symbol=MJupiter , value= 1.90 1027 , units=kg
etc...

If I build the package outside then I can't use the call GetConstant, I don't think.  But this is why I ask the question.
                

It appears Maple's internal loop calculation restricts isolve from producing values outside a 'rectangular box range'

Visualizing the issue

with(plots):
a:=6*x+2*y>=48:
b:=6*x+2*y<=72:

Solving for integer values in the region 

 ourrange := a, b, x >= 0, x <=12 , y >=0 , y <= 5:

isolve({ourrange})[3..]
                                   {x = 8, y = 0}, {x = 8, y = 1}, {x = 8, y = 2}, {x = 8, y = 3}, {x = 8, y = 4}, {x = 8, y = 5}, {x = 9, y = 0}, {x = 9, y = 1}, {x = 9, y = 2}, {x = 9, y = 3}, {x = 9, y = 4}, {x = 9, y = 5}, {x = 10, y = 0}, {x = 10, y = 1}, {x = 10, y = 2}, {x = 10, y = 3}, {x = 10, y = 4}, {x = 10, y = 5}

You'll also see in the answer (which I left out) at the beginning either warning solutions may have been lost (thrown up by M15) or some variation of y=_NN#~ (M12 )  M12 doesn't say solutions lost, but lets put the points given into a plot. 

xx := map(rhs, [isolve({ourrange})[3.., 1]]):
yy := map(rhs, [isolve({ourrange})[3.., 2]]):
zz := zip(`[]`, xx, yy):
zzz:=pointplot(zz):

aa := implicitplot(a, x = 0 .. 12, y = 0 .. 5, filledregions = true, transparency = .5):
bb := implicitplot(b, x = 0 .. 12, y = 0 .. 5, filledregions = true, transparency = .5):

display(aa,bb,zzz)

You can see which points have been missed, [11,0] , [11,1] , [11,2] , [12,0] , [12,1] , [7,3] , [7,4] , [7,5]  and  [6,5]

for a little better view, we'll change one inequality equation

a:=6*x+8*y>=48: #changing the 2 to 8
aa:=implicitplot(a,x=0..12,y=0..5,filledregions=true,transparency=.5):  # re-executing the aa plot
ourrange := a, b, x >= 0, x <= 12, y >=2 to y<=5:  # change the y range
#re-executing our points
xx := map(rhs, [isolve({ourrange})[3.., 1]]):
yy := map(rhs, [isolve({ourrange})[3.., 2]]):
zz := zip(`[]`, xx, yy):
zzz:=pointplot(zz):

display(aa,bb,zzz)

and we can see the rectangular selection behaviour a little easier.  Maybe Maple is supposed to do that but I don't think so, the isolve routine could be fixed. 

If I reduce the upper y search value I can see a little more

isolve({a, b, x >= 0, x<=10,y >= 0, y <= 3})
                    {y = _NN21}, {y = 3-_NN22}, {x = 8, y = 0}, {x = 8, y = 1}, {x = 8, y = 2}, {x = 8, y = 3}, {x = 9, y = 0}, {x = 9, y = 1}, {x = 9, y = 2}, {x = 9, y = 3}

But when I get to y<=4 I loose my x=9 solutions.

PasswordField is not available in Maple12.  How can I make something similar there?

I do not want circle symbols for each keypress.  I want to know how to replace with a random letter.  Is it possible in M12?  If not how would you modify the PasswordField code in newer versions to do just that?  I could possibly add the same procedure to the M12 library.  Would that work? 

I thought a simple maplet process was easy but I am finding it difficult to arrive at a solution.  The answer seems to be more complex than I thought.  Any thoughts?

PasswordField is not available in Maple12.  How can I make something similar there?

I do not want circle symbols for each keypress.  I want to know how to replace with a random letter.  Is it possible in M12?  If not how would you modify the PasswordField code in newer versions to do just that?  I could possibly add the same procedure to the M12 library.  Would that work? 

I thought a simple maplet process was easy but I am finding it difficult to arrive at a solution.  The answer seems to be more complex than I thought.  Any thoughts?

So either no one knows how, or it can't be done. 

How about this question instead... In a maplet create 2 text fields where the 2nd text field copies input from the first as you type (realtime copy so to speak).  I know how to do the copy when the focus changes but how about realtime?  Is it possible? 

First 98 99 100 101 102 103 104 Last Page 100 of 155