Mathematica Asked by Immy Salam on July 18, 2021
int[r_]=-((557.310989080004 r)/((37.3042 - r) (-25.578 + r) (62.8822 +
r) Sqrt[0.0345106153943703 - ((37.3042 - r) (-25.578 +
r) (62.8822 + r))/(3000 r)]))
This is the function of r , now next is that I want to solve the differential equation using this function. Before that at my boundary conditions, this whole function vanishes as;
int[maxr]=1/0
int[rg]=1/0
maxr=31.0723250284387 and rg=25.57799942210616`
Next I try to solve the following differential equation via NDsolve
sol = NDSolve[{TD'[r] == int[r], TD[maxr] == Infinity}, {TD}, {r,maxr, rg}, Method->"ExplicitRungeKutta"]
But it fails are throws some errors like
Solve::infc: The system TD==[Infinity] contains an infinite object [Infinity].
NDSolve::icfail: Unable to find initial conditions that satisfy the residual function within specified tolerances. Try giving initial conditions for both values and derivatives of the functions.
Can anyone help me out.
The solution to the ODE is infinity.
You can see this by solving analytically
ClearAll[r, TD, k];
intr = -((557.310989080004 r)/((37.3042 - r) (-25.578 + r) (62.8822 +
r) Sqrt[0.0345106153943703 - ((37.3042 - r) (-25.578 +
r) (62.8822 + r))/(3000 r)]));
intr = SetPrecision[intr, Infinity];
maxr = SetPrecision[31.0723250284387, Infinity];
rg = SetPrecision[25.57799942210616, Infinity];
sol = TD[r] /. First@DSolve[{TD'[r] == intr}, TD[r], r];
Now set up an equation to solve for constant of integration
eq = (sol /. r -> maxr) == k;
constant = C[1] /. First@N@Solve[eq, C[1]];
Replace the constant found back in the solution
sol = sol /. C[1] -> constant;
Now let k
go to infinity, which maps to BC condition that TD[maxr] == Infinity
Limit[sol, k -> Infinity]
This means the solution is
$$ TD(r)=infty $$
You probably want to check you BC are correct.
Answered by Nasser on July 18, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP