Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13945

Re: Problem in solving Differential Equation

From Tomas Garza <tgarza10@msn.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Problem in solving Differential Equation
Date 2013-03-28 21:12 +0000
Message-ID <kj2bnp$m52$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


I do get the intended output. V. 9.0.1., Mac OS X 10.8.3.
-Tomas

> From: rahul.6sept@gmail.com
> Subject: Re: Problem in solving Differential Equation
> To: mathgroup@smc.vnet.net
> Date: Thu, 28 Mar 2013 04:06:19 -0400
>
> Sir,
>
>  Its  not giving output. The following error its showing
>
>  ERROR: Set::write: : Tag List in {150 Cos[15 t]+5.` Sin[15
> t]==0,False}[t_] is Protected.
>
> DSolve::dsfun: "10\ Sin[15\ t] cannot be used as a function."
>
> ReplaceAll::reps: "{150\ Cos[15\ t]+5.\ Sin[15\ t]==0,False} is
> neither a list of replacement rules nor a valid dispatch table, and so
> cannot be used for replacing"
>
>
>
> These ERROR messages are coming repeatedly.
>
>
>
> Regards,
>
>  Rahul
>
> On 3/28/13, Bob Hanlon <hanlonr357@gmail.com> wrote:
> > Your DE can be solved exactly using DSolve.
> >
> > Manipulate[
> >  eqn = x'[t] + lambda*x[t] == 0;
> >  sol[t_] = x[t] /. DSolve[
> >      {eqn, x[0] == 1/2}, x[t], t][[1]];
> >  ParametricPlot[
> >   {sol[t], sol'[t]},
> >   {t, 0, 25},
> >   PlotRange -> {{-0.1, 0.6}, {-3, 0.5}},
> >   Frame -> True,
> >   Axes -> False,
> >   FrameLabel -> (Style[#, "Courier", Bold, 16] & /@
> >      {x, Overscript[x, "."]}),
> >   AspectRatio -> 1,
> >   PlotStyle -> {{Red, AbsoluteThickness[2]}}],
> >  {{lambda, 0.5}, 0, 5, 0.01, Appearance -> "Labeled"}]
> >
> >
> > Bob Hanlon
> >
> >
> > On Wed, Mar 27, 2013 at 11:29 PM, Rahul Chakraborty
> > <rahul.6sept@gmail.com> wrote:
> >> Sir,
> >>
> >>  Can you kindly see what is the mistake in this code of mine. Its not
> >> giving me the output.
> >>
> >>
> >>  Clear [x,t];
> >> eqn=x'[t]+lambda*x[t]==0;
> >> Manipulate[[sol_]=NDSolve[{eqn,x[0]==1/2},x[t],{t,0,50=
}][[1]];
> >> ParametricPlot[Evaluate[{x[t]/.sol,D[x[t]/.sol,t]}],{t,0,25}=
,PlotRange->{{-20,20},{-25,25}},Frame->True,Axes->False,Frame=
Label->(Style[#,"Courier",Bold,16]&/@{"x",Overscript[x,"."]}),A=
spectRatio->1,PlotStyle->{{Red,AbsoluteThickness[2]}}],{{lambda,0.5=
},0,5}]
> >>
> >>
> >>
> >> Sincerely,
> >>
> >>  Rahul
> >>
> >> On 3/6/13, Bob Hanlon <hanlonr357@gmail.com> wrote:
> >>> Arguments to functions (e.g., Sin, Cos) must be enclosed in squar=
es
> >>> brackets: Sin[x[t]] and Cos[x[t]]
> >>>
> >>> Clear[x];
> >>> \[Omega] = -2;
> >>> eqn =
> >>>   x''[t] + Sin[x[t]] - \[Omega]^2 Sin [x[t]] Cos[x[t]] == 0 //
> >>>    Simplify;
> >>> sol = NDSolve[
> >>>     {eqn, x[0] == 1/2, x'[0] == 0},
> >>>     x[t], {t, 0, 25}][[1]];
> >>> ParametricPlot[
> >>>  Evaluate[{x[t] /. sol, D[x[t] /. sol, t]}],
> >>>  {t, 0, 25},
> >>>  Frame -> True,
> >>>  Axes -> False,
> >>>  FrameLabel -> (Style[#, "Courier", Bold, 16] & /@
> >>>     {x, Overscript[x, "."]}),
> >>>  AspectRatio -> 1,
> >>>  PlotStyle -> {{Red, AbsoluteThickness[2]}}]
> >>> ParametricPlot[
> >>>  Evaluate[{t, x[t] /. sol}],
> >>>  {t, 0, 10},
> >>>  Frame -> True,
> >>>  Axes -> False,
> >>>  FrameLabel -> (Style[#, "Courier", Bold, 16] & /@
> >>>     {t, x}),
> >>>  AspectRatio -> .5,
> >>>  PlotStyle -> {{Green, AbsoluteThickness[3]}}]
> >>>
> >>>
> >>> Bob Hanlon
> >>>
> >>>
> >>> On Tue, Mar 5, 2013 at 10:14 PM, Rahul Chakraborty
> >>> <rahul.6sept@gmail.com> wrote:
> >>>> Dear all,
> >>>>
> >>>>  Following differential equation seems to have some error in coding =
by
> >>>> me.
> >>>> kindly let me know where i have gone wrong.
> >>>>
> >>>> Clear[x];
> >>>>  \[Omega]:=-2;
> >>>> eqn=x''[t]+ Sin  x[t]-\[Omega]^2  Sin  x[t]Cos  x[t]==0//Simpl=
if=
> y;
> >>>> sol=NDSolve[{eqn,x[0]==1/2,x'[0]==0},x[t],{t,0=
,1000}][[1]]
> >>>> ParametricPlot[Evaluate[{x[t]/.sol,D[x[t]/.sol,t]}],{t,0,2=
5},Frame->True,AxesLabel->{"x",Overscript[x,"."]},AspectRatio->1=
,PlotStyle->{{Red,AbsoluteThickness[2]}},TextStyle->{FontFamily->"Cou=
rier",FontWeight->"Bold",FontSize->16}]
> >>>> ParametricPlot[Evaluate[{t,x[t]/.sol}],{t,0,10},Frame->Tru=
e,AxesLabel->{"t","x"},AspectRatio->.5,PlotStyle->{{Green,Absolut=
eThickness[3]}},TextStyle->{FontFamily->"Courier",FontWeight->"Bold",=
FontSize->16}]
> >>>>
> >>>> Regards,
> >>>>
> >>>>  rahul
> >>>>
> >>>
> >

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Problem in solving Differential Equation Tomas Garza <tgarza10@msn.com> - 2013-03-28 21:12 +0000

csiph-web