0

I am trying to solve an D-equation and do not know y[0], but I know y[x1]=y1.

I want to solve the DSolve only in the relevant xrange x=[x1, infinitny].

How could it work?

Attached the example that does not work

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

I am aware that DSolve does not allow the inequality condition but I put it in to explain you what I am looking for (t12[x,l2] will give me a value only depending on x since l2 is known).

EDIT

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 Answers2

1

Your equation is first order and linear, so you can get a very general solution :

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

Then you can substitute your specific term :

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

b.gatessucks
  • 1,242
  • 1
  • 15
  • 19
  • It works. Very nice. But I recognized one thing I still do not understand. It took me quite a while to reproduce your example. Finally I found out that whenever I define alpha upfront, I do not get a solution. When I declare alpha after I have done the "generic" part it works. Is it the ame with you and do you have an idea what might be the reason behind? – user1426522 Jun 25 '12 at 12:13
  • @user1426522 It's the same for me. Try a fresh session. – b.gatessucks Jun 25 '12 at 18:21
0

What is wrong with this example?

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

Edit

Regarding your commentary:

Try using a piecewise function to restrict the domain:

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]
Dr. belisarius
  • 60,527
  • 15
  • 115
  • 190
  • Thanks belisarius, good idea. But unfortunatly t12 is not that simple and a solution does not exist for -transferred to your example- x<1. I really need Mathematica to solve the differential only in the relevant x range. I will try to upload the whole problem so you see what i mean. Btw. what exactly does chop. Could not even find the info in the web. – user1426522 Jun 24 '12 at 21:26
  • @user1426522 In this case Chop[] is used to get rid of the eventually very small imaginary components of the solution. See the edit in my answer. – Dr. belisarius Jun 24 '12 at 21:49