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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

I have a problem

jlee-2
7-Bedrock

I have a problem

%EC%BA%A1%EC%B2%98.PNG

I am getting error such as picture.

I tried to solve my problem. But I don't know. Could you help me?

15 REPLIES 15

I can see at least 2 problems that will stop your sheet working.

if p=0 then V(p,e) will be 0 and p2 tries to divide by 0.

Start with p=0.1 & this is OK.

in the program you compare p a single value with the result p2 (a vector),

Should the while loop stop when any ony of the conditions is met, or all of them?

Andy

Next problems are that neither e nor the results of v() and p2() are vectors at all - they just look similar.

Furthermore the argument mu of the function pe() is not used at all, so its not clear to me what the function tries to achieve. It seems that it should solve the equation p=p2(p,e) for p. Not sure why its done using that for-loop.

jlee-2
7-Bedrock
(To:Werner_E)

Next problems are that neither e nor the results of v() and p2() are vectors at all - they just look similar.

I don't understand this sentence well.

so If you are possible, Could you explain again by using example?

1.PNG

this is a picture that you attach for me

2.PNG

and this is a picture that I made

first picture and second picture are same because I followed.\

But I got error. I don't know why I got error.

Werner_E
25-Diamond I
(To:jlee-2)

Why don't you post pictures and not the actual, failing worksheet?

Delete the equal sign after the function definition!

jlee-2
7-Bedrock
(To:Werner_E)

I am sorry that I don't understand well

why do you said to me that post pictures?

Werner_E
25-Diamond I
(To:jlee-2)

jinsuk Lee wrote:

I am sorry that I don't understand well

why do you said to me that post pictures?

You just gave us a picture of the error you encountered but its usually hard to debug a picture. Its much better and more likely that someone can find the error if you attach your Mathcad sheet

Werner_E
25-Diamond I
(To:jlee-2)

I guess that you get a much better precision if you use a solve block or the root function rather than a crude iteration in steps of 0,1. See the picture.

Furthermore if you intend to use yor results for further calculations I would strongly suggest that you use vectors and not ranges.

1.png

jlee-2
7-Bedrock
(To:Werner_E)

Thank you for adivice

But I have a question.

this picture on upper is that initial value is p. It means that initial value is just one.

But I need to use initial values for further caculations.

it means that initial valuses are p,q.

Is it possible to express 'root function'

For example in case of a picture.

fgfghfgh.PNG

Werner_E
25-Diamond I
(To:jlee-2)

Root will only solve for one variable.

For more variables I would suggest using a solve block with Find od MinErr.

I don't see any p and q in your picture, but you sure have a problem - the definitions I see in your picture are just a big nonsense. You use x in 3 different ways - as a scalar, a function with one argument and a function with 3 arguments. You define functions x and y which should depend on an argument f but are not dependent on f at all.

You sure will have to work more carefully!

jlee-2
7-Bedrock
(To:Werner_E)

Thak you for advice.

Actually I can't understand well. But I think I may resolve due to your help.

Thank you

Werner_E
25-Diamond I
(To:jlee-2)

Here is an approach using vectorization and also using a solve block. You can work from there expanding it to more than one variable.

jlee-2
7-Bedrock
(To:Werner_E)

very thank you to help me.

your example file helped me very much.

Werner_E
25-Diamond I
(To:jlee-2)

I don't see where your problem is - probably because you did not provide the Excel file. So I haven't scrolled further down but maybe you are trying to solve for two varaibles (a, a') and so you should use a solve block and not the root function as shown below.

In your sheet you still use your simple variable increment method mixed with root so I don't know what you try to achieve. Maybe, if you have further questions, you streamline yout sheet so it clearly shows whats unclear to you.

I also noticed that you used READEXCEL inside an Excel component - don't think that this makes much sense and you should decide either for the one or the other.

1.png

Werner_E
25-Diamond I
(To:jlee-2)

Please do not delete postings or attachment you have already asked a question about!

Announcements

Top Tags