336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

의뢰는 instructables.tistory.com/64로 오세요



https://www.theengineeringprojects.com/2017/05/introduction-to-matlab.html


Hello everyone! 

I hope you all will be absolutely fine and having fun. 

In this tutorial, I am going to give you a detailed Introduction to MATLAB.

안녕 여러분

난 hope 너네 모두 will be 환전 기분좋고 and 재미있길바래.

In 여기 튜토리얼에서, 난 gonna 줄꺼야 네게 a 디테일한 소개를 to MATLAB의.

I will explain in detail, step by step procedure of using MATLAB for the first time. 

First of all, I would like to tell you a bit about the MATLAB software. 

MATLAB basically works on matrices 

and it is an excellent software for different kinds of simulation based projects 

as well as hardware based projects 

and specially, it is good for the Engineering Projects.

난 설명할꺼야 in 자세하게, step by step 절차를 of 사용하기의 of MATLAB 처음에

우선, 난'd like to 말하고싶어 네게 a 조금 about the MATLAB 소프트웨어에 대해.

MATLAB은 기초적으로 작업한다. on 배열상에서

and it is an 훌륭한 소프트웨어다. for 어려운 종류의 시뮬레이션 기반의 project의

as well as 하트웨어 기반 프로젝트들 역시 

and 특히, 이건 좋다. for 엔지니어링 프로젝트에서.


MATLAB can be used for the manipulation purpose 

in order to obtain the proper results.

It is very easy to use this software 

and most of the students prefer to use this software for their projects.

MATLAB can be 사용될수있다. for the 조작 목적을위해

in order to 취득하기위해 the 적합한 결과를.

이건 매우 쉽다 to 사용하는게 이 software를

and 대부분의 학생들은 선호한다.to사용하는걸 이software를for 그들의 projects에


So, this shows that MATLAB is a user friendly software as well. 

MATLAB has a very wide range of applications. 

It can also be used for the real time projects. 

Robotics, image processing and medical related projects 

are its major applications.

You should also have a look at How to Create GUI in MATLAB

So, let’s get started with Introduction to MATLAB:

So, 이건 보여준다. that MATLAB이 유저 친화적 software라는걸 as well.

MATLAB은 갖고있다 매우 넓은 폭을 of applications의.

It can also be 사용된다. for the 실시간 프로젝트들에.

Robotics, 이미지처리 and 의학 관련 프로젝트들 

are 그것의 주요 응용들이다.

넌 should also have a look 해야만한다. at Ho to Create GUI in MATLAB.

So 시작하자 with Introduction to MATLAB과 함께:





So, in the Introduction to MATLAB, 

I will show you the step by step procedure about how to use the MATLAB software for the first time.

그래서, in the Instroduction에서 to MATLAB

난 will 보여줄거다 네게 the step by step 절차 about how to 사용하는법에대한 MATLAB software를 for 처음에.

  • As you open the MATLAB software, a new window will be appeared on your screen.
  • The window is shown in the figure below.




  • The above window is the starting window which appears on the screen when you open the MATLAB.
  • After sometime, you will be able to see another window on the screen.
  • The second window is shown in the figure below.






There are six basic section of the MATLAB 

and understanding them is essential part of Introduction to MATLAB.

The names of all of these sections are given below.

  • Current Folder
  • Command Window
  • Workspace
  • Command History
  • View or Change Directory
  • Help Section

Current Folder is the first section of the MATLAB’s front window 

at the left side of the window. 

It displays the files that has already been saved. 

You can open the files that are already saved somewhere 

in your PC or laptop.

현재 폴더는 첫 섹션이다. of the MATLAB의 front window의

at the 왼편에 있는

이건 displays한다. the files를 that갖고있는 이미 been saved된.

넌 can 열수있다. the files를 that are 이미 saved된 somewhere에

in 네 컴퓨터안에.

  • The current folder section is shown in the figure below.



Command Window is the second section 

and is used to show the results of the entire source code.

If we want to observe the results on the command window, 

we must not put a semicolon after the statement then. 

If there is a semicolon at the end of the statement, 

result of that statement will not be shown on the command window.

명령 창은 두번째 section이다. 

and 사용된다. to 보여주기위해 the 결과들을 of the 전체 코드.

만약 우리가 원한다면 to 감시하길 the 결과들을 on the 명령창 상에서,

우린 반드시 put할필요는없다. a semicolon을 after the 문장다음에 그렇게.

If there is a semicolon이 있다면 at the end of the statement끝에,

