Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Is this equation solvable for d?

Status
Not open for further replies.

vlad777

Member
Is this equation solvable for d?

x=v*d+r*sin(w*d)

solve(x=v*d+r*sin(w*d),d)

I asked this online machine Wolfram Alpha, and it times out or says error.
Also Maxima solves for d but leaves d in the sine.

Is this equation possible to solve (for d)?

Many thanks.
 
Last edited:
vlad777,

Is this equation possible to solve (for d)?

Sure it is. But you have to calculate a root of an equation, which you cannot do until you know the values of v, r, and w. Those values determine the value of the root, and what form the equation you have to solve is. It does not appear to have a symbolic solution. Another simpler similar equation is x=cos(x), which also does not a symbolic solution .

Ratch
 
Another simpler similar equation is x=cos(x), which also does not a symbolic solution .

x=cos(x) has a definite solution of about .739 - but I think you mean x=cos(y), which has a symbolic solution in y=±acos(x)+2*pi*n.

Vlad - algebraic manipulators don't handle isolating variables in that kind of trig function very well. You would expect x=sin(y) to isolate y as y=asin(x), but instead, they will give you a crazy thing like y = asin(x)*(-1)^n+pi*n. This is because, technically, there are an infinite number of angles that will solve that equation.
 
Last edited:
duffy,

x=cos(x) has a definite solution of about .739 - but I think you mean x=cos(y), which has a symbolic solution in y=±acos(x)+2*pi*n.

No, I wrote x=cos(x), and that is what I meant. I also said it does not have a symbolic solution. Of course, it has a numeric solution.

there are an infinite number of angles that will solve that equation.

But only one principal angle.

Ratch
 
vlad777,



Sure it is. But you have to calculate a root of an equation, which you cannot do until you know the values of v, r, and w. Those values determine the value of the root, and what form the equation you have to solve is. It does not appear to have a symbolic solution. Another simpler similar equation is x=cos(x), which also does not a symbolic solution .

Ratch


