Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: For Loop and NDSolve

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85233] Re: For Loop and NDSolve
  • From: PV <prasanna.phys at gmail.com>
  • Date: Sat, 2 Feb 2008 23:34:31 -0500 (EST)
  • References: <fnuh4s$9ni$1@smc.vnet.net> <fo19o9$fu8$1@smc.vnet.net>

Hello Szabolocs,
I have already tried a few of the things you have mentioned though I
did not talk about that. I used a Do loop instead of a For loop and as
you suspected it did not change things very much. I shall carry out
few other suggestions that you have talked about and get back to you.
The Sparse array is actually a general tridiagonal as in it has the
main diagonal non zero plus two other diagonals "N0"units away from
the diagonal non-zero.
My only issue with this arises out of the fact that I had the same
sized matrix before for different parameters and it worked normally!
Anyways, I am grateful to you for taking some time to look at the
stuff I posted!
Cheers
PV

On Feb 2, 3:31 am, Szabolcs <szhor... at gmail.com> wrote:
> One more thing .... since that sparse array is diagonal you might try
> using a vector instead, something like
>
> f[x_?VectorQ] := {1, 2} x
> NDSolve[{u'[t] == f[u[t]], u[0] == {0, 0}}, u, {t, 0, 1}]
>
> This make make things better ... or worse ...



  • Prev by Date: NONE of the Mathematica versions is able to calculate the integrals
  • Next by Date: Efficient way of reading matrices
  • Previous by thread: Re: For Loop and NDSolve
  • Next by thread: Re: For Loop and NDSolve