DSolve特定时间间隔

时间:2012-06-24 17:57:37

标签: wolfram-mathematica dsolve

我正在尝试解决D方程并且不知道y[0],但我知道y[x1]=y1

我只想在相关的xrange x=[x1, infinitny]中解决DSolve。

它怎么能起作用?

附上不起作用的示例

dsolv2 = DSolve[{y'[x] == c*0.5*t12[x, l2]^2 - alpha*y[x], y[twhenrcomesin] == zwhenrcomesin, x >= twhenrcomesin}, y[x], x]
dsolv2 = Flatten[dsolv2]
zsecondphase[x_] = y[x] /. dsolv2[[1]]

我知道DSolve不允许不等式条件,但是我用它来解释你在寻找什么(t12[x,l2]只会根据x给我一个值,因为已知l2)。

修改

t12[j24_, lambda242_] := (cinv1 - cinv2)/(cop2 - cop1 + (h2*lambda242)*E^(p*j24));
cinv1 = 30; cinv2 = 4; cinv3 = 3; h2 = 1.4; h3 = 1.2; alpha = 0.04; z = 50; p = 0.06; cop1 = 0; cop2 = 1; cop3 = 1.3; teta2 = 0.19; teta3 =0.1; co2 = -0.6; z0 = 10;l2 = 0.1;

2 个答案:

答案 0 :(得分:1)

你的等式是一阶和线性的,所以你可以得到一个非常通用的解决方案:

generic = DSolve[{y'[x] == f[x] - alpha*y[x], y[x0] == y0}, y[x], x]

然后您可以替换您的特定术语:

c = 1;
x0 = 1;
y0 = 1;
solution[x_] = generic[[1, 1, 2]] /. {f[x_] -> c*0.5*t12[x, l2]^2}   


Plot[solution[x], {x, x0, 100}]

Example

答案 1 :(得分:0)

这个例子有什么问题?

t12[x_] := Exp[-x .01] Sin[x];
dsolv2 = Chop@DSolve[{y'[x] == c*0.5*t12[x]^2 - alpha*y[x], y[1] == 1}, y[x], x];
Plot[y[x] /. dsolv2[[1]] /. {alpha -> 1, c -> 1}, {x, 1, 100}, PlotRange -> Full]

enter image description here

修改

关于你的评论:

尝试使用分段函数来限制域:

t12[x_] := Piecewise[{{ Exp[-x .01] Sin[x], x >= 1}, {Indeterminate, True}}] ;
dsolv2 = Chop@DSolve[{y'[x] == c*0.5*t12[x]^2 - alpha*y[x], y[1] == 1}, y[x], x];
Plot[y[x] /. dsolv2[[1]] /. {alpha -> 1, c -> 1}, {x, 1, 100}, PlotRange -> Full]