janhardo

700 Reputation

12 Badges

11 years, 45 days

MaplePrimes Activity


These are replies submitted by janhardo

@tomleslie 

Thanks

Its trivial and straight on for you, but  i need to analyze it compared with the bookexample.

Note:  also for teaching it is not advisable to stress out: how easy or trivial it is for students if they are in their learning process: it can make them unsure. 
Mostly youngster are susceptible for this. (secondairy schools) 
Not everyone can teach.

Your programming looks easier, but its not formulated as a step function. 
Also a domain roster should be informative

In the bookprogramming there is a domain checking, but in this procedure it works differently

 

g:=(x,y)->f(A,B,T,x,y);  with f as procedure

 

h:=(x,y)->doPlot(T);

@tomleslie 

Thanks

Looks good!

Yes, its now indeed a real stepfunction with isolated step area's : what i want.
Also the scaling of the xyz axis is now correct

And no showing domain anymore is now correct and perhaps however adding roster of gridlines to show the domain 
 

No nested do loop and if statements anymore , it looks easier your code,but its not a general procedure yet and making one could be complicated?
 

Note: I try to decipher in the programming book also how the first programming example is set up

@rlopez 

Thanks 

Now i know what's possible. 

@Carl Love 

Thanks

How this statement exactly is build up stays unclear for me.

The piecewise function must for x-values accept : numeric values
Function notation this  must be possible to executed in a plot statement.: plot(h(x) and plot (h) is possible

@Carl Love 

Thanks

Yes, its no problem with the piecewise statement as it works as you mentioned, but the programmingbook likes to program this as exercise
 

@janhardo 

h:= x->`if`( type(x, numeric), 
               piecewise( x<=0,
                          sin(3*x),
                          sin(x/3)
                        ),
              'h(x)'
             ):
Strange maple expression for h  ..thought that i was meant for function definition ( functional oper)ator
Its a if ( condition, function, else...)
Seems that   if   is true then a function in x is created   
 

 

@tomleslie 

Thanks

It was about evaluating rules.

But your programming is a big difference with my example from Maplev5/6 .
To use only expressions in piece-wise functions. 

@acer 

Its not clear how this mechanism works ( R,P)

With this together probably return A[1..n+1,..], P;

(R1,P1):=NewtonM(g,-1,1,1,100,1e-6):

Your note:

note: You don't have to have the procedure return the plot. Given the returned Matrix that was assigned to R4 (for example), you can also get the plot afterwards like this:

Why should i do this ? : i can ask for R4 and P4

@Carl Love 

Thanks

A clear example, but not al my questions are answered.

Another question came up : can i see in a procedure what are the return values? ( automatically)
The last statement in the procedure is the return value, so if there is plot return value, before the last  statement.
Then i must use then add a return statement after the plot statement in order to see the plot in the procedure i think.
 

 

 

 

 

 

@janhardo 

Also this in another procedure: the use of p, L ?

p,L:=approxL( f, a, b, N):
#
# Display function and "piecewsie approximation
# to function
#
  p;
  L;
 

@Carl Love 

Thanks

You can outcomment this and then the procedure get a error.

return A[1..n+1,..], P; in NewtM ac.mw has to do with of (R1,P1):=NewtonM(g,-1,1,1,100,1e-6):?

A is a matrix and P is plot , so this ( ?  ):=procedure ( )  ?  

@janhardo 

The use of return statement is not clear : when to use?

  • return x0;  in exc set task 6 ac .mw 
  • return A[1..n+1,..], P; in NewtM ac.mw

Use of (R1,P1):=NewtonM(g,-1,1,1,100,1e-6): in NewtM ac.mw 

R1; 

P1; 

Seems to split the output of the procedure? 

@mmcdara 

Thanks

This programming of NewtonsMethod is more complicated then programmed on the forum :
showstat(NewtonsMethod);

NewtonsMethod can be used for a idea how its as plot presented to users in the forum programmed version

@acer 

Thanks

That's really programming you did with NewM compared with the book
It shows exactly about the iterations and values and gives insight .

"You wrote "I am leaving most of the rest as it was, and not addressing the inefficiency of augmenting a set with each new plot, or cleaning up the role of A, and so on.

Well that's probably too complicated for me .

Why is there a print command used, while it always with display was? ( was in a earlier code example)

Note: this last NewM is different programmed then the book example   
And there is solve ! (tough)..i tried 3 x times and go then to fsolve

Context sensitive command for solve : selecting the function and Maple shows the solve ( this is possible in the interactive worksheet )..no solution

Ah ,yes of course fsolve ...via contextmenu possible sin(x) - x*cos(x) ?..no
A shortcoming ? 

@acer 

Thanks

Did some more with it


 

 

 

Download exc_set_3_task_6vb_boek.mw
First 58 59 60 61 62 63 64 Last Page 60 of 73