Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Calculus sorted by activeNIntegrate::slwcon warning for definite integration
https://community.wolfram.com/groups/-/m/t/1635118
Hi,
This integral seems to have a singularity..
all constants are defined.
NIntegrate[Exp[-alpha*Sqrt[(R^2 - 2*x*R*Cos[theta] + (x)^2) + z^2]], {z, 10*-a,
10*(L - a)}, {theta, 0, 2 Pi}]
I get a NIntegrate::slwcon warning.Haress Nazary2019-03-18T14:54:19ZSolve a system of Differential Equations with EigenSystem DSolve MatrixExp?
https://community.wolfram.com/groups/-/m/t/1632964
In calculating a system of differential equations, I used 3 different methods: EigenSystem, DSolve and MatrixExp. DSolve and MatrixExp porduced the same answers but a different answers than EigenSystem and I don't understand why (See Attached). In all three cases, I used a default value of {1,1} for the values of the arbitrary constants. It appears that DSolve and MatrixExp simply dropped the negative exponent.
I don't understand what I am overlooking.
Thanks,
Mitch SandlinMitchell Sandlin2019-03-15T16:41:44ZSolve numerically a system of 5 ODEs using NDSolve?
https://community.wolfram.com/groups/-/m/t/1636689
Hello all!
I'm trying to solve numerically a system of 5 ODEs using `NDSolve[]`. The problem is that some of the solutions take negative values, which doesn't make sense from a physical point of view. Is there any way to force these functions to stay non-negative?
I've read about the command `WhenEvent[]`, but I don't know if it can be useful to fix this.
Thank you in advance for any help!
PD: This isn't my mathematical model, which is pretty large, but it might serve as an example:
\[Phi] = 0.08;
a = 0.7;
b = 0.8;
tmax = 200.0;
V0 = 1.0;
U0 = 1.0;
i = 1.0;
sol = NDSolve[{V[0] == V0, U[0] == U0,
V'[t] == V[t] - 1/3 V[t]^3 - U[t] + i,
U'[t] == \[Phi] (V[t] + a - b U[t])}, V[t], {t, 0, tmax},
DependentVariables -> {V[t], U[t]}, Method -> "Adams"];
Plot[V[t] /. sol, {t, 0, tmax}]David Aragonés2019-03-20T20:07:08ZNDSolve piecewise differential equations associated with a water hammer?
https://community.wolfram.com/groups/-/m/t/1636116
I am trying to solve the differential equations associated with water hammer. I have three pipe segments and I am using piecewise function for the differential equations. When I try to solve using NDSolve I get an error message " The function value {0,.....} is not a list of numbers with dimension {50} at {x,P[x,t],V[x,t]}={...}". Can someone please help me with this.
L1 = 3100; (*Length of first pipe*)
L2 = 2700;(*Length of second pipe*)
L3 = UnitConvert[Quantity[30., "ft"], "m"][[
1]];(*Length of third pipe*)
D1 = UnitConvert[Quantity[4, "in"], "m"][[
1]]; (*Diameter of first pipe *)
D2 = UnitConvert[Quantity[6, "in"], "m"][[
1]];(*Diameter of second pipe *)
D3 = UnitConvert[Quantity[1.75, "in"], "m"][[
1]];(*Diameter of third pipe *)
f = 0.002; (*Friction factor*)
\[Rho] = 1000; (*Density of fluid*)
Ef = 2.19*^9; (*Bulk modulous of fluid*)
Ep = 210*^9;(*Elastic modulous of pipe*)
ee = 4.5*^-5; (* Pipe roughness*)
\[Mu] =
0.001002; (* Fluid viscosity in Poise*)
Qmax = 0.1;
A1 = Pi/4 D1^2;
A2 = Pi/4 D2^2;
A3 = Pi/4 D3^2;
w = UnitConvert[Quantity[0.2, "in"], "m"][[1]];
solEe = Solve[1/EE == 1/Ef + 1/(w Ep), EE][[1]];
Ee = EE /. solEe;
c = Sqrt[Ee/\[Rho]];
pde1 = D[P[x, t], t] + \[Rho] c^2 D[V[x, t], x] == 0
sol1 = NDSolve[{pde1,
D[V[x, t], t] + 1/\[Rho] D[P[x, t], x] ==
Piecewise[{{-((f V[x, t] Abs[V[x, t]])/(2 D1)), 0 < x < L1},
{-((f V[x, t] Abs[V[x, t]])/(2 D2)) == 0, L1 < x < L1 + L2},
{-((f V[x, t] Abs[V[x, t]])/(2 D3)) == 0,
L1 + L2 < x < L1 + L2 + L3}}],
V[x, 0] == 0.,
P[x, 0] == 0.,
P[L1 + L2 + L3, t] == \[Rho]/(2 A3^2) (A3 V[L1 + L2 + L3, t])^2,
V[L1 + L2 + L3, t] == 10 t}, {P, V}, {x, 0, L1 + L2 + L3}, {t, 0,
12}]srinivas.gk2019-03-20T03:26:00Z