Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15206 > unrolled thread
| Started by | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| First post | 2013-07-20 09:54 +0000 |
| Last post | 2013-07-23 08:43 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: f'[0]=0.5 is True? Bob Hanlon <hanlonr357@gmail.com> - 2013-07-20 09:54 +0000
Re: f'[0]=0.5 is True? mariusz sapinski <mariusz.sapinski@gmail.com> - 2013-07-23 08:43 +0000
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Date | 2013-07-20 09:54 +0000 |
| Subject | Re: f'[0]=0.5 is True? |
| Message-ID | <ksdmp9$50d$1@smc.vnet.net> |
Try starting with a fresh kernel.
Clear[f, x, sol];
eqn = f''[x] + 2 f'[x] + 30 f[x] == 0;
eqn1 = f[0] == 1;
eqn2 = f'[0] == 0.5;
sol[x_] = f[x] /. DSolve[{eqn, eqn1, eqn2}, f[x], x][[1]]
(1.*(1.*Cos[Sqrt[29]*x] + 0.2785430072655778*
Sin[Sqrt[29]*x]))/E^x
sol[0]
1.
sol'[0]
0.5
Using exact numbers
eqn2 = f'[0] == 1/2;
sol[x_] = f[x] /. DSolve[{eqn, eqn1, eqn2}, f[x], x][[1]]
((1/58)*(58*Cos[Sqrt[29]*x] + 3*Sqrt[29]*
Sin[Sqrt[29]*x]))/E^x
sol[0]
1
sol'[0]
1/2
Bob Hanlon
On Thu, Jul 18, 2013 at 3:00 AM, mariusz sapinski <
mariusz.sapinski@gmail.com> wrote:
> Dear All,
>
> I'm trying a simple exercise:
>
> eqn = f''[x] + 2 f'[x] + 30 f[x] == 0;
> Clear[f];
> Clear[x];
> eqn1 = f[0] == 1;
> eqn2 = f'[0] == 0.5;
> DSolve[{eqn, eqn1, eqn2}, f[x], x]
>
>
> and I get:
> DSolve::deqn: Equation or list of equations expected instead of True in
> the first argument {30 f[x]+2
> (f^\[Prime])[x]+(f^\[Prime]\[Prime])[x]==0,f[0]==1,True}. >>
>
> so f'[0]=0.5 is True for Mathematica?
>
> How can it be?
>
> If I remove eqn2 from DSolve then I get a solution with a parameter of
> course.
>
> Cheers,
>
> Mariusz
>
>
[toc] | [next] | [standalone]
| From | mariusz sapinski <mariusz.sapinski@gmail.com> |
|---|---|
| Date | 2013-07-23 08:43 +0000 |
| Message-ID | <kslfn9$po3$1@smc.vnet.net> |
| In reply to | #15206 |
Thanks a lot, the problem was indeed in variables/functions which were declared before. Starting with a fresh kernel and using Clear and Remove helps! Cheers, Mariusz
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web