Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How used Do and Solve in the same time' topicStudent Support Forum > General > Archives > "How used Do and Solve in the same time"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Thibault
02/06/13 04:07am

In Response To 'Re: How used Do and Solve in the same time'
---------
Thanks for you answer, I didn't know Join[] and Cases[],but I don't obtain the right numbers.
When I do this however it's ok.


TauxCA={0.58`,0.71`,1.1`,1.38`,2.04`,2.47`,2.94`,3.26`,3.49`,3.68`,3.85`,3.99`};
TauxZC={0.5583333333333332`,0.58`};
Solve[100 ==Sum[TauxCA[[i]]*100/(1+TauxZC[[i]])^i+(100+100*TauxCA[[Length[TauxZC]+1]])/(1+x)^(Length[TauxZC]+1),{i,1,Length[TauxCA]}],x];
x /. %;
v = %;
Do[If[v[[i]] ∈ Reals && v[[i]]>0,AppendTo[TauxZC, v[[i]]]], {i, 1, Length[v]}];
TauxZC = Sort[TauxZC];
TauxZC

Out: {0.558333, 0.58, 0.828692}

Then I copy the last result, here 0.828692, and I add it in my list TauxZC and I do it again and again. If I check I have the good result:


In[1]:=100*0.58/(1+0.55833)+100*0.71/(1+0.58)^2+(100+100*1.1)/(1+0.828692)^3
Out[2]=100.

In[3]:=100*0.58/(1+0.55833)+100*0.71/(1+0.58)^2+(100*1.1)/(1+0.828692)^3+(100+100*1.38)/(1+0.95321)^4
Out[4]=100.

URL: ,

Subject (listing for 'How used Do and Solve in the same time')
Author Date Posted
How used Do and Solve in the same time Thibault 02/05/13 04:33am
Re: How used Do and Solve in the same time Bill Simpson 02/05/13 5:03pm
Re: Re: How used Do and Solve in the same time Thibault 02/06/13 04:07am
Re: Re: Re: How used Do and Solve in the same t... Bill Simpson 02/06/13 12:57pm
Re: Re: Re: Re: How used Do and Solve in the sa... Thibault 02/07/13 04:23am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic