cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

stack option

SOLVED

Re: stack option

that was really amazing. i have been trying it from so long and couldn't finish it and the code you have given is so short too.Thanks alot. 

after spending so much time on it, i think i should still finish the problem the way i started.

Re: stack option


@rizz12 wrote:

that was really amazing. i have been trying it from so long and couldn't finish it and the code you have given is so short too.Thanks alot. 

after spending so much time on it, i think i should still finish the problem the way i started.


This will be difficult or even impossible without any programming. You can't use an if-statement where xp is used somewhere, because this statement must fail if the calculation of xp failed.

So you would have to use an if already when you define xp but as you define it by writing xp[j:=... the assignment already fails because of the wrong index j before any if can do its job.

Re: stack option

i will try it out once if not I can use your program. thank you. When i take the z= tan inverse it converts the angle from -90 to 90 range. how can i have the angle based on the coordinate location.

Thank you.

 

Capture3.PNG

Re: stack option


@rizz12 wrote:

i will try it out once if not I can use your program. thank you. When i take the z= tan inverse it converts the angle from -90 to 90 range. how can i have the angle based on the coordinate location.

Thank you.


Try to use     z:=atan2(w,v)    instead of       z:=atan(v/w)

This should give you values in the range from -pi to pi.

 

atan2 has established itself and is available in many programs (eg Excel) and programming languages. Caution must be exercised in the order of the arguments. In MathCad and Excel, the x-coordinate is passed as the first argument and the y-coordinate as the second one, in programming languages such as C or Java it is just the opposite.

 

Re: stack option

Thank you, it worked.

Re: stack option

hi, W works when i give values greater than 2. Is there anyway we can make W  work if m<3 by giving conditions the j indices values xp,yp,xq,yq = 0 when m<3.

 

thank you

Highlighted

Re: stack option

Your approach only works if xp and xq are valid variable which have been assigned a value.

Fortunately there is a simple solution. You have to make sure that the definition of xp and xq does not fail and so you have to avoid that the range j runs into a value below ORIGIN (0). You only have to define the range j a little bit different:   j := 0 .. max(0, m-3)

In this case, when m<3, j becomes a range from 0 to 0, which is valid also for indexing a vector. And your if statement later makes sure that in the case of m <3, the unnecessary values of xp and xq are not included in the vector W.

You may also use the if-function instead, even though its not that clear in display: W:=if(m<3, stack(xa,xb), stack(xa,xb,xp,xq)). Guess its a matter of personal taste - I'd prefer the way you did it.

 

Re: stack option

Thank you. It works perfectly and got to learn new things.

Re: stack option

hi,can you tell me How did you position the coordinates as points instead of the connecting lines for the coordinates (W,V)? and can the point indicate which bolt its referring to?

 

 

Re: stack option

Double click the plot (or  chose from the menu Format-Graph-XY-Plot), select Tab "Traces" and under "type" chose "points" instead of the default "lines". Then you may chose a "symbol" and its size (-> "Symbol Weight").