MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NDSolve[] with nested If[] and Piecewise[] usage:

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91397] Re: NDSolve[] with nested If[] and Piecewise[] usage:
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Wed, 20 Aug 2008 04:03:51 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <g8ea0l$4ci$1@smc.vnet.net>

Gopinath Venkatesan wrote:

> Sometime back I posted this question on the usage of nested If[] and Piecewise[] inside NDSolve[]. I followed Oliver's reply and was able to solve that particular case. I also could solve another problem which is similar to the posted problem.
> 
> But when I tried the same (like enclosing the expressions with Evaluate[]) on another notebook which has similar usage of nested If[], it did not work.
> 
> I have included the code here, you can also notice that Piecewise[] also did not work here.
> 
> Please give me your suggestions to solve this problem. Thank you.

<snip>

Apparently, you have forgotten to provide the definitions of the 
functions v1, v2, and v3. I cannot find any in the posted code nor can 
NDSolve.

----------- Some parts of the output generated

[... snip ...]

eqn1 is given by (\[NoBreak]v1[0]	(v1^\[Prime])[0]	v2[0]	\
(v2^\[Prime])[0]	v3[0]	(v3^\[Prime])[0]	\[Phi][0]	\
(\[Phi]^\[Prime])[0]	0.533478+3.35388 (-v2[t]+v3[t]-0.67 \
\[Phi][t])-1.65191 (-v1[t]+v3[t]+0.33 \[Phi][t])-0.262758 (-(v1^\
\[Prime])[t]+(v3^\[Prime])[t]+0.33 (\[Phi]^\[Prime])[t])-(\[Phi]^\

[... snip ....]

\[Pi]^4 vi[3][t]+1.23953 (vi[3]^\[Prime])[t]+0.155674 (vi[3]^\[Prime]\
\[Prime])[t]

\[NoBreak])

Solving the set of equations

NDSolve::ndnum: Encountered non-numerical value for a derivative at t \
== 0.`.

[... snip ...]

----------------- End of output

Regards,
-- Jean-Marc



  • Prev by Date: Mathematica and Jaws
  • Next by Date: Re: Fourier-Motzkin elimination
  • Previous by thread: Re: NDSolve[] with nested If[] and Piecewise[] usage:
  • Next by thread: Re: NDSolve[] with nested If[] and Piecewise[] usage: