1
$\begingroup$

I am trying to numerically solve a system of differential equations, however, one of the parameters that goes in it is the result of a transcendental equation.

NDSolve[{(v1 /. 
  NSolve[p*g*h1 - P == (p*v1^2*L1*64*0.00105)/(2*p*d^2*v1) + 
     p*v1^2*(0.7)/2, v1])*A1 == -A2*
h'[t], (v2 /. 
  NSolve[P - p*g*h2 == (p*v2^2*L1*64*0.00105)/(2*p*d^2*v2) + 
      p*v2^2*(0.7)/2, 
    v2]*-(v1 /. 
      NSolve[p*g*h1 - P == (p*v1^2*L1*64*0.00105)/(2*p*d^2*v1) + 
         p*v1^2*(0.7)/2, v1]))*A1 == V'[t], P = p0*v0/V[t], P[0] == 100000,h[0] == 0.5}, {h, P}, {t, 0, 100}]

Here, every letter corresponds to a predefined constant except for P, h, and V. v1 is the parameter that is the solution of the transcendental equation.

How can I make this work? Costants values:p = 1000; L1 = 5.0,L2 = 0.43,d = 0.0056,g = 9.8,h1 = 5.0,h2 = 0.43,A1 = 0.00001,A2 = 0.001,p0 = 100000,v0 = 0.001

$\endgroup$
3
  • 4
    $\begingroup$ related: Use findroot inside NDSolve. $\endgroup$ Commented Jun 26, 2018 at 21:21
  • 2
    $\begingroup$ Could you give values for the constants? $\endgroup$
    – Chris K
    Commented Jun 26, 2018 at 23:14
  • $\begingroup$ Every NSolve-command gives 2 results, you have to decide which one to use in NDSolve. $\endgroup$ Commented Jun 28, 2018 at 9:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.