문장의 결과가 will not be 보이지않을것이다. on the 명령창 상에.

  • The command window section is shown in the figure below.


Workspace is the third section of the MATLAB’s front window 

which shows all the variables 

that are used while writing the complete algorithm.

작업공간은 세번째 section이다. of the MATLAB의 front window의

which 보여주는 모든 변수들을

that are 사용된 while 쓰는동안 완전한 알고리즘을.

  • Workspace section is shown in the figure below.

Command History is the fourth and the last section of the MATLAB’s front window. 

It shows all of the commands that have been used in the entire algorithm.

명령어 히스토리는 the 네번째이자 마지막 section이다. of the MATLAB의 front window의.

이건 보여준다. 모든 commands를 that 이미 사용된 in the 전체 알고리즘에서.

  • The command history section is shown in the figure below.



View or Change Directory helps us to view the directory or the complete destination of the file that is opened in the MATLAB.

You can also open a new file by changing its directory.

뷰 or 디렉토리 바꾸기 는 돕는다. 우릴 to 보여주는걸 the 디렉토리 or the 완벽한 목적을 of the 파일의 that is 열린 in the MATLAB에서.

넌 can also 열수있다. a 새로운 파일을 by 바꿈으로써 its 디렉토리를.

  • Directory box is shown in the figure below.



Help Section is also an amazing tool of the MATLAB. 

It provides help regarding of the command or any other thing related to MATLAB. By typing the thing which is not clear, you will be able to find a lot of help.

도움말 섹션 은 also an 놀라운 툴이다. of the MATLAB의.

그건 제공한다. 도움말을 관련있는 of the 명령어에 or 어느 다른것에 related to MATLAB에.

By 타이핑함으로써 the thing which is not 깔끔하지않은, 넌 will be 가능케될꺼다. 찾는게 a 많은 도움말을.

  • The button to open the help section is shown in the figure below.



  • As you press this button a new named as help will be appeared on your screen to help you.
  • The help window is shown in the figure below.



  • So that was the brief discussion about how to getting started with the MATLAB.

So, that is all from the tutorial Introduction to MATLAB. 

I hope you have enjoyed this tutorial. 

If you find any sort of problem in introduction to matlab, 

you can ask in comments anytime without even feeling any kind of hesitation.

난 바란다. 네가 이미 즐겼기를 이 튜토리얼을.

만약 네가 찾는다면 다른 종류의 문제를 in 소개에서,

넌 can 물을수있다. in 댓글로 언제든지 without even 느낌없이 any kind of 망설임.

I will try my level best to solve your issues in a better way, if possible. In my next tutorial I will elaborate the Declaration of Variables in MATLAB and how to manipulate them without assigning them with the values. Moreover, you should also have a look at How to Create m file in MATLAB. I will further explore MATLAB in my later tutorials. So, till then, Take Care 🙂




matlab ode45툴

▼참조

https://www.mathworks.com/help/matlab/ref/ode45.html

http://www.eng.auburn.edu/~tplacek/courses/3600/ode45berkley.pdf


MATLAB's standard solver for Ordinary Differential Equations (ODEs)

is the function ode45.

This function implements a Runge-Kutta method with a variable time step for efficient computation.

이 함수는 실행한다. 런지-쿠타 메소드를 with a 시간변수단계에 따라 for 효율적 계산을 위해


ode45 is designed to handle the following general problem:

dx/dt = f(t,x) , x(t0) = x0


where t is the independent variable,

x is a vector of dependent variables to be found 

and f(t,x) is a function of t and x.

t가 독립변수 일때,

x는 a 벡터이다. of 의존변수들의 to be 발견되는 (=t값에 따른 변수들의 모임이 x에 해당)

f(t,x) 는 x변화량/t변화량

The mathematical problem is specified when the vector of functions on the right-hand side of Eq(1).

f(t,x) is set and the initial conditions, x=x0 at time t0 are given.


ㅂㄱㄷ

5000 * 5 = 25000원

5000 * 10 = 5만

5000+10000+15000+20000+25000 = 75000원

10000+15000+20000+25000+30000 = 10만


3.22 / 3.29 / 4.7 / 4.15 / 7.13 



*pendulum = 진자

initial conditions는(θ(=Theta), ω(=Omega))

1 radian은 반지름, 호의 길이가 모두 1인 단위이다.

rad/s 는 1초에 한 cycle을 돈다는 의미이다. (▶LINK)(rad/s 와 Hz의 상관관계)

