janhardo

695 Reputation

12 Badges

11 years, 38 days

MaplePrimes Activity


These are replies submitted by janhardo

@acer 

Thanks

Some extra examples makes it more clear.

@Carl Love 

Thanks 

@Kitonum 

Thanks 

It was asked the do this by two pair of nested loops
Those nested loops do have more uses in other tasks i see and it is to get used of them

Maybe i see also your array specify in this book examples?

What makes it easier  ..to come up with this?   

@acer 

Thanks

Could not come up on this array

The elements are:

A[1,1]=1^1 , A[1,2]=1^2,   A[1,3]=1^3  A[4,1]= 1^4 

A[2,1]=2^1, A[2,2]=2^2,   A[2,3]=2^3  A[2,3]=2^4  

........................

De outer loop is for from top to bottom en inner loop from left to right

 

@Carl Love 


 

 

 

 

for I from I1 to I2 do statements end do
I stands for the varying index
I1 is the  starting value for the index
I2 is the end value for the index  

 

Array definition : 1-dimensional

restart;

A:=Array(0..6);# 1-dimensional array

Array(%id = 18446746044449226870)

(1)

A[1]; # a array element

0

(2)

A[0];

0

(3)

 

beware the array can start with a 0 or 1 ( depends on  varying index i  )

 Looking at  task (a) ..there are 6 numbers , so the index value  i  goes from 0 ..5  

a general formulae for the sequenze 1,3,9,...    

 

 

   
   
 

 

 

restart;

 

LET

(a)

X :=Array(0..5);

Array(%id = 18446746044449226870)

(7)

for i from 0 to 5 do
      X[i] := 3^i:
od;

1

 

3

 

9

 

27

 

81

 

243

(8)

X[1];

3

(9)

X;

X

(10)

the one-dimensional  array is conceptual the same as a list

Question : when should i use  for i a 0 or 1 ?  ..

 

(1b) A sequenze  -1,1, ..."  = (-1)^(n)" for  n= 0,...

G:=Array(1..12);

G := Array(1..12, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0, (6) = 0, (7) = 0, (8) = 0, (9) = 0, (10) = 0, (11) = 0, (12) = 0})

(11)

for i from 1 to 12 do
      G[i] := (-1)^i:
od;

-1

 

1

 

-1

 

1

 

-1

 

1

 

-1

 

1

 

-1

 

1

 

-1

 

1

(12)

G[2];

1

(13)

G;

G

(14)

1(c)  this sequenze can be expressed in a general term1,4,7,10,...  3i+1  ( i = 0 ,...n )  

A:=array(0..6):

for i from 0 to 6 do
      A[i] := 3*i+1:
od;

1

 

4

 

7

 

10

 

13

 

16

 

19

(15)

A[0];

1

(16)

 


 

Download betounes_ex_set2_1.mw

@Carl Love 

Thanks

I made a overhaul of task 1c and get stuck for drawing cross-hatching one symmetry part of the graph. 

Also i used a piecewise function A__right , but don't understand it  

All integrals ( symbolic, numeric (Int and int ) give the same answer

 

  Don't know yet why the lines are not perpendicular 

 

  


 

 

 

      

restart;

f:=x->x^5-2*x^3-4*x^2+x+4;

proc (x) options operator, arrow; x^5-2*x^3-4*x^2+x+4 end proc

(1)

p:= plot(f(x),x=-1..2,color=magenta,thickness=2,tickmarks=[3,3],gridlines= false);

 

with(plots,display);

[display]

(2)

a:=-0.4;b:=2;c:=-1;

-.4

 

2

 

-1

(3)

#f(a)+m*(x-a);

f1:=D(f);

proc (x) options operator, arrow; 5*x^4-6*x^2-8*x+1 end proc

(4)

mtan:=D(f)(a);

3.3680

(5)

tangentline:=plot(f(a)+mtan*(x-a),x=c..b,thickness=2,color=black,gridlines= false):

display({tangentline,p});

 

 

Now a normalline drawing in inflection point tangent line  

mnor:=-1/mtan;

-.2969121140

(6)

mtan*mnor;

-1.000000000

(7)

normalline :=plot(f(a)-mnor*(x-a),x=c..b,thickness=2,color=black,gridlines= false):

 

``

display({tangentline,normalline,p});

 

 

 


Download betounes_ex_set_1_andereaanpak_1_opg_5.mw

@fyi

Thanks

That's in one command, but like it more do in steps like in this example , because its about the how to come on this answer as you doing it by hand .
If maple can come up with a answer that's fantastic.

 

@acer

Thanks  

Its also not possible to add a enclosed section in a worksheet and posted here ? ..
 


 

 

 

Reading the task this critical points are stationary points ( function derative is zero) + inflection point
lets graph.

restart; with(plots):

f1:= 4*sin(x^3)-x^2;intvx:= x =-2..2;

4*sin(x^3)-x^2

 

x = -2 .. 2

(1)

plot(f1, intvx);

 

 

Easier to work in Maple with deratives is with the D operator seems

f2:=D(f1);

4*D(sin(x^3))-2*D(x)*x

(2)

 

Seems to be no easy derative to get with the D operator, then with the diff ( )
diff as expression or function input
lets try the function input.

 

restart;

f3:=x->4*sin(x^3)-x^2;

proc (x) options operator, arrow; 4*sin(x^3)-x^2 end proc

(3)

diff(f3(x),x);

12*x^2*cos(x^3)-2*x

(4)

Diff(f3(x),x):%=value(%);

Diff(4*sin(x^3)-x^2, x) = 12*x^2*cos(x^3)-2*x

(5)

# Diff(f1,x):% = value(%);

 

go back to (4)


 

Download exercise_set_1_task4.mw

 

@Carl Love 

Thanks

Some questions

1) 

plots:-display(plots,plot);

 (never seen before) is it a existing command ?

2) int(f-g)     

Why subtraction ?

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

I go to the next exercise set 1_3

 

@janhardo 

There was een example in the book enclosed

https://drive.google.com/open?id=1_FZN4k3_tZn8DSse1uKPnG9d1SVtfFPo

 

@Carl Love 

I got this now:

f := x^sin(x);
                                sin(x)
                          f := x     
g := x^cos(x);
                                cos(x)
                          g := x     
evalf(Int(abs(f-g), x= 1..15));
                          50.57916030
Its a powerful command, but that's probably not the solution asked by the author of the exercises.?  

 

@vv 

Its a difficult one

- intersections points of the two graphs :
How to do this ?: with a expression or in function notation
- calculate areas between intersection points

 

@Carl Love 

Thanks

For the worked out answers : my initial approach  was find interceptions with the x-axis and integrate the graph areas one by one.
With int (piecewise ,.. )   its be done faster and easier.

First 68 69 70 71 72 73 Page 70 of 73