MathGroup Archive 2009

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

Search the Archive

Try again to send my message: problems about "for"

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96550] Try again to send my message: problems about "for"
  • From: laura parisi <lau.parisi at gmail.com>
  • Date: Mon, 16 Feb 2009 06:57:09 -0500 (EST)

Dear Mathematica Users,
the last message was unreadable  and so i send it again.


I've realized a loop using Euler method:
For[i = 1, i < 2,
{S = (1/2)*(N1^2/DE[i - 1]) - (1/2)*DE[i - 1]*\[Epsilon]rif^2,
a[i] = DSolve[Derivative[1][\[Rho]][t] - S == 0, \[Rho][t], t],
\[Rho][t] = \[Rho][t] /. a[i],
\[Rho][t] = \[Rho][t] /. C[1] -> C1,
eq = \[Rho][t] /. t -> (t1[[i]] - 1),
a = Solve[eq == \[Rho][i - 1], C1],
\[Rho][i] = \[Rho][t] /. {C1 -> a, t -> t1[[i]]},
        DE[i] = DE[i - 1]*\[Rho][i]}; i++];

in this expression, N1 is stated like a sinusoidal function:
N1 = N0 + B*Sin[\[Omega]*t];

and T1 is a vector of time:
t1 = Table[i, {i, 20}]

All the other parameters are allocated:
B = 1;
N0 = 2;
\[Omega] = 1;
A = 1;
E0 = 1;
\[Rho][0] = 1;
\[Epsilon]rif = 1;

The loop give me this error:
Solve::eqf:{-2+C1}==1 is not a well-formed equation. >>

with C1 constant of integration.


What can I do for this loop in this case and in a case if i want to
reapet the loop for i<100?
Is better to use "DO"?


Help me..It's important.

Thank you!


  • Prev by Date: Re: Typesetting bug
  • Next by Date: Re: Laplace Transform Exponential Shift
  • Previous by thread: Re: Howto change TraditionalForm Output
  • Next by thread: Re: Try again to send my message: problems about "for"