Click to See Complete Forum and Search --> : good ,good, good,good,vibrations (not)
scotsfool
Jun 21st, 2006, 05:43 PM
I f I can have these solved I would be a happy man.......
two vibrations, x1 = 3sin (10t + pi/6) and x2 = 2 cos (10t - pi/6) where t is in seconds, are superimposed. Determine the time at which the amplitude of the resultant vibration, x1 + x2, first reaches a value of 2.
can anyone solve?? I must be a fool cause I been over it many times and maybe that is the problem!!!!!
please help.
Rassis
Jun 22nd, 2006, 03:37 AM
t = 4.966
scotsfool
Jun 22nd, 2006, 03:47 AM
Thanks for the reply but I really want to see the way you got to the result, this would help greatly.
also can you write in english if possible :0)
I thank you for your patience and help
can anyone help? and translate
krtxmrtz
Jun 22nd, 2006, 08:26 AM
Thanks for the reply but I really want to see the way you got to the result, this would help greatly.
also can you write in english if possible :0)
I thank you for your patience and help
can anyone help? and translate
Probably he used numerical methods. As far as I know you can't invert x1 + x2
One easy way to find a solution is by means of a bisection algorithm (http://mathworld.wolfram.com/Bisection.html).
scotsfool
Jun 22nd, 2006, 10:02 AM
Thanks, but I would like to see how it is done as I am at a loss with it....
krtxmrtz
Jun 22nd, 2006, 10:41 AM
Thanks, but I would like to see how it is done as I am at a loss with it....
Well, if you don't have a programmable handheld calculator then you may try the bisection method.
Call g(t) = x1(t) + x2(t)
Finding a value of t such that
g(t) = 2
is equivalent to finding a value of t such that
f(t) = g(t) - 2 = x1(t) + x2(t) - 2 = 0
Essentially you find "by eye" i.e. by trial and error 2 values of t, call them t1 and t2, such that f1 * f2 < 0
where I have called
f1 = f(t1)
f2 = f(t2)
i.e. either f1 is negative and f2 positive or the other way round. In any case this means that there must be at least one solution inside the interval (t1, t2) because f(t) is a continuous function.
Assume that t2 > t1. What you do now is calculate the middle point tm of the interval:
tm = (t1 + t2) / 2
and calculate the function at this point, fm = f(tm). If fm has the same sign as f1 then the solution must be in the interval (tm, t2) and you now assign t1 = tm and go back and loop. Or, if fm has the same sign as f2 then the solution must be in the interval (t1, tm) and now you let t2 = tm.
So every time you repeat (iterate) you end up with a smaller interval and a fm nearer to 0. Eventually your fm will be as small as you wish -as the accuracy of your calculator / spreadsheet or whatever allows you to calculate. At that point you can stop and take tm as your solution.
krtxmrtz
Jun 22nd, 2006, 11:07 AM
Also you can try a "brute force" method. Maybe it's not so elegant but the aim is to find the solution.
Once you have found the 2 values of t bracketing the solution, t1 and t2, you can simply "buy as many tickets as necessary to win the lottery", in other words:
Sub Solve()
Randomize
'Set a conveniently small value
fThreshold = 0.0000001
'fun is your x1 + x2 - 2
fMin = Min(Abs(fun(t1)), Abs(fun(t2)))
Do
t = t1 + Rnd*(t2 - t1)
f = Abs(fun(t))
If f < fMin Then fMin = f
Loop While fMin > fThreshold
End Sub
Function fun(p)
'(Use doubles if needed)
Dim Pi6 As Single
Dim p10 As Single
Const Pi = 3.141593
Pi6 = Pi/6
p10 = 10*p
fun = 3*sin(p10 + Pi6) + 2*cos(p10 - Pi6) - 2
End Function
I haven't tested this code but I think it should work.
scotsfool
Jun 22nd, 2006, 11:19 AM
that is above my level of intelligence!!!!!!!! very confused now
Rassis
Jun 22nd, 2006, 02:05 PM
I subscribe everything Krtxmrtz said. You can find the solution by trial and error using a spread sheet but it might take you quite a while, depending on the precision needed, or you can use the GOAL-SEEK option in EXCEL instead. In this case it will be quite straight forward. Please see the attached EXCEL file where I followed the following steps:
1. Construct a table with x1+x2 as a function of t departing from t = 0;
2. Construct a line graph;
3. Notice that, when t = 0, x1+x2 equals 3.23 which is > 2;
4. Notice also that as t increases x1+x2 also increases and starts decreasing when t is approximately to 0.1;
5. Notice finally that when t = 0.24, x1+x2 equals approximately 0, meaning that the first time x1+x2 reaches a value of 2 is somewhere between t = 0 and t = 0.24;
5. Enter in cell F2 any number comprised in the before mentioned interval;
6. Use GOAL-SEEK the way showed in the two images in sheet “Images” and that is all.
I am sorry for having given the answer 4.966. It is correct though because it returns x1+x2 = 2, but it is not the moment when x1+x2 reaches the value of 2 for the first time. I was not aware of the shape of the specific function at the time and just dropped any number in cell F2 (which I cannot remember anymore).
Rui
krtxmrtz
Jun 22nd, 2006, 03:44 PM
that is above my level of intelligence!!!!!!!! very confused now
Sorry if my explanation was confusing. I should have attached a simple drawing in the first place. Well here you go.
You can see that the points t1 and t2 bracket the solution because the function f is negative at t1 and positive at t2. Therefore, you find the midpoint tm in between them and evaluate the function there. In the sample graph it happens to be positive so now you know the solution is between t1 and tm. Therefore you forget about t2 and now you set tm as your new t2. This is your first step. Now you start all over again (of course, you must have the computer do it for you) and repeat over and over. The (t1, t2) interval becomes ever smaller and your solution in sandwiched in it.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.