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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Function MAXIMIZE/MINIMIZE

PaulFrieze
1-Newbie

Function MAXIMIZE/MINIMIZE

11 REPLIES 11
MikeArmstrong
5-Regular Member
(To:PaulFrieze)

No worksheet attached.

Regards

Mike

Can you not post the Mathcad document?

Regards

Mike

When I unzipped the file, it is named as M11 but appears to be a M14 xmcdz file. Opening the xls file generates a formatting error, but the data seems intact.

I've saved the file as M11, but from M14, so don't know how it will work...anyone can download the zip file for the data.

When I went to upload the worksheet, it turned out to be 3MB, so that is too large to upload...

Rich
http://www.downeastengineering.com/

I have converted the original file. I don't think that I lost anything in the process.

The xls data input object is disabled.

Rich
http://www.downeastengineering.com/

Don't have time to look at it in detail, but at the bottom of your worksheet you assign Ih_pr[i a value that you get by calling f() with Ih_pr, which is a single value at that point. So Ih_pr starts out as a value and then gets changed to an array. You index on "row", but never use row. Is that your intent? Can you explain in words what you hoped to accomplish at the end of the worksheet where you assign values to Ih_pr?

Rich
http://www.downeastengineering.com/

My scope is to calculate Ih_pr from the function UR(I.h_pr) which is function of the functions listed above which depend on I.h_pr too. I want to do that for each row of my data. So the parametres l, t, psd, z, r etc... should change time by time. I expect a vector I.h_pr with different values in each row.

Regards

Your function αr (and subsequent similar functions) depend not only on the formal argument Ih_pr but also on the value of the worksheet variable row. You really need to make that explicit by making row a formal argument. As written, the function is defined using the current value of row. And later definitions for row have no effect on the function you have defined.
__________________
� � � � Tom Gutman

I tried to do what you adviced me so far. It seems that doesn't work anyway. I expect a vector which has to contain the result (I.h_pr)for each row analysed. I had a vector but I didn't understand what it means.



I hope I understood what you meant.



Please find attached the file to have a look.



Thank you



Regards



Martino Abbattista

Pretty close. But you need to end up defining a scalar function (whose evaluation can be iterated as needed) rather than a vector. In general it's better to create functions rather than vectors, reserve the looping over the cases to create a vector of results to the end of the process.

As a separate note, don't post zip files. They are a pain to work with. Post the actual Mathcad worksheets (the XMCDZ format without generated images is quite compact). When you have data files post them also, just once, and point your worksheets to the uploaded files (Mathcad file imputs work fine with URL's as file names).
__________________
� � � � Tom Gutman
PhilipOakley
5-Regular Member
(To:TomGutman)

On 12/10/2009 4:45:21 PM, Tom_Gutman wrote:

>As a separate note, don't post
>zip files. They are a pain to
>work with. Post the actual
>Mathcad worksheets (the XMCDZ
>format without generated
>images is quite compact).
>When you have data files post
>them also, just once, and
>point your worksheets to the
>uploaded files (Mathcad file
>imputs work fine with URL's as
>file names).

Supplemental note: The XMCDZ format is a type of
Zip file, and can be decoded by GZIP etc.

So as Tom says, just post the XMCDZ file
(making sure you have set the File Properties' XML
options not to generate images! )

Philip Oakley

Thank you very much for your help. I solved my problem even though your suggestions were not completely correct but I found the way.

Sorry if I made mess into this forum by posting files that I should not have posted.

Regards

Martino Abbattista
Top Tags