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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

scalar value

YA_10963798
14-Alexandrite

scalar value

How can  I solve this problem

I use prime 9

YA_10963798_0-1728031584333.png

 

ACCEPTED SOLUTION

Accepted Solutions
StuartBruff
23-Emerald III
(To:YA_10963798)

Good morning, Yusra. 

 

I hope you are also doing well.  

 

There are many ways to skin this particular cat.  Here are a couple, ...

 

2024 10 04 E.png

 

I'm sorry, but I have only Mathcad Prime 10, so the edited worksheet won't be of any use to you. Hopefully, the programs aren't too difficult to enter.

 

I must check where you define that exponential and f1, though.  The max values and the first ones I've checked look suspiciously similar.

 

Stuart

View solution in original post

8 REPLIES 8
LucMeekes
23-Emerald III
(To:YA_10963798)

The f1[i you use in your program is an Array, you cannot compare it to a scalar. Maybe you want to compare it's minimum to 1:

min( f1[i ) < 1

 

Success!

Luc

StuartBruff
23-Emerald III
(To:YA_10963798)

2024 10 04 D.png

 

Edited to add: I see Luc has beaten me to the draw.  Morning, Luc. 🙂

YA_10963798
14-Alexandrite
(To:StuartBruff)

Hi Stuart, 

Hoping you doing well. 

Actually I need the result to vector as well. I needed all the results in f1 to be one or bigger . Do you have any idea to do so?

Thanks in advance,

Yusra

StuartBruff
23-Emerald III
(To:YA_10963798)

Good morning, Yusra. 

 

I hope you are also doing well.  

 

There are many ways to skin this particular cat.  Here are a couple, ...

 

2024 10 04 E.png

 

I'm sorry, but I have only Mathcad Prime 10, so the edited worksheet won't be of any use to you. Hopefully, the programs aren't too difficult to enter.

 

I must check where you define that exponential and f1, though.  The max values and the first ones I've checked look suspiciously similar.

 

Stuart

YA_10963798
14-Alexandrite
(To:StuartBruff)

Thank u . It works the way it should. 

If you have some time can you explain what does this expression mean? 

YA_10963798_0-1728037366530.png

 

StuartBruff
23-Emerald III
(To:YA_10963798)

 

It uses boolean results to select which value you want.  All Mathcad comparisons return 1 (true) or 0 (false), so if you multiply a boolean by any number you get that number back.

 

In the case above, when an f1 value is less than 1, f1 < 1 = 1, f1 ≥ 1 = 0, so the whole expression is 1 + 0 · exp3DRe which is just 1. 

 

Similarly, if the f1 value is greater than 1, f1 < 1 = 0, f1 ≥ 1 = 1, so the whole expression is 0 + 1 · exp3DRe which is exp3DRe.

 

Hope that helps, Yusra.

 

Stuart

 

PS.  My previous mystery was solved.  The f1 values are the same as the exp(3·DRe) value.  Is there a reason you redo the calculation rather than just leaving the f1 values as they are?

YA_10963798
14-Alexandrite
(To:StuartBruff)

This is very fruitful . Thank you so much. 

I redid the calculation because I needed to show that the first calculation doesn't meet the criteria ( f1<1) so I wanted to show that I make an assumption that all the values less than 1 will be equal to one in the coming calculations 

StuartBruff
23-Emerald III
(To:YA_10963798)

No problem, Yusra.

Announcements

Top Tags