## 2 Badges

9 years, 186 days

## @acer  hello Acer, i tried but i ge...

hello Acer,

i tried but i get as an output A, i think maybe my problem is that the code is not written correctly. I would appreciate your insight.

thank you

## @Carl Love  hello Carl, i am just d...

hello Carl,

i am just doing some random exercises now, and it is helping me understand the logic and structure..

i am trying to write a code to display an array of elements, but i dont get a result when i type print (A), can you please guide me.

Thank you

## @Carl Love  Hello Carl Love, Thank ...

Hello Carl Love,

Thank you for your respond.
My class has covered topics such as Data Structure, control flow.. and i really want to test myself that i understand the topics. i tried coming up with some questions, but i would like to have some more practice. I tried looking up sample questions for maple, but i wasnt successful. I guess best thing would be to just understand definitions and attemp writign some basic codes. Any suggestions would be appreciate it.

Thank you

## keep silent if you don't have the abilit...

now its my turn to respond to your comment...first ...you need to see a  psychiatrist and seocnd if you are not able to answer  questions that are posted and guide people in the right direction... then you must keep silent...and again go and see a psychiatrist..kosben kosenanatamian

## @Kitonum  hello, now that I made th...

hello,

now that I made the changes, for the last part i get an error message saying

Error, ( in plots:-display ) expecting plot strcutire but recieved: plot 1

thank you

## @Kitonum  hello, thank you very muc...

hello,

thank you very much for your reply.

i am using maple 18

here is my code: maple either ouputs an  error message or output  the word plot in blue ..and  same as for display

y:=x->sin(x):

a:= -1:

b:=6:

plot1:=plot(sin(x), x=-1..6,color=red,title="graph of sin(x)"):        ( error, missing operation) or (plot)

plot2:=plot(sin(x),x=1..5,filled=[true,color=blue]):                            ( error, missing operation) or (plot)

display(plot1,plot2,view=[-1..6,-1..1],title="graph of sin(x)");

thanks again for your help..

## @tomleslie  hope your keyborad issu...

hope your keyborad issue  gets resolved.

Im still  trying to make the code work..keeping my fingers crossed x..

thank you for all your help.

## @Carl Love    hello Carl, than...

hello Carl,

thank you, I will make the correction. Hopefully it will work.

If possible, can you please just briefly explain, why my code for plotting  is not working?

Thanks again For your help.

## @tomleslie  hello Tom, the reasons ...

hello Tom,

the reasons I am typing the code is because it's not working when I run the code..I tried to open the code on maple 18 and run it, but for some reason it keeps giving me an error message..

and as for the plot it says that the range -2pi to 0 is invalid.

thank you

## @tomleslie    Hello Tomleslie,...

Hello Tomleslie,

so sorry to bother you again.

I am using maple 18 and i tried the code again, but unfortuntately it does not seem to work.

here is what i am putting in exactly...

g:=(x,y)--> evalf(sin(sqrt(x^2+y^2)+1):

a:= -2*pi:

b:=2*pi:

c:=-2*pi:

d:=2*pi:

N:=15:

X:=Array(0..N):

y:=Array(0..N):

z:=Array(0..N,0..N):

s:=0:

X[0]:=a:

Y[0]:=c:

Z[0,0]:=g(X[0],Y[0]):

s:=0:

dX:=(b-a)/N:

dY:=(d-c)/N:

for i from 1 to N do

X[i]:=X[i-1]+dX:

for j to N do

Y[j]:=Y[j-1]+dY

Z[i,j]:=g(X[i],Y[j]):

s:= s+ z[i,j] *dx*dY:

end do:

end do;

Also for the displaying the curve and the parallelepiped, i am not able to also get graph:

here is what i put in exactly.

p1:= plot3d(g, -2*Pi..2*Pi, -2*Pi..2*Pi, color=blue, transparency=0.5):

p2:=Statistics[ScatterPlot3D](Array([seq(seq([a+i*dX, c+j*dY, Zi,j],i=0..N), j=0..N)]), lowess,fitorder=2,rule=3, color=red):

plots[display]([p1,p2]); t2:=time() -t1.

thank you so much for your help and guidance..

## @acer  hello,  i am retyping t...

hello,

i am retyping the code again. when i cut and paste from the maple worksheet and that is the reason why it is not copying the syntax correctly.

I even tried the revised version of my code that was send to me by tomleslie but i get the same error message as what i got ( Error, unterminated loop).

Thannk you for your help.

g:=(x,y)--> evalf(sin(sqrt(x^2+y^2)+1):

a:= -2*pi:

b:=2*pi:

c:=-2*pi:

d:=2*pi:

N:=15:

X:=Array(0..N):

y:=Array(0..N):

z:=Array(0..N,0..N):

s:=0:

X[0]:=a:

Y[0]:=c:

Z[0,0]:=g(X[0],Y[0]):

s:=0:

dX:=(b-a)/N:

dY:=(d-c)/N:

for i from 1 to N do

Y[j]:=Y[j-1]+dY

Z[i,j]:=g(X[i],Y[j]):

s:= s+ z[i,j] *dx*dY:

end do;

## @tomleslie  hello, thank you for yo...

hello,

thank you for your help.

i tried the revised code, but it gave me the same message as before (error, unterminated loop)...

## @Carl Love  hello Carl Love, thank ...

hello Carl Love,

thank  you very much for your quick respond and for your valuable guidance.

## @Kitonum  thank you so much for mak...

thank you so much for making the modifications, for my code to make more sense..

Thank you and thank you :)

## @Rouben Rostamian   Thank you for y...

Thank you for your explanation.

I will try to understand the reasoning behind it and apply it to my practice question.

 1 2 Page 1 of 2
﻿