Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello All,
I am trying to solve an equation that has condition statements and find the roots.
Please help,
Thanks
Solved! Go to Solution.
So you should solve the equation for q0 and not for B.f. You can make the solution a function of B_f as explained in my previous answer.
You may use either a solve block or the root function - its up to you.
You can speedup the calculation significantly (factor 5) by using the approach which I already showed in a previous posting
You could also do it that way:
or maybe even that way
@fahmed-2 wrote:
What if I have two variables to solve!!
Then you would have to use a solve block.
But two variables and just one equation????
BTW, do you really expect non-real results here?
Thank you!! I am using solve blocks and looks great. I was wondering is it possible to get the values for a range of paired values. For example, if I choose my pairs of (V, B_f) to be (1000, 3), (2000,5) ..............(6000,6) then I would want the solution pairs for each individual input and assign them in two other variabes. Here, the values of V (post finding solution) will be assigned to "a" variable and the values of B_f (post finding solution) will be assigned to "b" variable. Please help.
My ultimate goal is, based on the following equation, I would like to find the values of qo for different values of B_f and plot the curve. Please help
Thank you @Werner_E . My original intent is ,based on the following equation, I would like to find the values of qo for different values of B_f and plot the curve. Please help
So you should solve the equation for q0 and not for B.f. You can make the solution a function of B_f as explained in my previous answer.
You may use either a solve block or the root function - its up to you.
You can speedup the calculation significantly (factor 5) by using the approach which I already showed in a previous posting
Get Bf as a vector by using equal at end of definition trick
Create what is called a parametric Solve Block with a function and parameters. Function is bearing, parameter is Bf.
Use the function with element by element of vector Bf to get a vector answer ans
then plot the values required.
Your solve block with just one equation but two variables to solve for does not, make much sense!
You may notice that the solve block returns V totally unchanged and only calculates B.f based on the one and only equation you provide.
If your goal is to get the value of B.f for various values of V, then you should change the solve block to only look for B.f and turn it into a function by writing sol(V):=Find(B.f)
Then Sol(2000 kN)= gives you the B.f value for this value of V.
And you may define a vector Vvec of V-valuse and writing sol(Vvec)= gives you the vector of corresponding B-f values. You should vectorize that function call.