Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
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.
Solved! Go to Solution.
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 ...
It only iterates over the (implied) range variable rv elements until it has reached (implied) index k.
Stuart
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
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
In this picture, i, j, k are vectors.
and t(i ,j, k) is function and " t " function is with vectors.
Are they vectors?
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.
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??
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?
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 ...
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
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
i guess that your mathod isn't support "prime 3.0"....
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