How to solve this equation?

Hello, I'm trying to solve this equation using Matlab: (to find i)
But I can't understand the result that I get which is:
I'm only showing a part of the result. Any help to solve this equation is much appreciated.
syms i;
prt1=61466000*((1+i)^46-1)/(i*(1+i)^46);
prt2=400000000*(1+i)^-1;
prt3=500000000*(1+i)^-2;
prt4=760000000*(1+i)^-3;
prt5=200000000*(1+i)^-4;
prt6=140000000*(1+i)^-5;
prt7=3105237.5*((1+i)^46-1)/(i*(1+i)^46);
second=prt2+prt3+prt4+prt5+prt6+prt7;
eqn=prt1-second;
solve(eqn,i)

4 Commenti

Cesar Antonio Lopez Segura
Modificato: Cesar Antonio Lopez Segura il 20 Set 2018
Why do you delete the term (1+i)^-4 in your code ?
Does i have to be positive integer ?
Yeah I forgot to include this! Thanks for pointing it out. Torsten below gave me a solution which is correct I think, but could you help me to get the answer in 7 significant figures?
@Dimitris Kalogiros, yeah it has to be a very small number between 0 and 0.1. I need it in 7 s.f

Accedi per commentare.

 Risposta accettata

Torsten
Torsten il 20 Set 2018
fun=@(i)400000000*(1+i)^-1+500000000*(1+i)^-2+760000000*(1+i)^-3+200000000*(1+i)^-4+140000000*(1+i)^-5+3105237.5*((1+i)^46-1)/(i*(1+i)^46)-61466000*((1+i)^46-1)/(i*(1+i)^46);
sol=fzero(fun,0.01)

4 Commenti

Hey thanks for your answer!
I'd like to get this answer in 7 s.f, and as Cesar pointed out. I made an error when I wrote the equation. Forgot to include the terms: (1+i)^-4
I modified your equation to include this term. Could you please check it? Also I need this answer in 7 significant figures at least.
Thank you!
fun=@(i)400000000*(1+i)^-1+500000000*(1+i)^-2+760000000*(1+i)^-3+200000000*(1+i)^-4+140000000*(1+i)^-5+3105237.5*((1+i)^46-1)/(i*(1+i)^46)*((1+i)^-4)-61466000*((1+i)^46-1)/(i*(1+i)^46)*((1+i)^-4);
sol=fzero(fun,0.01)
Right now when I solve it, I get 0.0124 which is correct. Just need more accuracy :)
format long
fun=@(i)400000000*(1+i)^-1+500000000*(1+i)^-2+760000000*(1+i)^-3+200000000*(1+i)^-4+140000000*(1+i)^-5+3105237.5*((1+i)^46-1)/(i*(1+i)^46)*(1+i)^-4-61466000*((1+i)^46-1)/(i*(1+i)^46)*(1+i)^-4;
sol=fzero(fun,0.01)
Thanks!!

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2018a

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by