mmcdara

7364 Reputation

20 Badges

8 years, 293 days

MaplePrimes Activity


These are replies submitted by mmcdara

@Preben Alsholm 
Thanks fot having corrected me

@Kitonum 
I use to use  sort(L, key=(x=x[1]))  instead.
Is your syntax docummented elsewhere ?

PS : see Mariusz Iwaniuk's answer to your previous post.
This will explain why CDF(burr_distribution, x), or Mean(burr_distribution), or any other statistics has no closed form for general values of the parameters

Maybe this ?

burr.mw

@Les 

The fit you propose seems odd ...

Maybe a typo error in your f:= t->439e^-2.9t function ?

 

Pts:= [[0, 438.912], [0.0295, 402.336], [0.125, 365.76], [0.2009, 341.376]]:

with(Statistics):

fit := ExponentialFit(Pts, t);

HFloat(427.57436235247263)*exp(-HFloat(1.1704121949703337)*t)

(1)

FIT := 439*exp(-2.9*t)

439*exp(-2.9*t)

(2)

plot(

   [Pts, fit, FIT], style= [point, line, line], symbol= diamond, symbolsize= 12,

   color=[blue, red, gold], gridlines, view= [0..0.25, 0..500]

);

 

 

 


 

Download FIT_or_fit.mw

Here is your complete worksheet in WORKSHEET-MODE style

EulerLagrange.mw


Don't be afraid if the copy-paste operation transforms the first line into the second one ... the results are the same

 

 

If you want to build the solution "sol2" from t=1000 to t=3000, the simplest way is to set the IC equal to sol(1000) and solve in the range 1000..3000.
If you do this (brown code in the attached file), you will see that sol2 is equal to sol in the range 1000..3000

aa_problem_MWE2.mw

 

 

I did not analyze your code for solution "sol2".

But, if you try to solve the same problem from t=1000 to t=3000, the only thing tou have to do is to set the new IC at t=1000 equal to sol(1000) and solve in the range 1000..3000
If you do this, sol2 returns the solution sol gave in the range 1000..3000 (see the code in brown in the attached file).

By the way, I added legend=... in the graphs for a smarter plot and change method=rkf45 (default choice) ny method=rosenbrock (to hande potential stiff problems).

So I guess your code for "sol2" could contain some mistake(s) ?


aa_problem_MWE2.mw
 

I did not analyze your code for solution "sol2".

But, if you try to solve the same problem from t=1000 to t=3000, the only thing tou have to do is to set the new IC at t=1000 equal to sol(1000) and solve in the range 1000..3000
If you do this, sol2 returns the solution sol gave in the range 1000..3000 (see the code in brown in the attached file).

By the way, I added legend=... in the graphs for a smarter plot and change method=rkf45 (default choice) ny method=rosenbrock (to hande potential stiff problems).

So I guess your code for "sol2" could contain some mistake(s) ?


aa_problem_MWE2.mw
 

@acer 
(from sand15's home-alias)

The example given in the help pages, even with a legend on the first plot, works perfectly at home

Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895
(imac)

 

@Preben Alsholm 

Unfortunately  I'll be unavaliable for two days to study your reply.
I'll will contact you again as soon as possible.

Thanks for the help

@vv 

 

Do you mean: why do I do this

ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:

instead of this  

M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
ff:=x->2*x+3:

?

The answer is: just because I found this method somewhere here, years ago.

However I'll be unavaliable for two days to investigate this point further.
I'll will contact you again as soon as possible to clarify this.

Thanks for the help

@vv 
(different lognames but the same person, now out from my office)

I have tested your coding and I understand the different results it gives.
But it seems (maybe I did not examine the results with enough attention) that 

ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
#ff:=x->2*x+3:

returns the same things  ...

More of this, if the definitions of ff and M are done in a specific worksheet ending with the creation on an archive M.mla, and if M is used in a separate worksheet through the command with(M) (libname having been instanciated correctly), which is my case, should I have to expect 

#ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
ff:=x->2*x+3:

and 

ff:=x->2*x+3;
M := module()
  option package;
  export f;
  f:=eval(:-ff);
end module:
#ff:=x->2*x+3:


to behave differently ?

Thanks four your involvement
 

@Preben Alsholm 

(different lognames but the same person, now out from my office)

 

I proceed exactly as I understand you do.

More precisely : 

 

1/ I open an interactive Maple session (Maple 2015, Windows 7)

 

2/  I open the file MyModule.mw in worksheet W1 

     and the file Test.mw in a separate worksheet W2

     W1 is aimed to develop the package MyModule

     The code in W2 contains  the call to the procedure MyProc included in  MyModule

 

3/ W2 begins this way : 

     restart:

     MyLib := ….                           # the directory which contains  MyModule.mla 

     libname := MyLib, libname;    # should I have write lib name := libname, MyLib,  ?

     with(MyModule):

 

4/ W1 begins with a « restart » command and is organized this way :

     * the codes corresponding to the N procedures MyModule contains (each of them in a separate block)

     * a new block where the module MyModule is defined

     * a last block where the archive MyModule.mla  is created in the directory Mylib (the same name used in W2)

     

5/ Once MyModule.mla has been generated I return to W2.

 

    5.0/ I execute W1 up to the command MyProc(…), where MyProc is one of the N procedures MyModule contains.

           I’m not happy with the result it returns, so:

 

     5.1/ I go back to W1

     5.2/ I modify MyProc

     5.3/ I execute (!!!) the whole W1 worksheet 

            If MyLib already contains MyModule.mla, which is generally the case, this archive is destroyed 

            before a new might be created

            I verified in a third worksheet that MyModule.mla contains the modified procedure MyProc

 

     5.4/ I go back to W2.

            I insert a new block just after the one which contains the call to MyProc.

            This block contains 

                  unwith(MyModule);

                  package();             # to insure that MyModule has been « unwithed » … which is the case (***, see below)

                  with(MyModule);

 

            The command showstat(MyProc) keeps displaying the unmodified MyProc loaded by the first with(MyModule) 

             (point 3/ above).

            It all goes as if unwith(MyModule) + with(MyModule) was ineffective.

 

            *** More surprisingly, if I  execute the command MyProc(…) after unwith(MyModule) , I do not obtain the output 

                 MyProc(…) which would signify that  MyProc is unknown, but the same result I obtained at point 5.0 !?!?

 

 

PS : it is of course not a blocking situation for I can always execute the W2 worksheet from its first « restart » command to the MyProc(…).

        It’ is more something which is troubling me...

@Mariusz Iwaniuk 

Thank you, 

best regards

First 140 141 142 143 144 145 146 Page 142 of 148