Community RSS Feed
https://community.wolfram.com
RSS Feed for Wolfram Community showing any discussions in tag Numerical Computation sorted by activeGet numerical solution of PDE for diffusion at high diffusion rates?
https://community.wolfram.com/groups/-/m/t/1575334
I am trying to solve numerically the following PDE with IC and BCs as shown for u(t,x).
\[PartialD]u/\[PartialD]t = \[PartialD]^2u/\[PartialD]x^2 + p Subscript[(\[PartialD]u/\[PartialD]x), x=0]\[PartialD]u/\[PartialD]x
t = 0, u= 0
x= 0, u= 1
x = 1, u = 0
This equation arises in binary diffusion of a species where the diffusion rates are large as opposed to low rates where the second term on the RHS is very small and the PDE becomes identical to the heat conduction equation. This second term accounts for the convective flow induced by the diffusing species. The parameter p is related to the surface concentration of the diffusing species (at x = 0). A closed form solution is available for the case of a semi-infinite region where the last BC becomes x = \[Infinity], u = 0.
I tried to use NDSolve and NDSolveValue (code shown below) but I got an error message:
NDSolveValue::delpde: Delay partial differential equations are not currently supported by NDSolve.
I am unsure if there is (1)a mistake in the code, (2) code is correct but NDSolve cannot provide a solution, or (3) there is a different approach that will work. Would appreciate any help. Thanks.
usolh = NDSolveValue[{D[u[t, x], t] ==
D[u[t, x], x, x] + 0.5*(D[u[t, x], x] /. x -> 0)*D[u[t, x], x],
u[0, x] == 0, u[t, 0] == 1, u[t, 1] == 0},
u, {t, 0, 5}, {x, 0, 1}](*we are assuming p=0.5 here*)Rutton D Patel2018-12-20T03:09:22ZObtain a numerical solution and Plot this equation?
https://community.wolfram.com/groups/-/m/t/1578585
I found equations of motion for my generalized coordinates which are "Phi" and "l" , but I can not get numeric solutions and plots for them.Could you help me please?
z1 = (-R*W*Sin[\[Theta]] + l'[t]*Sin[\[Phi][t]] +
l*\[Phi]'[t]*Cos[\[Phi][t]] - R*W*Cos[\[Theta]] +
l'[t]*Cos[\[Phi][t]] - l*\[Phi]'[t]*Sin[\[Phi][t]]);
z1^2 // Expand // TrigReduce;
V = -m*g*(-R*Sin[\[Theta]] + l[t]*Cos[\[Phi][t]]) +
1/2*k*(l[t] - l0)^2;
T = 1/2*m*z1^2 // Expand // TrigReduce;
Lagrange = T - V;
eqs = D[D[Lagrange, \[Phi]'[t]], t] - D[Lagrange, \[Phi]] // Expand //
TrigReduce;
eqs2 = D[D[Lagrange, l'[t]], t] - D[Lagrange, l] // Expand //
TrigReduceÖmer Faruk AKYILDIZ2018-12-27T19:27:52ZSolve the Extended Generalized Bivariate Meijer G Function (EGBMGF)?
https://community.wolfram.com/groups/-/m/t/1564744
Hi everyone,
I am currently working on RF/FSO transmission systems. As a solution in the analytic expression, I obtained Extended Generalized Bivariate Meijer G Function (EGBMGF). To my best knowledge, the EGBMGF is not available in standard mathematical packages. How can I solve the problem numerically by using wolfram mathematica? How to calculate EGBMGF in mathematics? I deliver the analytical term of EGBMGF.
![enter image description here][1]
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=EGBMGF.jpg&userId=1564710Marko Smilic2018-12-03T13:53:30ZDerive after Nintegration or symbolic integration?
https://community.wolfram.com/groups/-/m/t/1588515
j1 = 0.9
j3 = 0.9
j4 = 0.1
jz = 0.5
d1 = 0.1
d2 = 0.1
z = 4
r1 = 1/2 (Cos[x] + Cos[y])
r2 = Cos[x]*Cos[y]
a = 2*(j1 - j2 + j2*r2 - j1*r1)*z*sa + d1*(2*sa - 1) + jz*sb
b = 2*(j3 - j4 + j4*r2 - j3*r1)*z*sb + d2*(2*sb - 1) + jz*sa
c = jz*Sqrt[sa*sb]
ecl = (j2 - j1)*n*z*sa^2 - d1*n*sa^2 + (j4 - j3)*n*z*sb^2 -
d2*n*sb^2 - jz*n*sa*sb
(*A+B>0*)
w1 = ((a - b)*((a + b)^2 - 4*c^2) + ((a + b)^2 + 4*c^2)*
Sqrt[(a + b)^2 - 4*c^2])/(2*((a + b)^2 - 4*c^2))
w2 = ((-a + b)*((a + b)^2 - 4*c^2) + ((a + b)^2 + 4*c^2)*
Sqrt[(a + b)^2 - 4*c^2])/(2*((a + b)^2 - 4*c^2))
q1 = w1/(Exp[w1/t] - 1)
q2 = w2/(Exp[w2/t] - 1)
sa = 0.5
sb = 0.5
j2 = 0.3
D[(1/(4*Pi^2))*NIntegrate[q1 + q2, {y, -Pi, Pi}, {x, -Pi, Pi}], t]
1.If NIntegrate is used in the last derivation, the following error will occur and the value of 0 will be returned.
NIntegrate::inumr: The integrand ((0. +4. (0.8 +Times[<<3>>]+Times[<<2>>])-4. (0.6 +Times[<<3>>]+Times[<<2>>])) ..... Plus[<<3>>]+4. Plus[<<3>>])^2)) has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,3.14159},{0,3.14159}}.
2.Doubts should be caused by the fact that the variable t is not assigned, but I have to derive t, so I can't assign value. Is it impossible to use NIntegrate?
3.Finally, I use Integrate, but I can't work it out. Is there any convenient way?
PS: I only need a numerical value at last, and I don't need a formula, so I try to use NIntegrate.Thank you very much.qin richard2019-01-12T12:49:08ZSolve equation comprising integration and giving the value of constants?
https://community.wolfram.com/groups/-/m/t/1585522
Consider the following code:
NDSolve[(α*P)/(Pi*ρ*Cp)*Integrate[Exp[-2 ((x - V t)^2 + z^2)/(8 Qt + ω^2)], {t, 0, Infinity},x == 0, α == 4, ρ == 789, Cp== 2440, P == 0.04, Q == 0.0000000883, ω == 0.00035, V == 2, z == 1]
I have used this to solve the equation with the values of constants given here.
I am getting an error of "Integrate: Invalid integration variable or limit(s) in x==0". What am I doing wrong here?Akshay Raj R2019-01-09T09:39:01ZWhy does NDSolve return a constant value when the derivative is positive?
https://community.wolfram.com/groups/-/m/t/1583469
In the code below, a system of two first order non-linear differential equations are integrated. Would like some help understanding the result. There are two variables, z[t] and p[t]. The results appear to settle out with p[t] about 168 and z[t] about 0.99, and then after some time the system goes unstable and p begins to increase and z begins to oscillate.
My primary concern is the time range when p[t[ and z[t] appear to be constant. Plugging the values of z = 0.99 and p = 168 into the expression for dp/dt produces a value of about 2.4, so it is not clear why p[t] is staying constant during this period.
Below is the code.
dpRHS[z_, p_] := 4. (0.07 z Sqrt[600. - p] - 0.005 Sqrt[p p - 100.])
dzRHS[z_, p_] := Module[{dfVal, dzVal},
dfVal = 4. (0.07 z Sqrt[600. - p] - 0.005 Sqrt[p p - 100.]);
dzVal = -0.3 dfVal + 0.4 (170. - p);
Piecewise[{{Max[0, dzVal], z <= 0.01}, {Min[0, dzVal], z >= 0.99}},
dzVal]]
de = {p'[t] == dpRHS[z[t], p[t]], z'[t] == dzRHS[z[t], p[t]]};
ic = {p[0] == 140., z[0] == 0.5};
eqs = Flatten[{de, ic}]
tmax = 20;
{res, steps} = Reap[solODE = NDSolve[eqs, {p, z}, {t, 0, tmax}, StepMonitor :> Sow[{t, z[t], p[t]}]]];
Plot[{p[t] /. solODE, 170}, {t, 0, tmax}, PlotRange -> {All, All}, PlotLabel -> "P[t]", PlotStyle -> {Sequence, {Red, Dashing[0.01]} }]
Plot[z[t] /. solODE, {t, 0, tmax}, PlotRange -> {All, All}, PlotLabel -> "Z[t]"]
(*inspect details of the numeric soluion*)
tzVals = steps[[1, All, {1, 2}]];
tpVals = steps[[1, All, {1, 3}]];
tdpVals = {#[[1]], dpRHS[#[[2]], #[[3]] ]} & /@ steps[[1, All ]];
ListPlot[ tzVals , PlotRange -> {{12, 15}, All}, PlotLabel -> "Z[t]" ]
ListPlot[ tpVals , PlotRange -> {{12, 15}, {165, 175}}, PlotLabel -> "P[t]",
Epilog -> {Red, Dashing[0.01], Line[{{0, 170}, {50, 170}}]}]
ListPlot[ tdpVals , PlotRange -> {{12, 15}, All}, PlotLabel -> "P'[t] (computed from {z,p}" ]
Below are the plots of p[t] and z[t]. Which should p[t] increasing, but then stops increasing.
![Plots of Z and P][1]
Note that for the time range from 10 to 15, the value of p appears to settle out near 168 and the value of z appears is first just below 1. Then at later times, the value of z becomes unstable. At the moment I am not too concerned about the instability (the coefficients can be changed to remove the instability.) At the moment I am concerned about the value of p for times between 10 and 15, when p appears to be constant; however, with a value of z around 0.99 and a value of p around 168, dp/dt should be around 2.4, so I would expect p to continue increasing. (Then when p > 170, p should begin to decrease. The system is intended to have a steady-state value of p = 170 and z = 0.58).
Additional information: this code was written to limit the value of z between 0 and 1. So the equation for the dz/dt is given as a piecewise function. When z gets close to 0, then dz/dt is only allowed to be greater than or equal to zero. When z gets close to 1, then dz/dt is only allowed to be less than or equal to zero.
Additional information, I used Reap/Sow, to investigate the individual steps that NDSolve was using. The results were similar to what one sees when inspecting the plot.
[1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Plot01_PandZ.PNG&userId=894223Robert McHugh2019-01-07T01:07:01Z