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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Use of solve block with vector inputs

EricHong
1-Newbie

Use of solve block with vector inputs

Hi,

I'm trying to do a tolerance analysis on an actuation system so that the inputs to the solve block are vectors containing minimum, nominal, and maximum dimensions of parts of interest.

I've attached the file.

Currently, the solve block "kinda" works except for the followings:

  1. the answer it gives is a scalar
  2. if the input vectors contain same values: all nominal, all minimum, or all maximum, scalar answer that the solve blocks calculates has a correct value
  3. as soon as I mix elements in the vectors: nominal, maximum, and minimum, then the solve block produces a ball-park value scalar.

Maybe the vectorizations in the file (especially, inside the block) isn't right?

The bottomline is I need a vector output corresponding to different tolerances.

Can anyone help me with this?

Thanks in advance,

Eric

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:EricHong)

You defined Xp as a scalar, so that's what you got out of the solve block. If you want a vector you must define it as a vector.

You need to be careful when you multiply two vectors. Unless you explicitly vectorize, what you get is a scalar (the inner product), not a vector. I changed this in several places in the solve block to what I think you actually want. If I was wrong, you will have to change them back.

View solution in original post

20 REPLIES 20
RichardJ
19-Tanzanite
(To:EricHong)

You can't do it like that. You have to make the solve block into a function, then call the function for each set of parameters. If you don't know how to do that please post a version of the worksheet that has scalar values, not vectors (sorry, too busy/lazy to modify it myself).

Here it is.

Thanks,

Eric

RichardJ
19-Tanzanite
(To:EricHong)

You were 99% of the way there already.

So, it seems like my tolerance value can only be a scalar. What I actually wanted to was to use a random normal distribution function to do a 3 sigma like analysis.

When I replaced

d_theta_crnk

with

rnom(100, theta_crnk_o, one sigma)

Mathcad didn't like that.

Is it possible to use a vector for d_theta_crnk?

Thank you very much for your help,

Eric

RichardJ
19-Tanzanite
(To:EricHong)

Choose a single X value and it work fine (you have to vectorize it of course).

Or do you need the results of this for mulitple values of X?

That's what I thought.

I chose Xi = 1 and theta_crnk based a normal distribution curve with 100 points.

I expected 100 different Xp's, but it just says that there's no solution.

Thanks,

Eric

RichardJ
19-Tanzanite
(To:EricHong)

Are you using sigma=1, or sigma=1*deg?

Tolerance on theta_crnk is actually +/- 1 deg max. This is close is close to 3 sigma 99.7%). So, inside rnom, I used 1 deg / 3.

Thanks,

Eric

RichardJ
19-Tanzanite
(To:EricHong)

I guess I don't understand then, because it solves fine when I run the worksheet I just posted.

That's fine then. I must have added something accidentally. I'll look for it.

I trully appreciate your help,

Eric

Maybe can you send again your working file with rnorm theta_crnk?

RichardJ
19-Tanzanite
(To:EricHong)

Maybe can you send again your working file with rnorm theta_crnk?

OK, but it's the same as the last one I posted.

Here's what I'm trying to do.

RichardJ
19-Tanzanite
(To:EricHong)

You need to explicitly vectorize it. Select the entire expression, and click on the vectorize operator (looks like f(M) with a right pointing arrow over it). Without the vectorize operator the function passes the entire vector to the solve block in one go, rather than one element at a time.

Thank you!!!!

I had another worksheet that vectorizes the actual equations inside the solve block and it wasn't working, either. I didn't know I can vectorize the function.

Thanks again,

Eric

Sorry to bother you. Can you help me again?

As you will see in the attached file, I'm trying to get three arrays out of

Xp_TOL(Xi)

as I sweep Xi from -2 to 2.

Is this possible?

Please, help.

Thanks,

Eric

RichardJ
19-Tanzanite
(To:EricHong)

Does this work for you?

Can you help me with this file one more time?

Sorry to bother you much.

I included a curve (Xp_PF vs. Xi_PF) that's supposed to be the second line resulting from the solve block. Right now, the solve block doesn't produce three curves.

I also tried to use the trick that you showed last time, but no success.

Your help will be greatly appreciated.

Thanks,

Eric

RichardJ
19-Tanzanite
(To:EricHong)

You defined Xp as a scalar, so that's what you got out of the solve block. If you want a vector you must define it as a vector.

You need to be careful when you multiply two vectors. Unless you explicitly vectorize, what you get is a scalar (the inner product), not a vector. I changed this in several places in the solve block to what I think you actually want. If I was wrong, you will have to change them back.

Richard,

I finished the task I was working on successfully just now because of all your help.

I really appreciate it.

Thanks,

Eric

Top Tags