Find Jobs
Hire Freelancers

C++ simple Programming (easy)

$30-250 USD

已完成
已发布大约 13 年前

$30-250 USD

货到付款
Please see file for details. Write a C++ program that does the following: a. Solves the differential equation (equation 1) from 0 to 100 min in step sizes of 1 minute for the twenty combinations of 5 patch sizes and 4 body weights. This must be done using two functions that you write. The first function will be a void function called "eulers" and will execute the euler's method for a given set of parameters. The second function will be a single-result function called "yprime", and will be the function that calculates the value of the function to be integrated by "eulers" (the right side of equation 1). A common problem you will encounter is how to let the yprime function know what the values are for body weight and patch area. We recommend passing the parameters used in equation 1 as arguments passed by value, with the weight and patch size parameters for each case being changed within the main program before being passed by a function call to "eulers" and then to "yprime". b. For each of the twenty solutions, the main program determines, using numerical integration, the time-averaged concentration of the drug (Cd,ave). We recommend (but it is optional) storing the twenty values of Cd,ave in a 4x5 double-indexed array for use in parts c and d. c. In a third void function the program compares these time-averaged concentrations, Cd,ave, with the target concentration of 2.1 mg/lb to determine which size patch (i.e. area) is best suited for each body weight. The best patch size is the one that gives a Cd,ave, that is closest to the target. d. Prints the results of the computations to the screen, and to two different text files, as follows: 1. The Cd vs. time results for all 20 cases are printed to a file named cdvst.txt. Each case will be a separate table within the file. The tables will have titles for the body weight and patch area at the top, followed by column headings of t and cd (see the example below). The numbers should be printed with good formatting using iomanip functions. 2. A table listing body weight, patch area, and Cd,ave for each of the 20 cases to a file named cdave.txt. The table should have proper headings and units, and be well formatted using iomanip. 3. The final results of the calculations are printed to the screen only. These will be the best patch size for each body weight, the Cd,ave that can be achieved with that patch size, and the target value for Cd,ave .
项目 ID: 1015576

关于此项目

1条提案
远程项目
活跃13 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
interested to do this project
$30 USD 在2天之内
4.0 (2条评论)
1.7
1.7

关于客户

UNITED STATES的国旗
amherst, United States
4.8
1
会员自4月 8, 2011起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。