Skip to main content
1-Visitor
July 25, 2018
Question

lighten code "fixed end moments"

  • July 25, 2018
  • 2 replies
  • 4376 views

Greetings.

The code (painted red on the worksheet) is delayed when I change the data, I would like to know if there is any way to lighten it.

 

Also, I do not know if there is any way to create a function that when entering the data (painted with blue in the worksheet), get the results "Reactions" (painted in yellow on the worksheet) -that would help me a lot Smiley Happy - or also some way to keep the code waiting until you enter the data.

 

The code that I programmed is to find the "fixed end moments" of distributed loads, until now I have only checked it with the cases that appear in the sheet in screenshots.

2 replies

23-Emerald IV
July 25, 2018

See if this helps you further.

 

Success!
Luc

25-Diamond I
July 25, 2018

If I understand correctly you find it annoying that when you change the four input values Mathcad starts its calculation as soon as you changed the first and works calculating your integrals while you change the second, etc.

One way out would be to put all input values in a vector. As long as the focus/cursor is in the vector Prime will not recalculate.

B1.jpg

 

According your integrals: Its bad habit to use the variable of integration also as a limit. While Prime will accept that notation its mathematically incorrect. For example instead of writing

B01.jpg

you should write something like

B02.jpg

Also a bit confusing in your multiple integrals is the multiple use of the same variable of integration. Is this really as it should be?

Which of the two results is the correct one:

B2.jpg

If its the first as used in your sheet, you may consider a notation like

B3.jpg

 

25-Diamond I
July 25, 2018

Addendum: Creating a function with the four input values as argument and the yellow results as return value would require you to rewrite all calculations and turn them in functions depending on the four inputs.

So the first would be to change q(z) to q(z,q1,q2,L1,L2):=...

The same is true for your various multiple integrals and the solve block. You will have to turn all them them into functions of the inputs.

The next picture shows how you could turn the solve block into a function and use it.

I also used Lucs simplification of the if-construct.

B.jpg

Yuradi1-VisitorAuthor
1-Visitor
July 25, 2018

all good, but when I want to get the results I get an incompatibility of units.captura1.jpg