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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

New User with a Programming Question

CoreyKerns
1-Newbie

New User with a Programming Question

Hello,

I am a Virginia Tech Grad student and a Coast Guard officer doing some thesis work in Ship Design. I am using MthCad to program an Energy Calculator that will calculate fuel usage for different engine plant configurations. I have come a across a problem that I need help with.

Could someone explain to me how to program a MathCad file to use a discreet choice to decide which equations to use. I though the "if" command would work but it doesn't seem too.

In my program there are three discreet choices for how to calculate the fuel usage and these choice depend on plant configuration, i.e. mechanical, electric, and hybrid.

The equations for each plant type would use the same variables. So how you program MathCad to say if Mechanical follow these equations, if electrical follow these and so on but keeping the same variables.

I've tried assigning the plan configs numbers 1 - 3 and then using if statements to say if PlantConfig=2 use this set of equations. But I am a novice at MathCad and can't fine help locally.

Thank you,

Corey

12 REPLIES 12
MikeArmstrong
5-Regular Member
(To:CoreyKerns)

Corey,

Have you solved this problem, if not would you upload a worksheet.

Mike

Hello Corey,

it is not easy to guess what you're after (without an example that is), but maybe this will help. It works fine in the attached MC11 file

Raiko

MikeArmstrong
5-Regular Member
(To:Raiko)

Raiko Milanovic wrote:

Hello Corey,

it is not easy to guess what you're after (without an example that is), but maybe this will help. It works fine in the attached MC11 file

Raiko

Raiko,

While your worksheet is a valid option, it could be nothing like what is required. Instead of second guessing, Corey should provide a worksheet for us to work with.

Mike

While your worksheet is a valid option, it could be nothing like what is required.

I'm sure it's something like what is required. I agree that seeing the original worksheet would help a lot though (as always!)

MikeArmstrong
5-Regular Member
(To:RichardJ)

Richard Jackson wrote:

While your worksheet is a valid option, it could be nothing like what is required.

I'm sure it's something like what is required. I agree that seeing the original worksheet would help a lot though (as always!)

OK, its clearly close to what is required, but you get my point with the worksheet.

Mike

You have ideas but no data. You should have several data tables relating pertaining to each type of configuration. From there it might appear some sort of inductive idea how to apply some optimization scheme. The work sheet in example does not seem to relate to your unknown project.

Would something like this work for you? You could always implement some type of program to choose the i's based on some other parameter if you needed to.

MikeArmstrong
5-Regular Member
(To:NormalVector)

Stephen Guimond wrote:

Would something like this work for you? You could always implement some type of program to choose the i's based on some other parameter if you needed to.

Stephen,

No worksheet to work with - no point trying to help.

Mike

MIke Armstrong wrote:

Stephen Guimond wrote:

Would something like this work for you? You could always implement some type of program to choose the i's based on some other parameter if you needed to.

Stephen,

No worksheet to work with - no point trying to help.

Mike

This web communities has the fine feature of training the memory [at least mine]. It is so difficult to keep track that instinctively it "punch card" in the gray matter. The project does not have data from collection only conclusive entries. So, what the collab has is only a "bingo card". There was a similar "bingo card" project in the former Akiva forum, but it was about tomatoes.

>I am a Virginia Tech Grad student and a Coast Guard officer doing some thesis work in Ship Design<

_________________________________

Mathcad works with numbers, data, functions, equations ...etc

But you have nothing for collabs !

Could someone explain to me how to program a MathCad file to use a discreet choice to decide which equations to use. I though the "if" command would work but it doesn't seem too.

In my program there are three discreet choices for how to calculate the fuel usage and these choice depend on plant configuration, i.e. mechanical, electric, and hybrid.

The equations for each plant type would use the same variables. So how you program MathCad to say if Mechanical follow these equations, if electrical follow these and so on but keeping the same variables.

There are a huge number of ways that can be made to work. One that should be nearly independent of version is attached.

The question is: what was Corey after ?

1. la greluche rose

2. un australopithéque

3. the Graal

................................

Attached an almost "infinite passerelle", c/w the discretized range + export.

Top Tags