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

Can you store multiple solutions of a Find function which has a vector as a constant?

dhanson-2
1-Newbie

Can you store multiple solutions of a Find function which has a vector as a constant?

I have a program that uses the Find(x) function to solve for the allowable length of a beam whose design is based on a series of moments and shears.  The file attached is a very simplified version of what I am trying to do in the actual program.  One of the constants (in this case y) is a vector of fixed values.  I want to solve the system of equations for x using the three different values of y and store each of the results for x in a new vector.  Can someone assist me in developing the correct notation to get the desired solution?

Thanks,

Derek

4 REPLIES 4
-MFra-
21-Topaz I
(To:dhanson-2)

at first glance, it seems to me that this is the solution:

sol00.jpg

At first it has to be said that this is NOT a system of equations! Its just one equation in one variable which you defined using some helper functions m and n.

I guess that you posted a simplificated version of your real problem and so I was not sure, if the guess value for x should be the same for any y or if you really want to provide a different guess for every value of y - so I provided both versions.

If you want to evaluate a solve block for different input values its always the best solution to write the solve block for a single scalar input variable (in your case y), turn it into a function (!!) and then call that function with a vector of inputs. That function call should be vectorized to be on the safe side.

Here is the solution using the same guess x=0 for every value of y:

And here is the modification which allows you to provide the guess value as additional function argument. In your example there are always two solutions and it depends on the guess value which one you get:

Of course your simplified equation could easily be solve symbolically which gets you both solutions for every value of y at once:

Regards Werner

This was helpful but we are still not getting exactly what we are looking for.  I have attached two files. The 1 Zone file is the calculations that we are currently running.  The All 3 Zones calculation turns wx7 into a vector to run the analysis for three separate values.  Can you take a look at the attached and let me know if there is a way to get the vector analysis to work?

Hi Derek.

The problem is in the abs function: with a vector it is the norm.

In the attached, a workaround.

Best regards.

Alvaro.

Announcements