Christopher2222

MaplePrimes Activity


These are replies submitted by Christopher2222

Can you at least plot one of the lines? 

Don't forget also that e is exp() in maple ie/ exp(-.0196*t)

What is your trouble?  Show us what you have attempted.

@muffinman123 Roman is right.  You must see [> before it will take effect.  And it will take effect if you've just changed it after the current execution group.  It won't work without [> no matter what you do, and that's because Maple uses that as a marker for entries to look graphically the same as you would write them on paper (or maybe they just forgot to incorporate the option in the code, I'm not really sure but I thought it was a good guess)

So, you can either open a new file in worksheet mode or use Crtl-J to insert the input below your current line and have your Maple Input set to Maple notation. 

@muffinman123 Roman is right.  You must see [> before it will take effect.  And it will take effect if you've just changed it after the current execution group.  It won't work without [> no matter what you do, and that's because Maple uses that as a marker for entries to look graphically the same as you would write them on paper (or maybe they just forgot to incorporate the option in the code, I'm not really sure but I thought it was a good guess)

So, you can either open a new file in worksheet mode or use Crtl-J to insert the input below your current line and have your Maple Input set to Maple notation. 

Thanks, I like that little proc.  The traperror will help when one is using sequences.  We can use it so the sequence won't break.

For example here

seq(`if`(is(whattype(traperror(tan((1/6)*i*Pi))) = string), "error", tan((1/6)*i*Pi)), i = 1 .. 12)

1  (1/2)   (1/2)                (1/2)    1      (1/2)        1  (1/2)   (1/2)          
- 3     , 3         , "error", -3          , - - 3        , 0,   - 3     ,  3     ,   "error",
3                                                3                    3                         

    (1/2)   1  (1/2)  
  -3     , - - 3       ,  0
             3 

 

Thanks, I like that little proc.  The traperror will help when one is using sequences.  We can use it so the sequence won't break.

For example here

seq(`if`(is(whattype(traperror(tan((1/6)*i*Pi))) = string), "error", tan((1/6)*i*Pi)), i = 1 .. 12)

1  (1/2)   (1/2)                (1/2)    1      (1/2)        1  (1/2)   (1/2)          
- 3     , 3         , "error", -3          , - - 3        , 0,   - 3     ,  3     ,   "error",
3                                                3                    3                         

    (1/2)   1  (1/2)  
  -3     , - - 3       ,  0
             3 

 

ah, okay I need four conditions to look at.   SlopeOut, position inside and outside of 0 and .5, and incidentSlope.  That's a lot of elif statements.

The refected lines are not reflected properly when slopeOut>0 and xin>0 as shown here


So I changed the first condition and added an extra elif statement in the DrawReflectedLine proc

if slopeOut >=0 and xin < 0 then
    plot(yOut, x = xin..xmax,color=yellow, thickness =2):
elif slopeOut >=0 and xin > 0 then
   plot(yOut, x= xmin..xin, color=yellow, thickness =2): 


But then of course when the reflected line slope is positive to the right from the point of contact it's not going to work either.  So I need something else, but I can't figure it out. 

Anyone?

Setting the light source at x=0.5 and changing a =  1/2 .. 2   is making my head spin trying to get it to work right. 

I've changed both [0,y0] points to [.5,y0] and changed the incidentSlope to incidentSlope:=( f(xcurr)-y0 ) / (xcurr - 0.5) and I know there's something in the DrawReflectedLine proc I need to change, like add more conditions but I can't quite figure it out. 

What are the conditions I need to change in the DrawReflectedLine proc?

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!

First 104 105 106 107 108 109 110 Last Page 106 of 162