Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

what did i do wrong and can you give me the right one? Function Save C Reset MATLAB Documentation 1 function (circt,ramlT]-orbit(major, minor, velo) a

what did i do wrong and can you give me the right one? image text in transcribed
image text in transcribed
image text in transcribed
Function Save C Reset MATLAB Documentation 1 function (circt,ramlT]-orbit(major, minor, velo) a major; 3 b-minor; 4 p1=2*pisart((a+2+5^2)/2); p2-pi*(3* (a+b)-sart((3*a+b)*(+3*b))); circTep1/(24*3600*velo); ramlT-p2/(24*3680*velo); Code to call your function C Reset 1 (circt, ramlt, ram2T] - orbit(149629880,149588000, 29.78) Run Function Assessment: 0 of 2 Tests Passed Submit * Earth Numbers Your function did not perform correctly with earth numbers. This means you probably have an error in your code Random Numbers Your function did not work with at least one randomly generated value. If the first test passes, this means you are probably hard-coding values to your inputs. Don't do that! To generate random inputs, use this code: b 2- rand 50 - 10000000; rand 58 - 18000000; V rand 300; 1. [Submit on zyLabs) Write a function called orbit that takes three inputs and returns three outputs. Our function is related to a planet that is in orbit around a star. Remember that planets have elliptical orbits, like this: Image from https:upload.wikimedia.orgskipedia Commons 19 Picture_of_an_elliptical_arbitjP An ellipse has two measurements that we can use define it. Those are the major axis radius (a in the picture) and the minor axis radius ( in the picture below) Image from tops uploaded or w edi com b as _und_ir_ 1200ps-Elpit Your function should take information about your planet's orbit and tell us how long that orbit will take. Your three inputs should be: - The major axis radius, major - The minor axis radius, minor. - The planet's orbital velocity, velo, in meters per second Your outputs should be the length of one year on that planet, in days, using three approximations for the perimeter of an ellipse: - A circular approximation, circTime. - Using Ramanujan's first approximation, ramlTime. - Using Ramanujan's second approximation, ram2 Time This means that when you call your function, it should have the form: [circTime, ramiTime, ram2Time) = orbit (major, minor, velo); The circular approximation is: Ramanujan's first approximation is: perimeter [3(a+b) (3a + b)(a + 3b)] Ramanujan's second approximation is: Where ( b) (a + b2 perimeter (a + b)(1+ - 10+ 14-3 Note that those equations give you perimeters. To calculate the time it takes to travel that distance, you have to divide a perimeter by a velocity. Then remember to convert the time to the correct units (days). To test your code, use these inputs: Input a (km) b (km) (km/s) Earth Data 149600000 149580000 29.78 You should find Output circ Time Time in Days 3.652952252479330+02 raml Time ram2 Time 3.652952248398216e+02 3.652952248398215e-02 Note that earth's orbit is indeed very close to a circle! Srinivasa Ramanujan was an Indian mathematician. Click here to read more about him

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

ISBN: 1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

For what purpose is a chi-square homogeneity test used?

Answered: 1 week ago

Question

politeness and modesty, as well as indirectness;

Answered: 1 week ago