0
$\begingroup$

I want to obtain numerical solutions of $v$ for the following equation in Mathematica:

$$ \frac{a}{v}=\frac{e^{2.478} o^{6.351}}{\left\{\frac{kv^3}{n}[(n-1)(0.62-0.014d+0.0452d^2)+1]+Mgv(u\cos(z)+\sin(z))\right\}^{6.351}} $$

This is the code I wrote:

f = a/v == E^(2.478) o^(6.351)((k*v^3((n-1.)(0.62-0.0104d+0.0452 
d^2)+1.)/n)+M*g*a(uCos[z]+Sin[z]))^(-6.351)

NSolve[f /.
{a -> 20.,
o -> 51.,
k -> 0.19,
n -> 20.,
d -> 0.05,
M -> 80.,
g -> 9.80665,
u -> 1.2,
z -> 0.}
, v] 

It takes a very long time to run and I abort it before it gives any output. Is there a way to overcome this? Thank you.

EDIT: I made a mistake in the equation. In the part $Mga(u\cos(z)+\sin(z))$, $a$ should be $v$ instead, which gives $Mgv(u\cos(z)+\sin(z))$.

$\endgroup$
  • 1
    $\begingroup$ Solve doesn't work because the answer is to let v- > infinity, at which point, both sides approach zero. $\endgroup$ – bill s Oct 10 '17 at 21:52
  • 1
    $\begingroup$ aside to other things you appear to have introduced a new symbol uCos (see how it is blue.. you need a space in there) $\endgroup$ – george2079 Oct 10 '17 at 22:13
  • $\begingroup$ your updated equation has a single root at 0.0285184 (see answer below). Please emphasize correctness of Mathematica code posted for ease of answering, thanks. $\endgroup$ – Manuel --Moe-- G Oct 10 '17 at 22:35
  • $\begingroup$ You should fix your code. $\endgroup$ – Michael E2 Oct 11 '17 at 0:33
3
$\begingroup$

Solve doesn't work because the answer is to let v- > infinity, at which point, both sides approach zero. Here is the right hand side:

Limit[E^(2.478) o^(6.351) ((k*v^3 ((n - 1.) 
     (0.62 - 0.0104 d + 0.0452 d^2) + 1.)/n) + 
     M*g*v (uCos[z] + Sin[z]))^(-6.351), v -> Infinity]
0.

The left hand side a/v obviously -> 0 as well. Notice that this is true irrespective of the particular values of the constants.

$\endgroup$
3
$\begingroup$

Playing with your (updated) equation:

(* warning: don't use capital M *)
Clear[f, a, v, o, k, n, d, m, g, u, z]

(* warning: put a space or a * between u and Cos *)
f = a/v == E^(2.478) o^(6.351) ((k*
  v^3 ((n - 1.) (0.62 - 0.0104 d + 0.0452 d^2) + 1.)/n) + 
    m*g*v (u*Cos[z] + Sin[z]))^(-6.351)

enter image description here

f = f /. {a -> 20., o -> 51., k -> 0.19, n -> 20., d -> 0.05, 
  m -> 80., g -> 9.80665, u -> 1.2, z -> 0.}

enter image description here

Put in appropriate form to plot to visualize any roots

f = f[[1]] - f[[2]]

enter image description here

Plot[f, {v, -0.05, 0.2}]

enter image description here

FindRoot[f, {v, 0.03}]
(* {v -> 0.0285184} *)

Your updated equation has a single root at 0.0285184

$\endgroup$
1
$\begingroup$

The calculation goes very fast if you restrict the domain to Reals

param = {a -> 20., o -> 51., k -> 0.19, n -> 20., d -> 0.05, M -> 80., 
    g -> 9.80665, u -> 1.2, z -> 0.} // Rationalize;

f = a/v == 
    E^(2.478) o^(6.351) ((k*
          v^3 ((n - 1.) (0.62 - 0.0104 d + 0.0452 d^2) + 1.)/n) + 
        M*g*v (u Cos[z] + Sin[z]))^(-6.351) // Rationalize[#, 0] &;

soln = NSolve[f /. param, v, Reals]

(* {{v -> 0.0285184}} *)

EDIT: Verification

f /. param /. soln[[1]]

(* True *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.