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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

is it possible to integrate "vector"?

jlee-2
1-Newbie

is it possible to integrate "vector"?

I tried to know by searching "google" and "PTC site".

But I don't know well.

Just, I saw two posting.

one is said that "vector" couldn't integrate

the other is said that "vector is possible to integrate"

so I felt confused..

I need help.

1 ACCEPTED SOLUTION

Accepted Solutions

Stuart Bruff wrote:

If it's a range variable, then it won't work because you can't directly use an index to get a value from a range variable.

... although, you could write a function that operates on a range variable via a for loop and returns the value, eg

rvValue(rv,k):=v<-vec(rv)

return v[k

Here's another, more efficient version, that works in Mathcad 14 and should work in Prime ...

collab+-+14+11+23+range+variable+indexing+01.jpg

It only iterates over the (implied) range variable rv elements until it has reached (implied) index k.

Stuart

View solution in original post

15 REPLIES 15
Fred_Kohlhepp
23-Emerald I
(To:jlee-2)

A vector is a list of values,discrete points.

You integrate a function.

I mean that

For example

imagin that there is "t" function

.

and it has 3 vector index

that is, t(i, j, k)

I integrated " t " function with 3 vector. But mathcad couldn't solve.

so I wonder if it is possible to integrate function with vectors

Fred_Kohlhepp
23-Emerald I
(To:jlee-2)

Functions don't need vector indices.

Read the help files, learn how this software works.

I already read several times.

I intended to following picture

4.PNG

In this picture, i, j, k are vectors.

and t(i ,j, k) is function and " t " function is with vectors.

Are they vectors?

StuartBruff
23-Emerald II
(To:jlee-2)

See my reply to your first thread on integrating vectors - you need to check whether i, j and k are actually vectors or whether they are still range variable.

In general, you can't integrate a vector because the functions don't naturally vectorize, but you can can usually simply apply the vectorize operator to the integral and that should work.

Stuart

StuartBruff wrote:

See my reply to your first thread on integrating vectors - you need to check whether i, j and k are actually vectors or whether they are still range variable.

In general, you can't integrate a vector because the functions don't naturally vectorize, but you can can usually simply apply the vectorize operator to the integral and that should work.

Hardly, if the integration variable (i ) is also used as vector index (c.r[i) as is the case in Jinsuk Lee's sheet.

StuartBruff
23-Emerald II
(To:Werner_E)

Werner Exinger wrote:

StuartBruff wrote:

See my reply to your first thread on integrating vectors - you need to check whether i, j and k are actually vectors or whether they are still range variable.

In general, you can't integrate a vector because the functions don't naturally vectorize, but you can can usually simply apply the vectorize operator to the integral and that should work.

Hardly, if the integration variable (i ) is also used as vector index (c.r[i) as is the case in Jinsuk Lee's sheet.

Hi Werner,

True, in Jinsuk's particular case where he wants to use the vector as an index. In which case, he isn't integrating a vector, merely using it to select the limits. However, I was addressing the general case with my comment.

Unfortunately, I can't check his worksheet because I've only got Prime Express, which doesn't evaluate programs, so I'm reduced to eyeballing it.

Stuart

is it mean that I can't integrate??

StuartBruff
23-Emerald II
(To:jlee-2)

jinsuk Lee wrote:

is it mean that I can't integrate??

The answer depends upon what you want to do.

Do you want to do something like

f(x,a,b):=<integral><a><b>something_depending_on_x<dx>

and then apply it to a vector

eg, f(v,a,b)= ...?

where v is a vector.

In this case, the vectorize operator might very well work

<vectorize>f(v)

However, you have something like

f(x,v,a,b):=<integral><v[a><v[b>something_depending_on_x<dx>

which should work fine (provided the integral has a solution between v[a and v[b !!).

As I said, you need to check whether "i" is really a vector or still a range variable.

If it's a range variable, then it won't work because you can't directly use an index to get a value from a range variable.

... although, you could write a function that operates on a range variable via a for loop and returns the value, eg

rvValue(rv,k):=v<-vec(rv)

return v[k

Stuart

I checked my work.

And then I knew that " i ,j ,k " is "range variable"

Now I can't integrate. is that right?

If I want to integrate, I need to change them to "vector". Is that right?

StuartBruff
23-Emerald II
(To:jlee-2)

jinsuk Lee wrote:

I checked my work.

And then I knew that " i ,j ,k " is "range variable"

Now I can't integrate. is that right?

If I want to integrate, I need to change them to "vector". Is that right?

Yes, you need to change them into vectors, or create a vector equivalent.

eg, using my vec function

vi:=vec(i)

This will leave i as a range variable but create a vector equivalent vi that you can use inside your integral to select the limits.

Stuart

Stuart Bruff wrote:

If it's a range variable, then it won't work because you can't directly use an index to get a value from a range variable.

... although, you could write a function that operates on a range variable via a for loop and returns the value, eg

rvValue(rv,k):=v<-vec(rv)

return v[k

Here's another, more efficient version, that works in Mathcad 14 and should work in Prime ...

collab+-+14+11+23+range+variable+indexing+01.jpg

It only iterates over the (implied) range variable rv elements until it has reached (implied) index k.

Stuart

thank you for helping

now I may know a little. but I guess I can apply method that you know me.

thank you very much

StuartBruff
23-Emerald II
(To:jlee-2)

jinsuk Lee wrote:

thank you for helping

now I may know a little. but I guess I can apply method that you know me.

thank you very much

No problem, Jinsuk. I hope it works.

Stuart

5.PNG

i guess that your mathod isn't support "prime 3.0"....

6.PNG

I attached my "xps" file because you can't open my file.

may be, it is messy because I can't arrange.

when you open it, you can some equation.

it are simpson, trazepoid equation that I used to try to integrate because I couldn't integrate thorugh equation in mathcad

Top Tags