Skip to main content
1-Visitor
October 13, 2010
Solved

Create a vector from the result of a function

  • October 13, 2010
  • 5 replies
  • 13361 views

Hi

I have a MathCAD sheet that applies a function to a range variable.

e.g. t:= 0,0.001..1

x(t):=2 * t

How can I then convert x(t) into a vecor e.g Y:=x(t)

Thanks

Scott

Best answer by MikeArmstrong

Something like the attached?

Mike

5 replies

1-Visitor
October 13, 2010

Something like the attached?

Mike

1-Visitor
October 13, 2010

Instead of using a range variable you could just create a range vector, see attached image.

Mike

3-Newcomer
October 13, 2010

How about

t:=0,0.001..1

Y[t*1000 := t*2

This works only because the range t is uniform...it would still work w non-uniform ranges, but not as you might expect...try w ranges as short as, say, 5, elements, and you will see what I mean...

~R~

1-Visitor
October 13, 2010

Y[t*1000 := t*2

Do you mean Y[t*100?

This is a horrible way to go about it though, don't you think?

Mike

3-Newcomer
October 13, 2010

Well...I based my response on the original post...

e.g. t:= 0,0.001..1

x(t):=2 * t

which looks to me as if it is 1/1000 of the interval twixt 0 and 1. But I could be mistaken...at any rate, it is the technique that I am referencing...

~R~

S00tt1-VisitorAuthor
1-Visitor
October 13, 2010

OK.

I dont quite have the answer Im looking for. I've already calculated everything and at the end of the sheet I have values for say x(t). I now need to convert x(t) into a vector. It's a big worksheet which isnt mine so cant change it much. I just need to x(t) in a vector form to transfer it to LabVIEW. t is a non-integer range variable.

1-Visitor
October 13, 2010

Can you post the actual data?

t is a non-integer range variable.

Do you mean t is a non-uniform range variable?

Mike

Message was edited by: MikeArmstrong

1-Visitor
October 13, 2010

so if you can create a vector for the result of a function.

then you can use the max function to find the maximum. Will this be faster than doing a solve block

19-Tanzanite
October 13, 2010

It might be faster, but it will certainly be much less accurate: onlly half the increment of the independent variable.

12-Amethyst
October 13, 2010

I work with a brute force scan for minimizing, but can't find it. An algorithm without derivatives -incomplete, just for working- can be found in http://communities.ptc.com/servlet/JiveServlet/download/135434-15924/minimize_parabolic_golden.mcd at http://communities.ptc.com/message/135438.

The method of searching extremas discretizing first and looking for the maximun is usual with matlab. This also provide absolute max or min, while the derivatives methods search for local extremas.

Regards. Alvaro.