Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please translate the following portion of a R code into python programming language . Thank you! R code: RES2=rep(0,17) #initalizing the result vector number_years

Please translate the following portion of a R code into python programming language. Thank you! R code: RES2=rep(0,17) #initalizing the result vector number_years <- 100 #set the number of years to simulate # initialize the loop k=1 # yearly ageing for(k in 1:number_years) { RES = lsoda(INPUT, t_range, diff_eqs, parms) #taking the last entry as the the new input that then is propagated accoring to the aging INPUT=RES[366,-1] INPUT[16]=INPUT[16]+INPUT[15]/10 INPUT[15]=INPUT[15]+INPUT[14]/4-INPUT[15]/10 INPUT[14]=INPUT[14]+INPUT[13]/6-INPUT[14]/4 INPUT[13]=INPUT[13]-INPUT[13]/6 INPUT[12]=INPUT[12]+INPUT[11]/10 INPUT[11]=INPUT[11]+INPUT[10]/4-INPUT[11]/10 INPUT[10]=INPUT[10]+INPUT[9]/6-INPUT[10]/4 INPUT[9]=INPUT[9]-INPUT[9]/6 INPUT[8]=INPUT[8]+INPUT[7]/10 INPUT[7]=INPUT[7]+INPUT[6]/4-INPUT[7]/10 INPUT[6]=INPUT[6]+INPUT[5]/6-INPUT[6]/4 INPUT[5]=INPUT[5]-INPUT[5]/6 INPUT[4]=INPUT[4]+INPUT[3]/10 INPUT[3]=INPUT[3]+INPUT[2]/4-INPUT[3]/10 INPUT[2]=INPUT[2]+INPUT[1]/6-INPUT[2]/4 INPUT[1]=INPUT[1]-INPUT[1]/6 RES2 <- rbind(RES2,RES) k=k+1 }

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

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

Discuss the techniques of job analysis.

Answered: 1 week ago

Question

How do we do subnetting in IPv6?Explain with a suitable example.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

1. What might have led to the misinformation?

Answered: 1 week ago

Question

2. How will you handle the situation?

Answered: 1 week ago

Question

3. Write a policy statement to address these issues.

Answered: 1 week ago