Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Calculating in which integration limits come from ...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

06-26-2015
12:03 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-26-2015
12:03 PM

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.

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

06-26-2015
12:30 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-26-2015
12:30 PM

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.

1 REPLY 1

06-26-2015
12:30 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

06-26-2015
12:30 PM

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.