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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Split numeric solution

CamilleLaflamme
6-Contributor

Split numeric solution

Hi,

I'd like to split the numeric solution of my equation to show the influence of the two factors without having the define new variables. I need to keep it as simple has possible. See p.7 

For exemple ; 

uc = 3 + 0.5   (where 3 is the section a and 0.5 the section b)

uc = 3.5 

 

Thank you !

Camille

 

Split numeric solve.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

Im afraid that's not possible.

With the symbolic processor you can collect expressions on certain items. Consider e.g.:

LucMeekes_0-1592568472239.png

You can do the following:

LucMeekes_1-1592568503198.png

But the numeric processor does not have this capability.

Now you might try to use the symbolic processor to get the numeric answer by using the 'explicit' keyword. But I doubt that you can achieve the desired result, mostly because it is very hard to force the symbolic processor in its output. Not also that the symbolic processor generally does not handle Units the way the numeric processor does, or the way you might hope it does.

I think defining two variables, or function to hold the two expression parts is the best option to keep them separated.

 

Success!
Luc

View solution in original post

7 REPLIES 7

Im afraid that's not possible.

With the symbolic processor you can collect expressions on certain items. Consider e.g.:

LucMeekes_0-1592568472239.png

You can do the following:

LucMeekes_1-1592568503198.png

But the numeric processor does not have this capability.

Now you might try to use the symbolic processor to get the numeric answer by using the 'explicit' keyword. But I doubt that you can achieve the desired result, mostly because it is very hard to force the symbolic processor in its output. Not also that the symbolic processor generally does not handle Units the way the numeric processor does, or the way you might hope it does.

I think defining two variables, or function to hold the two expression parts is the best option to keep them separated.

 

Success!
Luc

I see.

Thank you !! 

Camille

Best you might do:

FredKohlhepp_0-1592570672150.png

 

Yeah. that is very clear ! I'll go with this proposition.

Thank you

 

Another Mathcaddy way of doing things - return the values as components of a vector ...

 

2020 06 20 A.png

2020 06 20 B.png

 

Stuart

LucMeekes
23-Emerald III
(To:StuartBruff)

Great idea. Note that you don't need to transpose the vector:

LucMeekes_0-1592662675979.png

Success!
Luc

StuartBruff
23-Emerald II
(To:LucMeekes)

Thanks, Luc. You are quite right that it doesn't need transposing for this particular result. However, it makes indexing simpler when the result is in vector form and some functions/operators require a vector, so I just make it a habit to do the transposition.

.... I'm not sure whether it be a good idea to apply vector functions to single-row arrays or not. It might help or it might make things more confusing.

Cheers,

Stuart
Top Tags