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

Need Help Programing in Mathcad

GregCase
1-Newbie

Need Help Programing in Mathcad

I have a mathcad page that I would like to automate the solution process. I have read the brief expalination in the Help file and wondered if there was a better source of info. If there is someone out there that works on this stuff freelance I would be glad to pay for a solution also. I have attached the file below.

6 REPLIES 6

I just realized that I should better expalin the problem. The object is to input a Optimum Area "AT" and let the program iterate on "h". Seems like it should be simple but I am lost as to how to begin.

Greg,

My understanding of your problem is:

For a given total area "AT" determine the "h" that gives that value of AT

Simple solution is to use a solve block not the programming ability of Mathcad.

Step 1:

Make any equation for a variable with "h" on the left hand side a function with "h" as a parameter.

If you subsequently use in right hand side of new equations any redined variables that are now functions, this has also got to be a function in"h"

Step 2

Now you have a problem with a final equation for AT that is a function of h

Before the solve block you guess a value of what your are trying to find - in this case h

Type "Given" to start the solve block. You only need one equation in the solve block as you only have one guess variable h

This equation is AT(h) = 5 in2. You use the equality equals in a solve block.

Then you use the "Find" statement to get the appropriate value of "h".

Comment

This is a powerful and simple method of iterating even very large problems to a solution. You are not limited to one variable. In the solve block you can have many equations in many variables. You can also use the Minimize and Maximize instead of Find to optimise. the algorithm used to find the solution can obtain different results based on the functions and the start guess values used. It solves for solution nearest the guess value.

Answer.

Have done this for your problem to show you.

Disable the range variable for h and set it as a guess value

Changed variable names into function in h. Working from top to bottom until the AT(h) is made

Used AT(h) = 5 in2 to get right h value.

Hope understanding of what you are after and demonstration is Ok

Yes I will freelance on this stuff. terryhendicott_at_ymail_dot_com Have used MathCad since MathCad 6 a long time ago.

Cheers - Merry Mathcadding.

Greg,

Here is the solution using MathCad programming to show you that is also possible

Terry

RichardJ
19-Tanzanite
(To:GregCase)

If there is someone out there that works on this stuff freelance I would be glad to pay for a solution also.

Consulting is what I do for a living. I frequently give advice here for free though, and I am not so mercenary that I would charge you for some advice just because you offered to pay, even though I give it free to everyone else (I am a consultant, not a lawyer ) Tezza2010 showed you the best way to do this though (using a solve block).

What you will not generally get here is someone to do large chunks of work for you. If you need that I am also potentially available. I've sent you a private message with more information.

MikeArmstrong
5-Regular Member
(To:GregCase)

I have a mathcad page that I would like to automate the solution process. I have read the brief expalination in the Help file and wondered if there was a better source of info. If there is someone out there that works on this stuff freelance I would be glad to pay for a solution also. I have attached the file below.

Like Richard I frequently give advice on here for free as do many users.

Richard is right when he says you will not generally get large chunks of work done for you on this forum. A lot of the time collabs break their problems down to smaller sections and post them.

If I can, I will be happy to help - I'm not as experience as Richard though.

Mike

wayne
3-Visitor
(To:GregCase)

Greg,

A lot of these individule equations can be combined and you can simplify if you use radians in the equations instead of mixing degrees and radians, all the 180's, 90's and 360's and many of the pies (not cakes though) dissapear.

In fact, the whole thing reduces to a quadratic equation in h.

Apparently, I made a small error in what I did, but should be easy to find, I will leave that to you if you want to pursue.

Note that there are two roots, but you probably only need the +squrt term.

The solve blocks are incredibly powerful, but you don't need for this.

Wayne

Top Tags