       • To: mathgroup at smc.vnet.net
• Subject: [mg96511] Problems about "For"
• From: laura parisi <lau.parisi at gmail.com>
• Date: Sun, 15 Feb 2009 03:21:01 -0500 (EST)

```Dear Mathematica Users,

I've realized a loop using Euler method:

For[i=1,i<2,
{S=1/2*N12/DE[i-1]-1/2*DE[i-1]*=83=D5rif2,
a[i]=DSolve[=83=E2'[t]-S=83=FA0,=83=E2[t],t],=83=E2[t]==83=E2[t]/.a[=
i],
=83=E2[t]==83=E2[t]/.C=84_C1,
eq==83=E2[t]/.t=84_(t1[[i]]-1),
a=Solve[eq===83=E2[i-1],C1],
=83=E2[i]==83=E2[t]/.{C1=84_a,t=84_t1[[i]]},DE[i]=DE[i-1]*=83=E2[i]}=
;i++];

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

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

All the other parameters are allocated:
B=1;
N0=2;
=83=E7=1;
A=1;
E0=1;
=83=E2=1;
=83=D5rif=1;
DE=1;

The loop give me this error:

Solve::eqf :  {-2+C1}=83=FA1 is not a well-formed equation. =83=F7
with C1 constant of integration.

What can I do for this loop in this case and 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: Length of a held expression
• Next by Date: Re: Conditional evaluations of functions
• Previous by thread: Re: Length of a held expression