janhardo

745 Reputation

12 Badges

11 years, 131 days

MaplePrimes Activity


These are replies submitted by janhardo

@vv 

Thanks

Must look at the dfference betwween  of complexplot
create a 2-D complex plot
and conformal plot of a complex function.

@janhardo 

Only problem is to install the complex.m package for  the worksheets.
Note:  and get the same issue with a package another lessonserie 

@Thomas Richard 

Maybe fractals and i will look in the packages you mentioned

@acer 

Thanks 

i could look in those worksheets 

@Thomas Richard 

Thanks

Yes, the worksheet is made in 2002 by a person who studied at the same time i did for secondairy schools teacher math. 
Only he studied falso or mathematical engineering too at the same time, so trained with Maple
It was possible to follow two studies at the same time, but i was too late and it just finished the second study then when i ask for. ( in fact years too late , i did not knew it)

I think i will be most complex functions , so it will be generally then.
Don't know yet not else what more to do ?

tomleslie 

Thanks

I am wondering if all code in the book is rubbish , that 's why i came up with this example. (checktri) from the book from wich i think this could be obselote code?
If i am able to recognise bad code, then chance it in good code easily, that was the idea.
How to recognise this obselote code then?

So i don't want to learn how to code badly, no of course not  
I will study your made example with a subprocedure in it and  downloaded the programming guide.

Your code example is not the same a s intentend as in the book 
Its about knowing what type of triangle is concerned ( 4 types) and a plot with a normal vector what acts as a help for visualizing ( read ) the plot in the right position 

@janhardo 

------------------------------------------------------------------------------

I think that you're causing yourself confusion by making an unnecessary distinction between procedures and subprocedures.  A procedure B only needs to be considered a subprocedure of procedure A if B directly refers to the locals or parameters of A. In the code that follows, SelectX is a subprocedure of ModuleApply, but maxmin and pluralize are not. SelectX needs to be declared inside ModuleApply, but the others do not although they are used within ModuleApplySelectX itself has a subprocedure, j-> Y[j]=y. Such a procedure is called anonymous because it has no proper name.

---------------------------------------------------------------------------------

Using a module definition is for grouping procedures in general and in some case there are also sub procedures involved

@janhardo 

Seems to be all wrong here in this old procedure 

  • It is main procedure with sub procedures , but not together 
  • The need of a module here ?
  • It seems to be wrong programmed with evaln ?
     

druiehoekvb-met_evaln_geprogammerd_fout_dusCD5-3b.mws

@janhardo 

Why i should use :
add( n!/(k!*(n-k)!)*a^(n-k)*b^k, k=0..n);

instead of a do loop ?

Answer: its easier to use a add statement then a do loop statements  , correct?

@tomleslie 

Thanks for your advice and showing the right approach.

its a book from 2002 An introduction to programming using Maple -david betounes + another book too from 2002 ( also there examples of procedures defined with :  evaln ) 

The example procedures with this structure : proc ( ..,evaln , .. ) are problematic programmed then in the book ?
Enclose a example of this more 

druiehoekvb-met_evaln_geprogammerd_fout_dusCD5-3b.mws

@Carl Love 

Thanks

your procedure on saddle point calculation is not set up as a module, why not?

Making a procedure for saddlepoints - MaplePrimes

In BadSqr ( ) procedure  , the command BadSqr is not usable, why using this s variable then?  
without return statement  BadSqr (3,s );  i get 9 
Confusing this return statement whille sqr:=x^2 is the last statement in BadSqr().

BadSqr:= proc(x)
local sqr;    
sqr:= x^2;
   # return
end proc
:

BadSqr(3); 
                               9
----------------------------another example with evaln ----------------------

Example 2.5 (Binomial Expansion)

The following is a short procecure to compute expansions of binomials:

 binom:=proc(a,b,n,result::evaln)
    s:=0;
    for k from 0 to n do
        s:=s+(n!/(k!*(n-k)!))*a^(n-k)*b^k;
    end do;  
    result:=s;
    RETURN()           
### WARNING: `s` is implicitly declared local
### WARNING: `k` is implicitly declared local
  end proc: 

As explained in the book this is a procedure for expanding expressions of the form 
                          "(a + b)^n"

 where n is a nonnegative integer .  There is no output because of the RETURN command.  The expansion is stored in the variable s which is is passed to the output parameter result .  Let's test the procedure on some expansions we know.

----------------------------------------------------

How to use this procedure is not straightforward 

procedure_binomium_CD2-6.MWS

@Carl Love 

Thanks

I was writing about the first procedure that i posted , not about the procedure made by @tomleslie

@Carl Love 
Thanks

Its a old book from 2002 were i took this example from : the word "module" is not listed in the index of the book 
Groups of related procedures  that's how it is presented in the book.

This book needs then a overhaul of the present programming practice with Maple 
I must see that the structure of your module example is yet not clear for me but: 
A group of related procedures and other code can be put together into a module 
That's the start for me 

----------------------------------------------------------------------------------

The code that you're using as examples uses a very bad programming practice: The procedures return their values through parameters declared evaln rather than through the normal return mechanism.

------------------------------------------------------------------------------------
What does this exactly mean  between the -----?

@janhardo I see that the input parameters from the second procedure as local variables are declared in the main procedure .
Indeed the sub procedure is treated like a local variable

@tomleslie 
Thanks

Its one procedure nowypou made.

It was more about the concept/mechanism of a second or more procedures , how to include this in a mainprocedure ...

First 48 49 50 51 52 53 54 Last Page 50 of 78