Angular Velocity (=각속도) = ω=dθ/dt

θ는 sin곡선에서 정점을 의미한다.

** deg2rad(90) = rad2deg(1.5708)      (◀각각 rad, deg 단위 변환)

rad2deg(0.1) = 5.7296 = θ

*** a = convangvel([0.3 0.1 0.5], 'deg/s', 'rad/s')      (◀LINK)

3개의 각속도 0.3, 0.1 0.5를 deg/s 에서 rad/s로 변경할때 쓰인다.

참고로 0rad/s는 변경해줘도 0deg/s 이다.

각속도 측정에 많이 쓰이는 Major 단위는 rad/s, deg/s rpm 이다. 

sqrt(x)

sqrt((-2:2)') (-2부터 2까지 1씩 증가하는 5개 요소를 각각 sqrt계산을 해서 세로로 정렬)

sqrt(-2:2) (-2부터 2까지 1씩 증가하는 5개 요소를 각각 sqrt계산을 해서 가로로 정렬)

x.^2 (거듭제곱 문법) (▶LINK)


tanθ = (y/x)

θ = tan^-1(y/x)

(여기서 tan^-1 이 arctan에 해당한다.) (▶LINK)

https://www.mathsisfun.com/sine-cosine-tangent.html (◀삼각함수 기본 사이트)





Initial Condition (θ,θ')


https://www.youtube.com/watch?v=6Wqy1iOY8MQ




https://www.youtube.com/watch?v=Fa5GYfFFfkQ

Theta가 -145Degree일때 Theta의 Double Prime은 215Degree이다. (2:29)

Theta = -145

Theta single prime = -145 + 360 = 215 Degree

Theta double prime = 215 -  180 = 35 Degree

★a=primes(10) :: 10보다 작거나 같은 소수를 출력할때 쓰인다.(여기 쓰이는 명령어는 아님)




사용하기 the equations of 모션 for the simple 흔들리는추 in 데카르트 좌표계

수치적 통합하라. trajectory(=사선) for the 초기조건들

solution

Listing 3.1 은 보여준다. MATLAB 수행을 of the 수치적 통합을 of 이런 방정식들의

기억해라. that 우린 이미 위치시켰다. 두 plotting을 and 적분함수를 into a single .m파일에

우린 호출한다 그 첫 함수를 in the file에,

which has access to the second.

그 결과는 보여준다. in Figure 3.8

Using the default 허용치 settings for ode45,

we see that 계산된 길이 of the 흔들리는추 실질적으로 증가하는 with 시간에따라

>> dbtype 201:213 ode45

This is due to 향할것이다. numerical 에러로 and can be mitigated(=완화된) by 감소시킴으로써 the 적분기 허용치를

but 신 시간이 지나면서, the 흔들리는추 길이는 will 항상 변화할것이다. 약간

when 사용하면서 데카르트 좌표를.

유사하게, the 계산된 흔들리는추 앵글은 가끔 jumps한다 between 값들 사이에서 around Pi와 -Pi

due to 작은 적분기 에러로 인해.

https://kr.mathworks.com/help/matlab/ref/atan.html

▲역탄젠트 표현법

>> atan(0.8)

>> ans = 0.6747

사전에 x축y축의 범위를 설정해줘야한다.(xy좌표세팅)

설정하는법은....예컨데

>> x = -20 : 0.01 : 20

-20부터 ~ 20까지 0.01씩 눈금을 찍겠다는 뜻이다.

>> plot(x , atan(x))

>> grid on (◀눈금 그려서 가독성을 높인다.)

https://kr.mathworks.com/help/matlab/ref/cart2pol.html

▲카르테잔 좌표 (Cartesian좌표를 Polar좌표)

x  = [5 3.5355 0 -10]        (◀불연속성 지점을 찍어준다.)

y = [0 3.5355 10 0]          (◀불연속성 지점을 찍어준다.)

[theta, rho] = cart2pol(x, y)    (◀θ=각도, ρ=거리)


▼스피리컬 코디네이트 = 극좌표

Spherical Coordinate in Matlab.txt

▶LINK 





x=-100:0.1:100;        (from -100 to 100 by 0.01)

plot(x, atan(x));

▼plot(sqrt(x.^2+y.^2))            :: sqrt의 유뮤에 따른 그래프 차이를 비교해볼 필요가 있다.




3.22 / 3.29 / 4.7 / 4.15 / 7.13 

Sketch하자 a planar model을 or two-cord bungie jump (Figure 3.47)

in which you represent the person of mass mp using a point mass P and the bungie cords as simple springs with indentical spring constants k and rest lengths l0

그곳에서 넌 대표한다 the 사람을 of 질량 "mp" 사용하여 a 포인트 메스 "P"를 and the 번지코드s

as 심블 스프링들로써 with 동일한 스프링 상수 k와함께 and 나머지 길이 "l0".

Assume the distance between the attachment points is 2l0.

가정하자 그 길이 between the 부착된지점은 2l0라고.

a. How many degrees of freedom does your model have ?

얼마나 많은 자유도(▶LINK) 를 네 모델을 갖고있는가 ?

We assume that the jumper is free to move in the plane of the two cords' attachment points, but is constrained to this plane.

우린 가정한다. that the 점퍼가 자유롭다고 to 이동하는데 in the plane of the 두개줄의 부착

지점들, but is 제한된=부자연스러운 to 이 평면에.

Therefore, our model will have two degrees of freedom, represented by the angles of the two cords.

따라서, 우리의 모델은 will 가질것이다. 두개 각도들을 of freedom, 대표되는 by the angles of 두개 줄들의.

b. Find the equations of motion of P.

방정식을 구하시오. of 모션 P의

We model the jumper as a point mass P of mass m, 

attached by two springs 

to points O and Q.

우린 모델링했다. the 점퍼를 as a 포인트 질량 P로 of 질량 m의, 

부착된 by 두개 스프링들에 의해

to 지점들에 Q and Q.

Let L=(O,e1,e2,e3), B=(O,er,eθ,e3) and C=(Q,c1,c2,c3) as shown in 그림S3.13에서 보는바처럼

The inertial kinematics of P with respect to O are

/어너셜/=관성의 운동학 of P의 (with respect to) O에 대하여

r P/O = rer

v

a

The frames are related by the following transformation table,

 

 er

eθ 

 e1

 cosθ

 -sinθ

 e2

 sinθ

 cosθ

 c1

 cosβ

 -sinβ

 c2

 sinβ

 cosβ

β=θ-α



c. Integrate the equations of motion in MATLAB using mp = 50kg, k=10N/m, and l0=5m,

assuming that the person falls from rest.

적분해라. 그 모션방정식을 in MATLAB으로 사용하여 mp = 50kg, k=10N/m (줄의탄성), and l0=5m (의 초기 길이)

가정하자 that the 사람이 떨어진다고 from the rest.

To intgrate the equations of motion,

we must find cosβ, sinβ, and ρ in terms of r and θ.

We have....

We choose our initial conditions as r=2l0, θ=45º, and r'=θ'=0.

Listing 3.4 shows the code used to create the trajectory plot in Figure S3.14.

우린 선택한다. 우리의 초기조건들을 as r=2l0으로, θ=45º, 그리고 r'=θ'=0으로.

리스팅 3.4는 보여준다. code를 사용된 to 만들기위해 the 탄도 plot을 그림S3.14에서.

We plot in a reference frame with unit vectors ex=e2, ey=-e1

so that gravity is pointing in the -ey direction.

We assume that point O is located at coordinates (0,0) in this frame.

우린 그래프를 그린다. in a 참조 프레임에서 with 단위 벡트들로

so that 중력은 가리키고있다 .in the -ey방향을.

우린 가정한다. that 포인트 O은 위치해있다고 at 좌표 (0,0)에 in 이 프레임에서.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

우선 Cartesian coordinate system으로 좌표생성

X = 0:1:100;

Y = -100:1:0;

plot(x,y);

좌표 길이를 맞춰주지 않으면 아래와 같은 Error가 발생한다.

다음 사용중 오류가 발생함 : plot

벡터들의 길이는 같아야 합니다.



d. Plot the tension in the bungie cords versus time.

How stong do they have to ve so they won't snap ?



https://www.chegg.com/homework-help/questions-and-answers/write-matlab-program-simulate-bungee-jump-bungee-jumping-equipment-company-new-bungee-cord-q12169437


Intertia :관성

B



3.22 / 3.29 / 4.7 / 4.15 / 7.13 

Fig 4.20 shows a simple model for the gravitational attraction of particle P 

to an object with nonuniform density.

그림 4.20은 보여준다. a 심플 모델을 for the 중력의 끌어당김 of 파티클 P의

to an 객체로의 with 일정하지않은 밀도

Here, rather than a single mass at the origin O,

we have a dipole close to the origin separated by 2d.

Assuming that the motion of P starts in the plane of the dipole, 

then to a good approximation (for r >> d) 

the force acting on the particle due to the dipole is...

여기있다, rather than a 단일질량보다는 at the 원점 O에,

우린 갖고잇다. 쌍극자 close to the 원점에가까운 분리된 by 2d에 의해.

가정하자. that the 모션 P가 시작한다고. in the 평면에서of the 쌍극성,

then to a 좋은 근사치로 향한다. (for r >> d)

그 힘... 작용하는 on the particle due to the 쌍극자로인한 ...은

Determine whether the angular momentum of P relative to O 

is conserved for this problem.

Is the motion still a planar orbit, as it was for a single attracting particle ? 

Write down the resulting equations of motion for P.

정의해라. whether the 각도를 갖는 움직임... of P의 연관된 to 원점O에

...이 보존됬는지 for 이 문제에서.

Is the 모션이 여전히 평면 궤도인가, as it was for a 단독으로 끌어당기는 particle을 위해

써내려가라 the 결과를 산출하는 방정식을 of 모션의 for P를 위한

Numerically compute the trajectory of P for the following parameters

: r0=1.5625 distance units, r'0=0, θ=0.6435 radians, θ'0=0.6144 radians/time unit, μ=0.5 distance units³/time unit²,

and d=0.3125 distance unit.

수치상으로 계산해라. the 궤적을 of P의 for the 따라오는 매개변수들로

: r0=1.5625 (초기거리), r'0=0 (직선운동), θ0 (초기각도), θ'0 (시간별 각도변화)

μ (??), d (날아간 거리)


You should integrate for 100 time units.

Also compute the trajectory for the central force

due to a mass of 2m located at the origin and compare.

넌 적분해야한다. for 100 time 단위만큼.

또한 계산해야한다. that 궤도를 for the 중심 힘에서의

due to a 질량으로인한 of 2m만큼의 위치한 at the 원점으로부터 and 비교해라.


Use the same initial conditions for both integrations.

Note that distance is measured in earth radii and time is measured in fractions of an orbital period.

사용해라. the 같은 초기 초건들을 for both 적분들을위해.

기억해라. that 거리는 측정된다. in 지구반경 and 시간은 측정된다. in 파편들로 of an 궤도들의 주기동안.

[HINT: Numerical integration errors

may cause the central-force trajectory to appear like a spiral rather than a

closed orbit. Try reducing the error tolerances used by ODE45 using ODESET.]

수치적 적분 에러들이 아마 유발할것이다. the 중심-힘 궤도가 to 나타나도록 like 나선으로 rather than a closed orbit.

Try 줄이도록 시도해라. the 에러 허용치들을 used by ODE45에 의해.


theta = 0:0.01:2*pi;    (◀θ범위 지정 0~2π까지 (0도~360도))

phi = ▲theta와 같은 간격으로 설정해줘도 된다.

rho = sin(2*theta).*cos(2*theta); (theta와 rho는 한세트로 설정해줘야함)

(▶LINK) :: 극좌표 플롯 (*과 .*의 차이) :: .*은 배열 내부끼리의 곱

y=linspace(x1, x2)    :: x1과 x2사이에 100개의 점으로 구성된 벡터

y=linspace(x1, x2, n)    :: x1과 x2사이에 n개의 점으로 구성된 벡터 (▶LINK)

Trigonometry Array

rx = [cos(theta) sin(theta)];

ry = [-sin(theta) cos(theta)];


>>

Solution

Since 극성 frame이 정해져있지않기때문에 in the 문제에서,

우린 set up an 관성 frame을 셋업했다. (O,e1,e2) (◀원래각도)

and 극성 frame을 (O,er,eθ) in the 같은 sense에서 as 정의된 in 챕터 3에서.

The frames와 단위 벡터들은 보인다. in 그림S4.3에서.

여기 일반 e3 축은 out of the page바깥에 있다.

The particle's position is thus따라서 주어진다. by r p/o = rer에 의해

The 변환 array 는 .... 그림참고

.

.

.

Defining x = [r r' θ θ']^T,

we can numerically integrate these equations of motion in MATLAB,

using code in listing 4.1, with results shown in Fig S4.4.

Note that if you use the default ode45 settings,

the sample central force trajectory does not close on itself,

but spirals out,

as in Fig S4.5, due to integrator error.






Surf함수 사용


Posted by ElectricShock
:
BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
Programming(=프로그래밍) (3)
MiDi (2)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백