0

我正在尝试求解一个 D 方程,但我不知道y[0],但我知道y[x1]=y1

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

它怎么可能起作用?

附上不起作用的例子

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]由于 l2 已知,因此仅根据 x 给我一个值)。

编辑

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;
4

2 回答 2

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}]

例子

于 2012-06-25T10:20:31.460 回答
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]

在此处输入图像描述

编辑

关于你的评论:

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

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]
于 2012-06-24T19:12:10.293 回答