검색어 입력폼

# 인하대학교/기계공학/수치해석/주현철교수님/Homework3

저작시기 2014.05 |등록일 2014.07.30 압축파일 (zip) | 가격 1,500원

## 소개글

코드

Q1

// Golden section =======================================================================

#include
#include

#define PI 3.1*************323846264 // 원주율 정의

long double fun ( long double k) // 주어진 the trajectory of a ball의 주어진 거리에 대한 height식을 fun 함수로 설정

{
long double o = 50 ; // 초기 주어진 값들 설정
long double g = 9.81 ;
long double v = 25 ;
long double y = 1 ;

long double fun = tan( o * PI / 180 ) * k - g / ( pow ( v , 2 ) * sqrt( cos( o * PI / 180 ) ) ) * pow(k,2) + y ; // 문제에서 주어진 식

return fun ; // fun 함수로 반환

}

void main()
{
FILE *fp=fopen("data.txt", "w" );

int iter = 1 ;
long double R = ( sqrt(5.0) - 1 ) /2 ; // golden ratio값

long double xl = 0; // 초기 lower value
long double xu = 60; // 초기 upper value
long double d = R * ( xu - xl ) ; //golden ratio를 이용한 d 값

long double xopt ;

printf(" iter\t ea\t \tapproximate \n");
fprintf( fp , " iter\t ea\t \tapproximate \n");
printf("──────────────────\n");

## 컴파일 실행환경

Visual studio2010

## 압축파일 내 파일목록

수치해석3-2.xlsx
homework3-3-4/Debug/homework3-3-4.exe
homework3-3-4/Debug/homework3-3-4.ilk
homework3-3-4/Debug/homework3-3-4.pdb
homework3-3-4/homework3-3-4/data.txt
homework3-3-4/homework3-3-4/Debug/cl.command.1.tlog
homework3-3-4/homework3-3-4/Debug/CL.write.1.tlog
homework3-3-4/homework3-3-4/Debug/homework3-3-4.exe.embed.manifest
homework3-3-4/homework3-3-4/Debug/homework3-3-4.exe.embed.manifest.res
homework3-3-4/homework3-3-4/Debug/homework3-3-4.exe.intermediate.manifest
homework3-3-4/homework3-3-4/Debug/homework3-3-4.lastbuildstate
homework3-3-4/homework3-3-4/Debug/homework3-3-4.log
homework3-3-4/homework3-3-4/Debug/homework3-3-4.obj
homework3-3-4/homework3-3-4/Debug/homework3-3-4.vcxprojResolveAssemblyReference.cache
homework3-3-4/homework3-3-4/Debug/homework3-3-4_manifest.rc
homework3-3-4/homework3-3-4/Debug/mt.command.1.tlog
homework3-3-4/homework3-3-4/Debug/mt.write.1.tlog
homework3-3-4/homework3-3-4/Debug/rc.command.1.tlog
homework3-3-4/homework3-3-4/Debug/rc.write.1.tlog
homework3-3-4/homework3-3-4/Debug/vc100.idb
homework3-3-4/homework3-3-4/Debug/vc100.pdb
homework3-3-4/homework3-3-4/homework3-3-4.cpp
homework3-3-4/homework3-3-4/homework3-3-4.vcxproj
homework3-3-4/homework3-3-4/homework3-3-4.vcxproj.filters
homework3-3-4/homework3-3-4/homework3-3-4.vcxproj.user
homework3-3-4/homework3-3-4.sdf
homework3-3-4/homework3-3-4.sln
homework3-3-4/homework3-3-4.suo
homework3-3-4/ipch/homework3-3-4-1ba54300/homework3-3-4-a4c3bcc.ipch
homework3-3-3/Debug/homework3-3-3.exe
homework3-3-3/Debug/homework3-3-3.ilk
homework3-3-3/Debug/homework3-3-3.pdb
homework3-3-3/homework3-3-3/data.txt
homework3-3-3/homework3-3-3/Debug/cl.command.1.tlog
homework3-3-3/homework3-3-3/Debug/CL.write.1.tlog
homework3-3-3/homework3-3-3/Debug/homework3-3-3.exe.embed.manifest
homework3-3-3/homework3-3-3/Debug/homework3-3-3.exe.embed.manifest.res
homework3-3-3/homework3-3-3/Debug/homework3-3-3.exe.intermediate.manifest
homework3-3-3/homework3-3-3/Debug/homework3-3-3.lastbuildstate
homework3-3-3/homework3-3-3/Debug/homework3-3-3.log
homework3-3-3/homework3-3-3/Debug/homework3-3-3.obj
homework3-3-3/homework3-3-3/Debug/homework3-3-3.vcxprojResolveAssemblyReference.cache
homework3-3-3/homework3-3-3/Debug/homework3-3-3_manifest.rc
homework3-3-3/homework3-3-3/Debug/mt.command.1.tlog
homework3-3-3/homework3-3-3/Debug/mt.write.1.tlog
homework3-3-3/homework3-3-3/Debug/rc.command.1.tlog
homework3-3-3/homework3-3-3/Debug/rc.write.1.tlog
homework3-3-3/homework3-3-3/Debug/vc100.idb
homework3-3-3/homework3-3-3/Debug/vc100.pdb
homework3-3-3/homework3-3-3/homework3-3-3.cpp
homework3-3-3/homework3-3-3/homework3-3-3.vcxproj
homework3-3-3/homework3-3-3/homework3-3-3.vcxproj.filters
homework3-3-3/homework3-3-3/homework3-3-3.vcxproj.user
homework3-3-3/homework3-3-3.sdf
homework3-3-3/homework3-3-3.sln
homework3-3-3/homework3-3-3.suo
homework3-3-3/ipch/homework3-3-3-2f6756bd/homework3-3-3-a3a234b.ipch
homework3-3-2/Debug/homework3-3-2.exe
homework3-3-2/Debug/homework3-3-2.ilk
homework3-3-2/Debug/homework3-3-2.pdb
homework3-3-2/homework3-3-2/data.txt
homework3-3-2/homework3-3-2/Debug/cl.command.1.tlog
homework3-3-2/homework3-3-2/Debug/CL.write.1.tlog
homework3-3-2/homework3-3-2/Debug/homework3-3-2.exe.embed.manifest
homework3-3-2/homework3-3-2/Debug/homework3-3-2.exe.embed.manifest.res
homework3-3-2/homework3-3-2/Debug/homework3-3-2.exe.intermediate.manifest
homework3-3-2/homework3-3-2/Debug/homework3-3-2.lastbuildstate
homework3-3-2/homework3-3-2/Debug/homework3-3-2.log
homework3-3-2/homework3-3-2/Debug/homework3-3-2.obj
homework3-3-2/homework3-3-2/Debug/homework3-3-2.vcxprojResolveAssemblyReference.cache
homework3-3-2/homework3-3-2/Debug/homework3-3-2_manifest.rc
homework3-3-2/homework3-3-2/Debug/mt.command.1.tlog
homework3-3-2/homework3-3-2/Debug/mt.write.1.tlog
homework3-3-2/homework3-3-2/Debug/rc.command.1.tlog
homework3-3-2/homework3-3-2/Debug/rc.write.1.tlog
homework3-3-2/homework3-3-2/Debug/vc100.idb
homework3-3-2/homework3-3-2/Debug/vc100.pdb
homework3-3-2/homework3-3-2/homework3-3-2.cpp
homework3-3-2/homework3-3-2/homework3-3-2.vcxproj
homework3-3-2/homework3-3-2/homework3-3-2.vcxproj.filters
homework3-3-2/homework3-3-2/homework3-3-2.vcxproj.user
homework3-3-2/homework3-3-2.sdf
homework3-3-2/homework3-3-2.sln
homework3-3-2/homework3-3-2.suo
homework3-3-2/ipch/homework3-3-2-43296a7a/homework3-3-2-a280aca.ipch
homework3-3-1/Debug/homework3-3-1.exe
homework3-3-1/Debug/homework3-3-1.ilk
homework3-3-1/Debug/homework3-3-1.pdb
homework3-3-1/homework3-3-1/data.txt
homework3-3-1/homework3-3-1/Debug/cl.command.1.tlog
homework3-3-1/homework3-3-1/Debug/CL.write.1.tlog
homework3-3-1/homework3-3-1/Debug/homework3-3-1.exe.embed.manifest
homework3-3-1/homework3-3-1/Debug/homework3-3-1.exe.embed.manifest.res
homework3-3-1/homework3-3-1/Debug/homework3-3-1.exe.intermediate.manifest
homework3-3-1/homework3-3-1/Debug/homework3-3-1.lastbuildstate
homework3-3-1/homework3-3-1/Debug/homework3-3-1.log
homework3-3-1/homework3-3-1/Debug/homework3-3-1.obj
homework3-3-1/homework3-3-1/Debug/homework3-3-1.vcxprojResolveAssemblyReference.cache
homework3-3-1/homework3-3-1/Debug/homework3-3-1_manifest.rc
homework3-3-1/homework3-3-1/Debug/mt.command.1.tlog
homework3-3-1/homework3-3-1/Debug/mt.write.1.tlog
homework3-3-1/homework3-3-1/Debug/rc.command.1.tlog
homework3-3-1/homework3-3-1/Debug/rc.write.1.tlog
homework3-3-1/homework3-3-1/Debug/vc100.idb
homework3-3-1/homework3-3-1/Debug/vc100.pdb
homework3-3-1/homework3-3-1/homework3-3-1.cpp
homework3-3-1/homework3-3-1/homework3-3-1.vcxproj
homework3-3-1/homework3-3-1/homework3-3-1.vcxproj.filters
homework3-3-1/homework3-3-1/homework3-3-1.vcxproj.user
homework3-3-1/homework3-3-1.sdf
homework3-3-1/homework3-3-1.sln
homework3-3-1/homework3-3-1.suo
homework3-3-1/ipch/homework3-3-1-56eb7e37/homework3-3-1-a15f249.ipch
homework3-1/Debug/homework3-1.exe
homework3-1/Debug/homework3-1.ilk
homework3-1/Debug/homework3-1.pdb
homework3-1/Debug/homework4-1.exe
homework3-1/Debug/homework4-1.ilk
homework3-1/Debug/homework4-1.pdb
homework3-1/homework3-1/data.txt
homework3-1/homework3-1/Debug/cl.command.1.tlog
homework3-1/homework3-1/Debug/CL.write.1.tlog
homework3-1/homework3-1/Debug/homework3-1.exe.embed.manifest
homework3-1/homework3-1/Debug/homework3-1.exe.embed.manifest.res
homework3-1/homework3-1/Debug/homework3-1.exe.intermediate.manifest
homework3-1/homework3-1/Debug/homework3-1.lastbuildstate
homework3-1/homework3-1/Debug/homework3-1.log
homework3-1/homework3-1/Debug/homework3-1.obj
homework3-1/homework3-1/Debug/homework3-1.vcxprojResolveAssemblyReference.cache
homework3-1/homework3-1/Debug/homework3-1_manifest.rc
homework3-1/homework3-1/Debug/mt.command.1.tlog
homework3-1/homework3-1/Debug/mt.write.1.tlog
homework3-1/homework3-1/Debug/rc.command.1.tlog
homework3-1/homework3-1/Debug/rc.write.1.tlog
homework3-1/homework3-1/Debug/vc100.idb
homework3-1/homework3-1/Debug/vc100.pdb
homework3-1/homework3-1/homework3-1.cpp
homework3-1/homework3-1/homework3-1.vcxproj
homework3-1/homework3-1/homework3-1.vcxproj.filters
homework3-1/homework3-1/homework3-1.vcxproj.user
homework3-1/homework3-1.sdf
homework3-1/homework3-1.sln
homework3-1/homework3-1.suo
homework3-1/homework4-1.suo
homework3-1/ipch/homework3-1-b5a1cfb7/homework3-1-725b73c9.ipch