janhardo

335 Reputation

8 Badges

11 years, 6 days

MaplePrimes Activity


These are questions asked by janhardo

In the obselote book programming examples it is using array's as data type

Is het easier to use A Vector or Matrix as datatype?

Its a while ago i did some effort in trying to get better in programming of procedures
If i look at the Maple  programming guide, then all questions has no provided answers: why is that ?

So the sieve of Eratosthenes procedure in Maple?  
First what is the formula for this sieve.

Write a procedure that implements the sieve of Eratosthenes: Count the number of integers (less than or equal to a given integer) that are prime.

Got here a  function g(y,z) and if the partial directive with respect to y is 0 , then  there is left over a function h(z)
Can this ber proven in Maple, can't figure it out by reasoning. 
Perhaps a geometrical explanation makes more sense ?  

Its easy to calculate a potential function for a vectorfield 
But now by hand in 2D Input mode ..a struggle 

Doing your homework in 2D Input mode is something totally different then the structurized explanations done in Maple input for lessons by an instructor. 

Partiel differentation with respect to what variable, is not notated in 2D mode, so a serie of them showing up in the document says nothing.and reexecuting them a couple of times doubles the output if you have used a inline notation. 
Basic idea here f-> f ' -> F(f ') = f  and handling variables x,y, and z for integrating/differentation 

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


 

restart

with(Student:-VectorCalculus)

BasisFormat(true)

v := VectorField(`<,>`(x, y, z))

Vector(3, {(1) = x, (2) = y, (3) = z})

(1)

Student:-VectorCalculus:-ScalarPotential(v); "_noterminate"

(1/2)*x^2+(1/2)*y^2+(1/2)*z^2

(2)

Thats easy to use the ScalarPotential for a manual exercise

Example 2: finding a Potential function

Show that F = [exp(x)*cos(y)+y*z, x*z-exp(x)*sin(y), x*y+z] is conversative and find a potential function for it.

F := VectorField(`<,>`(exp(x)*cos(y)+y*z, x*z-exp(x)*sin(y), x*y+z))

Vector(3, {(1) = exp(x)*cos(y)+y*z, (2) = x*z-exp(x)*sin(y), (3) = x*y+z})

(3)

"(->)"

y*z*x+exp(x)*cos(y)+(1/2)*z^2

(4)

NULL

NULL

NULL

ScalarPotential(F)

y*z*x+exp(x)*cos(y)+(1/2)*z^2

(5)

So "f(x,y,z):=y z x+(e)^x cos(y)+(z^2)/2 + C :"

Now manual

'F' = value(F)

F = (Vector(3, {(1) = exp(x)*cos(y)+y*z, (2) = x*z-exp(x)*sin(y), (3) = x*y+z}))

(6)

(exp(x)*cos(y)+y*z)*`#mover(mi("e"),mo("&lowbar;"))`[x]+(x*z-exp(x)*sin(y))*`#mover(mi("e"),mo("&lowbar;"))`[y]+(x*y+z)*`#mover(mi("e"),mo("&lowbar;"))`[z]

(exp(x)*cos(y)+y*z)*`#mover(mi("e"),mo("&lowbar;"))`[x]+(x*z-exp(x)*sin(y))*`#mover(mi("e"),mo("&lowbar;"))`[y]+(x*y+z)*`#mover(mi("e"),mo("&lowbar;"))`[z]

(7)

"(->)"

F

(8)

F

Vector(3, {(1) = exp(x)*cos(y)+y*z, (2) = x*z-exp(x)*sin(y), (3) = x*y+z})

(9)

NULL

NULL

M := exp(x)*cos(y)+y*z; N := x*z-exp(x)*sin(y); P := x*y+z

x*y+z

(10)

"(->)"

x

(11)

M1 := exp(x)*cos(y)+y*z

exp(x)*cos(y)+y*z

(12)

 =

exp(x)*cos(y)+y*z

(13)

"(->)"y   ( to z )

NULLNULL 

M2 := exp(x)*cos(y)+y*z

exp(x)*cos(y)+y*z

(14)

 =

exp(x)*cos(y)+y*z

(15)

"(->)"-exp(x)*sin(y)+z (to y) NULL

N1 := x*z-exp(x)*sin(y)

x*z-exp(x)*sin(y)

(16)

 =

x*z-exp(x)*sin(y)

(17)

"(->)"x  (to z)

N2 := x*z-exp(x)*sin(y)

x*z-exp(x)*sin(y)

(18)

 =

x*z-exp(x)*sin(y)

(19)

"(->)"-exp(x)*sin(y)+z (to x)

P1 := x*y+z

x*y+z

(20)

 =

x*y+z

(21)

"(->)"x  (to y )

P2 := x*y+z

x*y+z

(22)

 =

x*y+z

(23)

"(->)"y  ( to x )

 

 

Test for to be a conservative field

P1=N1 ,  M1=P2, N2=M2

 

int(F, x).... integrating F  with respect to x ,holding  y and z fixed
Its a vector form F , probably F must be converted to scalar form? (command?)

exp(x)*cos(y)+y*z+x*z-exp(x)*sin(y)+x*y+z

exp(x)*cos(y)+y*z+x*z-exp(x)*sin(y)+x*y+z

(24)

"(->)"

x*z+(1/2)*x^2*y+(1/2)*x^2*z+y*z*x+exp(x)*cos(y)-exp(x)*sin(y)

(25)

Ok, can integrate to 3 variables now

Now the partial diretives from f

M1 = exp(x)*cos(y)+y*z"(->)"y*z*x+exp(x)*cos(y) + g(y,z) constant of integration of f (the potential function)NULL

So : "f(x,y,z)= "y*z*x+exp(x)*cos(y)NULL + g(y,z) (1) # a total mess as notation here done by me

 

The logic from this all not yet completely understood and lost oversight , but this equation (1) must be further  integrated/differentiated  to get

y*z*x+exp(x)*cos(y)+(1/2)*z^2+C

Step by step following the text example in Thomas Calculus (page 1075, example 2) in 2 D mode is not going well.

 

``


 

Download thomas_calculus-vb2-blz_1075_-vraag_forum.mw

 

Maple is not adding a function g(y) to the indefinite integral 
Maybe i do miss here something ?
 

int(2*x*y, x)

x^2*y

(1)

textbook  f(x, y) = int(f[x](x, y), x) and int(f[x](x, y), x) = int(2*x*y, x) and int(2*x*y, x) = x^2*y+g(y)f(x, y) = int(f[x](x, y), x)

f(x, y) = int(f[x](x, y), x)

(2)

int(2*x*y, x) = x^2*y+g(y)

x^2*y = x^2*y+g(y)

(3)

looks like the y is constant  in f(x,y)
Maple is not putting a constant with the integral int(f, x)  , the same for int(2*x*y, x)
Think then only the integrand 2x is integrated and y is a constant, but the notation of g(y) is not C  

 

Integral  x^2*y+g(y)and then  partieel differentation gives  2x.y  

Its about finding a potential function for a vectorfield F

 

 

NULL


 

Download integraal_bij_part_diff_van_vectorvels.mw

5 6 7 8 9 10 11 Last Page 7 of 18