Skip to main content
1-Visitor
July 20, 2014
Solved

Overwrite variabel from reference file?

  • July 20, 2014
  • 1 reply
  • 3112 views

Hello

Im writing my master thesis and the idea is to have a reference file for all functions

sadly if i do not write out the variabels before the function, i need to "call them" in the function name

ending up with a function with 20 variables such as

func(a,b,c,d,e,f,g, etc etc) and the function will not fit in a printable area

My idea is therefor

to put all values equal to 0 in the reference file and then rewrite the values when the reference file is used

sadly i fail to do so since the values from the reference files are used even when I rewrite them.

The idea is that i want to do something like this, and in the "regular file" get the value 2 instead of 0

question.png

I know this is a bad function but its used only to demonstrate my problem. Is there any way to rewrite the values from the reference file?

Or do i really have to end up with a function in reference file as "func(a,b)=..."

Appreciate your help since this is the last step left in my master thesis and all the programming is done properly

Im using Mathcad 15

Best answer by ptc-4255497

This would work, but since my reference file is according to Eurocode, id like to keep the variable names

i just found a solution similiar to yours, my next question is

id like to put the variable L to define "length" in the reference file

but its already redefined as a built in variable.

Is there a way to delete the pre-defined value in the reference file, else i could just change the font that seemed to work.

simple i want to delete this pre-built L

deletethis.png

1 reply

19-Tanzanite
July 20, 2014

You could put all your variables into a vector, v:=(a, b, ... etc) and then pass the vector name, v to the function.

e.g.

refparams.PNG

However, if your parameters had different units you would need to remove the units for purposes of creating the vector as M15 doesn't like mixed units in a vector.

Alan

ptc-42554971-VisitorAuthorAnswer
1-Visitor
July 20, 2014

This would work, but since my reference file is according to Eurocode, id like to keep the variable names

i just found a solution similiar to yours, my next question is

id like to put the variable L to define "length" in the reference file

but its already redefined as a built in variable.

Is there a way to delete the pre-defined value in the reference file, else i could just change the font that seemed to work.

simple i want to delete this pre-built L

deletethis.png

25-Diamond I
July 20, 2014

Jafar Al-Djaber wrote:

This would work, but since my reference file is according to Eurocode, id like to keep the variable names

i just found a solution similiar to yours, my next question is

id like to put the variable L to define "length" in the reference file

but its already redefined as a built in variable.

Is there a way to delete the pre-defined value in the reference file, else i could just change the font that seemed to work.

L is used for the unit liter in Mathcad. As soon as you define your own variable L the liter are gone. You can tell MC not to moan abou the redefinition by the green wavy underline in the options.