d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Matlab Code/programing Need Help
Prev123Next
Add Reply New Topic New Poll
Member
Posts: 239
Joined: Aug 27 2014
Gold: 0.01
Sep 12 2014 05:12pm
Quote (saber_x3 @ Sep 12 2014 06:58pm)
Ya, so it's giving you the correct answers, just negative
that is because you got b as 10^8 when it is -10^8
10^-8 is essentially 0
you can make matlab format it to show more zeros, but i don't remember how

matlab is matrix laboratory, and it expresses some answers as (constant*matrix)
it can help when you have a large matrix with large numbers


so what do I do from here?



This post was edited by TheDiablo3KnowItAll on Sep 12 2014 05:15pm
Member
Posts: 7,721
Joined: Oct 11 2008
Gold: 304.00
Sep 12 2014 06:56pm
Well...change b to -
you input b incorrectly
Member
Posts: 239
Joined: Aug 27 2014
Gold: 0.01
Sep 12 2014 07:33pm
Quote (saber_x3 @ Sep 12 2014 08:56pm)
Well...change b to -
you input b incorrectly


ya just finished #2

for #3

I don't understand how as theta approaches 0, 1- cos(theta) becomes theta^2 / 2. Doesn't it be come 0? 1 - cos(0) = 0

so idk how it approaches theta^2 / 2
Member
Posts: 7,721
Joined: Oct 11 2008
Gold: 304.00
Sep 12 2014 09:00pm
what it becomes isnt really your worry in programming. intro programming usually has complex expression that test your orderof operations and paraenthesis knowledge. you will see many equations that you might not understand. but, it is xx/2 due to expansion of the series
Member
Posts: 239
Joined: Aug 27 2014
Gold: 0.01
Sep 12 2014 09:13pm
Quote (saber_x3 @ Sep 12 2014 11:00pm)
what it becomes isnt really your worry in programming. intro programming usually has complex expression that test your orderof operations and paraenthesis knowledge. you will see many equations that you might not understand. but, it is xx/2 due to expansion of the series


Ooh, so it only took the first 2 nonzero terms of the taylor expansion right?
Member
Posts: 7,721
Joined: Oct 11 2008
Gold: 304.00
Sep 12 2014 09:30pm
Quote (TheDiablo3KnowItAll @ Sep 12 2014 09:13pm)
Ooh, so it only took the first 2 nonzero terms of the taylor expansion right?


yes, other terms are too low
Member
Posts: 239
Joined: Aug 27 2014
Gold: 0.01
Sep 12 2014 10:45pm
whats the main cause of this error? is it because your chopping off the taylor series at 2 terms ??
Member
Posts: 7,721
Joined: Oct 11 2008
Gold: 304.00
Sep 12 2014 11:15pm
Quote (TheDiablo3KnowItAll @ Sep 12 2014 10:45pm)
whats the main cause of this error? is it because your chopping off the taylor series at 2 terms ??


I plugged it in wolfram alpha and it's actually the first non zero term only
pretty sure the error is from using that first term only
i don't believe there is any significant error from matlab even on x=10^-9
Member
Posts: 239
Joined: Aug 27 2014
Gold: 0.01
Sep 13 2014 12:40am
Quote (saber_x3 @ Sep 13 2014 01:15am)
I plugged it in wolfram alpha and it's actually the first non zero term only
pretty sure the error is from using that first term only
i don't believe there is any significant error from matlab even on  x=10^-9


why is it the first nonzero term only?

the cos x series goes like this.. 1 - x^2/2! + x^4/4! - x^6/6! + ...

and the expression was 1 - cos x and it approached x^2/2!.

So 1 - (1 - x^2/2!) = x^2/2!
Member
Posts: 7,721
Joined: Oct 11 2008
Gold: 304.00
Sep 13 2014 10:15am
Quote (TheDiablo3KnowItAll @ Sep 13 2014 12:40am)
why is it the first nonzero term only?

the cos x series goes like this.. 1 - x^2/2! + x^4/4! - x^6/6! + ...

and the expression was 1 - cos x and it approached x^2/2!.

So 1 - (1 - x^2/2!) = x^2/2!


because i asked for the expansion of 1-cosx
doesnt really matter
Go Back To Homework Help Topic List
Prev123Next
Add Reply New Topic New Poll