Message Boards Message Boards

0
|
2838 Views
|
11 Replies
|
3 Total Likes
View groups...
Share
Share this post:

DSolve empty solution error?

Posted 2 years ago

I have tried the following and get an error I don't understand. I am a bit of a newbie so I expect there is a simple explanation.

DSolve[{f'[t] == k f[t] - c, f[0] == D, f[T] == 0}, f[t], t]

I get DSolve::bvnul: For some branches of the general solution, the given boundary conditions lead to an empty solution.

I don't understand this! please help!

Many thanks,

Steve

POSTED BY: stephen Morris
11 Replies

Here is the whole procedure

dgl = f'[t] == k f[t] - c
sol = f[t] /. DSolve[dgl, f[t], t][[1, 1]] /. C[1] -> u
ff[u_] := Evaluate[sol]
(*ff fulfills the diff equation*)
D[ff[u], t] - (k ff[u] - c) // Simplify
(*you have only one constant of integration, so c is not free but  must be adapted*)
e1 = (ff[u] /. t -> 0) == d
e2 = (ff[u] /. t -> T) == 0
sol2 = Solve[{e1, e2}, {u, c}] // Flatten
gg = ff[u] /. sol2 // Simplify
gg /. t -> 0
gg /. t -> T
(*  use the fixed c in the differential equation *)
D[gg, t] - (k gg - c) /. sol2 // Simplify
POSTED BY: Hans Dolhaine

Your In[35] is not the complete differential equation. And c is fixed by your conditions. Look at

hh'[t] - (k hh[t] - c) /. c -> (a E^(k T) k)/(-1 + E^(k T)) // FullSimplify
POSTED BY: Hans Dolhaine
In[32]:= hh[t_] := (a (-E^(k t) + E^(k T)))/(-1 + E^(k T))

In[33]:= hh[0]

Out[33]= a

In[34]:= hh[T]

Out[34]= 0

In[35]:= hh'[t] - k hh[t]

Out[35]= -((a E^(k t) k)/(-1 + E^(k T))) - (
 a (-E^(k t) + E^(k T)) k)/(-1 + E^(k T))
POSTED BY: stephen Morris

Your solution is missing the constant 'c'

It does give the correct boundary values.

POSTED BY: stephen Morris

Oh no, sorry.

POSTED BY: stephen Morris

Don't the E^(k t) terms cancel?

POSTED BY: stephen Morris

Well, DSolve doesn't work on my system either, but hh given above solves the ODE and the other conditions.

POSTED BY: Hans Dolhaine

Now I must also find out how to mark myself as retired! Because a I am also happily retired.

POSTED BY: stephen Morris

I tried changing the variable names but that didn't help.

DSolve[{f'[t] == k f[t] - c, f[0] == s, f[p] == 0}, f[t], t]

Maybe I didn't understand your suggestion.

POSTED BY: stephen Morris

D is a Mathematica intrinsic symbol. You should avoid variable names with capital letters. I think

hh[t_] := (a (-E^(k t) + E^(k T)))/(-1 + E^(k T))

With D interchanged with a is what you are looking for.

hh[0]
hh[T]
POSTED BY: Hans Dolhaine

Many thanks

POSTED BY: stephen Morris
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract