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
- :
- Programming in Matchad

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

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

11-01-2013
06:40 AM

11-01-2013
06:40 AM

Programming in Matchad

Hi!

I would like to program the following 20 steps (see the attached file) in Mathacad. It is an itteration process.

Is it easy to do it if you have the right programming skills or is it to big of a problem to tackle in mathcad?

Appreciate any help, thanks in advance!

Labels:

10 REPLIES 10

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

11-01-2013
03:15 PM

11-01-2013
03:15 PM

Re: Programming in Matchad

All modern mathematics programs, Excel, Mathcad, and Matlab, have built-in facilities to solve problems like this without user programming. I suggest you read "Mathcad Solve Block" in the help files. A solve block simply requires that you provide an expression that could produce the result that you want, provided that some variable is changed. You close the solve block with Find(variable)= or Minerr(variable)=.

No programming required. See Excel's "Goal Seek" and "Solver" for similar functionality.

TTFN

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

11-03-2013
07:08 AM

11-03-2013
07:08 AM

Re: Programming in Matchad

Ok, Thanks a lot!

After a quick look att the help files i´m wondering how the solve block works. Could you see what is the problem in the attached file.

I´would like to solve x. There is a angle x who gives the right τxy.

/E

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

11-04-2013
01:21 AM

11-04-2013
01:21 AM

Re: Programming in Matchad

I'm sorry, I don't see what you are attempting to do. What equation is satisfied when x is found? You have nothing in the expressions that depend on x.

N.B, there should be no := expressions within a solve block. The only thing that should be within the block are constraints, i.e., something like:

TTFN

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

11-04-2013
08:22 AM

11-04-2013
08:22 AM

Re: Programming in Matchad

You already asked this question: http://communities.ptc.com/message/225226#225226

As already pointed out by Werner, your first and third equations are identical. Also I don't see the relevenace of the second equation. You define sigma_cy in terms of a chosen angle, x. If you then solve the third equation for x all you will get back is your initial x, because the third equation is identical to the one you used to calculate sigma_cy.

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

11-04-2013
09:46 AM

11-04-2013
09:46 AM

Re: Programming in Matchad

Hi again and thanks both of you for your help!

Sorry for the confusion regarding the third equation. It´s true that the third and the first equation are identical and perhaps unnecessary.

What i´m trying to do herer is to solve σsy.To do so there is a unik angle (x) and a value of σcy in the third equation who equalls with τ.xy = 5.07*MP.

What i would like Mathcad to perform is with a guess value of x calculate a σcy with the first equation. Then put the value of the calculated σcy and the associated angle in the third equation and compare τxy with the Given τxy.

If not equal then change the value of x and try again. When the condition is met τxy=Given τxy then stop.

Use now σcy to calculate σsy.

I´m sure therer are several ways to do it but i dont think that i have the rights skills here

./E

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

11-04-2013
12:07 PM

11-04-2013
12:07 PM

Re: Programming in Matchad

Your equations don't seem to make sense unless the σcy equation is eliminated. This results in x=0.184986, but as written, the value can be simply solved algebraicly

TTFN

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

11-05-2013
07:19 AM

11-05-2013
07:19 AM

Re: Programming in Matchad

Thanks! You are right, i nedd to find one more unik expression for sigma_cy.

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

11-04-2013
10:10 AM

11-04-2013
10:10 AM

Re: Programming in Matchad

Where does sigma_sy fit into this puzzle?

Can you relate tau, sigma_cy and sigma_sy?

As written I can't figure out how sigma_sy affects what you're trying to solve

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

11-04-2013
10:51 AM

11-04-2013
10:51 AM

Re: Programming in Matchad

You are right now that i´m looking att it again the puzzle dont fit. I need to find one more association.

Back to the drawing board.

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

11-04-2013
08:18 AM

11-04-2013
08:18 AM

Re: Programming in Matchad

Is it easy to do it if you have the right programming skills or is it to big of a problem to tackle in mathcad?

Yes, it would be easy to do with the right skills. A lot easier than doing it in Excel, and no harder than doing it in another high level language such as Matlab. If you don't have the right skills though, well...

The key to doing most things in Mathcad that are a step beyond trivial is to write the worksheet in terms of functions. If you want to solve for angle, write your expressions as functions of angles.

As already pointed out though, unless there is something very unusual about the iterative process you can probably use the built in solvers to find your answer.