janhardo

745 Reputation

12 Badges

11 years, 136 days

MaplePrimes Activity


These are replies submitted by janhardo

@Carl Love 

Thank

Don't see yet what decision has to be made in the procedure
Has to with the length of the tangentline?

@acer 

Thanks

Looks good for n = 3 and i did  for n = 10 it is becoming rather small the tangentlines, but if the function is periodic then that portion of the plot counts
But perhaps with zooming in the plot i shall better see the tangentlines?
The whole plot for n = 10 shows mainly the blue points without tangentlines -> zoom in 

Its about the variable L what gives room for experimenting
Note: must study closer how this done the deravation for a variable tangentline length
I noticed horizontal tangentline is max length and minimal when the tangent line is almost vertical
Its a visual confirmation about the steepness of the tangentline

This is better than all tangentlines do have a fixed length  ( no comparison needed with another procedure what has fixed lenghts)

Do see a new programing construct : a if with quotes.

@acer 

Thanks

There was no requirement for how long the tangentlines or  inflectionlines should be in the tasks as i can see it now.
Interesting your solution for the tangent length by not taken a fixed length what i proposed.  

 

I am curious how this will be look in a general procedure for a any number n of tangentlines
Maybe interesting to compare both procedures for their "tangentlengths looks"?      

@acer 

Thanks

There was the idea of make the procedure general voor een given number n of tangentlines, is it not enough to base the tangentlinelength  on a sub-interval length ( some smaller), that should be enough for all tangentline lengths.
Is that not a easier solution ?

@acer 

Thanks

Suppose the slope is 0 of the tangentline then the length must fit, between a sub interval from interval a b -> the tangentpoint lie on the interval point
Maybe can this length be used for all other slopes of the tangentlines 

l@Carl Love 
Thanks
The length of the tangentlines are +- (b-a)/2n  for a given interval 
This can be a plotoption then.

n is number of tangentlines to make it general, but the task was for 6 tangentlines : a interval a b divided in 5 subintervals.

I will try to make it general the procedure for any number of tangentlines
 

@janhardo 

Tried to make as procedure Tangentlines( f,a,b) input : two number a , b as interval, but failed.
Note : in Holland we are used to one Capital letter for words : example: Raaklijnen is (TangentLines)
 

I succeeded in adding the x-valus for the tangentpoints and adding a legenda in the procedure.

betounes_ex_set_2_opg_6via_codeexample2.3_uitwerking_ac.mw

 

 

 

@Carl Love 

Thanks

Good to point this out and keep in mind 

@acer 

Thanks

Indeed a interesting question: what using a expression or function in a procedure definition?
But reading your post its rather complicated to judge when to use a expression or when a real function

My initial idea was to start with the procedure definition using a and b , startpoint and endpoint of the interval 

proc( f, a::numeric,b::numeric ) ,but then i noticed the range example.
Its only a,b or a..b for procedure input ,without telling what are they standing for in the procedure for a new user. 

@Carl Love 

Thanks!

I will try do my best more on my English and beware to ask a open question , because its confusing.
It was not that i ask for sure to you, to give a partial sum procedure, but got one, thanks for that.

Outcomment is text or code with # or with  /*   */ , the idea that the code is bypassed then.

Note: i tried /*  */ in a do loop contained in a procedure, but that is not working. 
Concerning the summed up issues : all points need more study from my side 

But seeing in example makes more clear.
This code example ,must be reworked

PR:=proc(A,N)   # PR is product
   p:=1;
   for i from 1 to N do p:=p*A[i] end do:
end proc;  

@acer 

Thanks

I study all the attachments.

I am aware of the expression or operator input for a procedure that they differ, how could it go wrong?

  

@acer 

Thanks

Yes, i add a pointplot and extent the array ,but forget to adjust p[0] into p[0,1] 

I took a working procedure from you with maplemint no errors and then with my not working procedure with maple mint with errors and compare.

Its the first time i add quotes ...(could it be that i took old original code from example 2.3 again without quotes, that happened i think)   

That rng::range(numeric definition)  is not precisely explained how it works ..it is in Maple help ?

Evaluation rules the books give explanation about levels and the procedure variables are also different evaluated then in a interactive session.
a=b,b=c,c=d,d=16 is evaluated at   a=16 this is fourth level of evaluation in a interactive session as example.

 

 

@acer 

It was more difficult then i thought to make this procedure Tangentlines(f,a..b), but it is not working as intended.

betounes_ex_set_2_opg_6via_codeexample2.3_uitwerking.mw

@janhardo 

@acer : I leave it to you to add the interval as an additional parameter for your procedures.

You made a procedure out of task (exc set 2 task 3: drawing 6 tangentlines in the inflection points of  f ). 
Now there must be made a procedure from a code example 2.3 (tangentlines at maxs or mins) in book , that was the do task.
But it is now drawing tangentlines for a interval divided in 5 sub intervals with a procedure. 

 

betounes_ex_set_2_opg_6via_codeexample2.3.mw

I am working on it.

maplemint(Tangentlines);
Procedure Tangentlines( f )
  These names were used as global names but were not declared:  black, color,
      thickness, x
  Ineffectual call to with() inside a proc at statement 10: with(plots)

@acer: I suggest that you also add the name x as a local to your procedure, if you intend to continue to utilize it as a dummy name therein. Otherwise your procedure will not work if the name x has been assigned, say, a numeric value at the higher level.

Can you give a example with the procedure ? 
 

 

@janhardo 

Don't know how to make from this factorial function suitable for set and list elements

Factorial:= (n::nonnegint)-> local r:= 1, k:= 0; do r*= ++k until k>=n;

-------------------------------------------------------------------
PR:=proc(A,N)   # PR is product
   p:=1;
   for i from 1 to N do p:=p*A[i] end do:
end proc;

A is a list or set or array

example:

A:=[1,2,3,4];
c:=PR(A,4);
 
To make a factorial 4! from the list A you must fill it with natural numbers : that is not handy
First 70 71 72 73 74 75 76 Page 72 of 79