How do I calculate root (for this particular equation) if values for v,r,w are known?
(Please take some values for v,r,w ;I did not because I don't know what is a good example.)
 
vlad777,

How do I calculate root (for this particular equation) if values for v,r,w are known?
(Please take some values for v,r,w ;I did not because I don't know what is a good example.)

Take v=1,r=2,w=3,x=4, and we get 4=d+2sin(3d) ====> d= 4.161794890
Or another example, take v=4,r=3,w=2,x=1, and we get 1=4d+3sin(2d) ===> d=0.1004040528

The above equations were solved by a computer program, but also can be solved by iterative techniques, like the Newton-Raphson method.

Ratch
 
vlad777,

Can you please tell me the name of this program?

If you have to ask, you probably cannot afford it. I am sure the big heavy duty programs like Mathcad, Mathematica, and Maple can do it. You will have to search the internet to find free equation solvers if they exist. Perhaps others can guide you to a program that fits your needs.

Ratch
 
Hi,

If you can accept a numerical solution then it's rather simple. You can try this recursive function. You guess a reasonable value for d, then calculate a new d with this function, then insert that back into the function and calculate again. Doing this several times the variable d should converge on a stable value. The extra variable 'k' is a damping factor, so if 'd' starts to oscillate make k a lower value. k is in the range 0<k<=1, where k=1 is no damping, and a very small value of k is a lot of damping. The trade off is stability vs speed of convergence...the more damping (lower values of k) the slower the convergence but the better the stability.

Here's the function:
d=(k*x+(1-k)*d*v-k*r*sin(d*w)+d*r*w*cos(d*w))/(r*w*cos(d*w)+v)

Usually before a solution can be accepted you have to know where the equation came from, what application it is going to be used in. Since you didnt specify, i cant say what values of d to try first or even if this kind of solution will be numerically stable for your typical values of the other variables. However, with small damping factors (k) the solution will usually converge on a solution that is close to the guess. That guess could be obtained by graphing the original equation and examining it to see where your applications typical solutions should lie, or by simply guessing a value that sounds close to what your application usually would converge on. However, it is usually a good idea to explore the other solutions too, of which there could be anywhere from 1 to an infinite number of actual solutions, with up to 5 solutions within the range of plus and minus one cycle of the sine component (-2pi to 2pi normalized).
 
Last edited:
x=v*d+r*sin(w*d)
Is this equation possible to solve (for d)?
Many thanks.

No, there is no solution that would be in the form:

d = f(x,v,w,r)
 
Last edited:
there is no closed form solution to this, the only way to solve it is numerically.
you don't have to spend $$$ for matlab or maple etc. you can use any free product like Octave
 
No...
 
**broken link removed**

Is there an infinite series representation of d?

Hello again,

I posted a recursive solution back in post #9. You can use that to create a series if you wish. It's not a simple function, but you can do it.
 
I posted a recursive solution back in post #9. You can use that to create a series if you wish.
Hmm... your function was

[LATEX]d=\frac{kx+(1-k)d\cdot v-kr \sin{(d\cdot\omega)}+d\cdot r\omega\cos{(d\cdot\omega)}}{r\omega\cos{(d\cdot\omega)}+v}[/LATEX]

and an infinite series would be something like

[LATEX]k=.5, d_0=1.234[/LATEX]

[LATEX]d=\sum\limits_{n=1}^\infty \frac{kx+(1-k)d_{(n-1)} v-kr \sin{(d_{(n-1)}\omega)}+d_{(n-1)} r\omega\cos{(d_{(n-1)}\omega)}}{r\omega\cos{(d_{(n-1)}\omega)}+v}[/LATEX]

Vlad - since you are asking about equation solvers, I suspect this isn't a homework assignment, and this is a good thing because your prof isn't going to take that iterated mess with the guesswork variables and who-knows-what convergence as an answer. But for a guy trying to find a solution to a real problem, this isn't a bad approach.
 
Hi duffy,


Well that isnt it exactly, but you're on the right track :)
I really dont think an infinite sum is necessary however, as a recursive function is already fully defined and ready to go.

As to the instructor taking that solution for better or worse, if there is only a numerical solution to a problem then he has to accept a numerical solution unless he wants to accept 'no solution', but that would be evident from the lectures.
 
Last edited:
I won't be doing homework unless I go back to school :)

I am trying to estimate if possible and how expensive computationally is it, so I can write a C/C++ routine that gives me the solution (number).


I looked up operations on series; they can add, multiply by a constant, but product of two series that is needed here is trickie.


MrAl many thanks for the Newton method solution, and I will try it out, but I am wondering if there is a cheaper solution if we consider series formula for sine.
 
Last edited:
Hi vlad,

Well that's a good question, and one that i asked myself when i first looked at this problem. The trouble is, using the sine series produces a series with high order terms like x^5, x^7, etc. Using the highest order as x^7 for an approximation, that means we'd have to solve an 7th order equation to extract the value of x (which in your case is the variable 'd' not x). You could try it with lower order approximations i guess and see if it comes out ok for the values you expect.

Starting with:
x=v*d+r*sin(w*d)

Lets first convert this into a slightly more readable form by simply changing x to y and d to x:
y=v*x+r*sin(w*x)

Now the first simplification transforms the equation to:
y=X*v/w+r*sin(X)
where
X=w*x

so now it's in the form:
y=A*X+r*sin(X)

which is a constant y equals a constant A times X plus a constant r times the sine of X.

Expanding the right side into a series we get:
y=X*(A+r)-X^3*r/6+X^5*r/120-X^7*r/5040+...

Now you could try to expand that out to more terms and then try using a reversion of series, but it will probably end up to be a pretty long and complicated series. There could be a closed form for that series, but at present i cant say if there is or not.

Obviously you could use a truncated series and solve for X, but you'd still have to do it numerically unless it was truncated down pretty low, and that might not be accurate enough for a final result, but may be enough for an initial guess for the recursive solution.
 
Last edited:
Is a "cheaper solution" in reference to time? What is the minimum accuracy needed for the result?
 
Hi,

Yes, algorithms are often called "computationally expensive" if they take a relatively long time to execute.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top