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

Calculating in which integration limits come from a list

gwestbrook
1-Newbie

Calculating in which integration limits come from a list

Making some progress... that book I bought can't come soon enough.  But one more for this week...

In the attached worksheet, I've attempted to do a repeated calculation without resorting to a program in which I want the limits of integration to come from a vector.  This is just the first thing I thought of, there could very well be a better way.  My list of wavelengths in this case is generated by calculation but in the real world each one could be arbitrary and be entered manually.

But I'm getting the "A name is required here" message which doesn't (yet) mean much to me.  Further, the expression seems to only evaluate one value rather than create a long list of calculated values.  I'm actually a bit surprised that it calculates anything at all given that there is an error right before it.

I was hoping someone here could explain to me what is going on.

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:gwestbrook)

It means a variable name. You can define a variable with a subscript, which will give you a vector. So I[i:=(stuff that depends on i) is OK. You cannot define a function with a subscript though. If that were allowed you would not get a function that returns a vector, you would get a vector of function definitions. So I(T)[i:=(stuff that depends on i) is not OK. Use the vectorize operator to make Mathcad generate a result for each value of lambda:

The reason you got a result despite the error is because you had a prior definition for I(T), so it reverted to that.

View solution in original post

1 REPLY 1
RichardJ
19-Tanzanite
(To:gwestbrook)

It means a variable name. You can define a variable with a subscript, which will give you a vector. So I[i:=(stuff that depends on i) is OK. You cannot define a function with a subscript though. If that were allowed you would not get a function that returns a vector, you would get a vector of function definitions. So I(T)[i:=(stuff that depends on i) is not OK. Use the vectorize operator to make Mathcad generate a result for each value of lambda:

The reason you got a result despite the error is because you had a prior definition for I(T), so it reverted to that.

View solution in original post

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."