軟體實作與計算實驗 1  Roots of nonlinear functions  Nested FOR loops Lecture 5II.

Slides:



Advertisements
Similar presentations
Inverse problem (from experimental data to model construction)
Advertisements

Lecture Discrete Probability. 5.3 Bayes’ Theorem We have seen that the following holds: We can write one conditional probability in terms of the.
Lecture 13 L1 , L∞ Norm Problems and Linear Programming
數值方法 2008, Applied Mathematics NDHU 1 Nonlinear systems Newton’s method The steepest descent method.
Use MATLAB to solve linear programs LI Xiao-lei. MATLAB format for linear programs MATLAB uses the following format for linear programs: min z = f T x.
Optimization. f(x) = 0 g i (x) = 0 h i (x)
Optimization of thermal processes2007/2008 Optimization of thermal processes Maciej Marek Czestochowa University of Technology Institute of Thermal Machinery.
Optimization to solve Inverted Pendulum problem Zhili Chen.
1 MF-852 Financial Econometrics Lecture 3 Review of Probability Roy J. Epstein Fall 2003.
Visual Recognition Tutorial
Lecture 4 More Examples of Karnaugh Map. Logic Reduction Using Karnaugh Map Create an Equivalent Karnaugh Map Each circle must be around a power of two.
1 Software Testing and Quality Assurance Lecture 36 – Software Quality Assurance.
Design of Curves and Surfaces by Multi Objective Optimization Rony Goldenthal Michel Bercovier School of Computer Science and Engineering The Hebrew University.
The moment generating function of random variable X is given by Moment generating function.
Chapter 5 Integrals 5.2 The Definite Integral In this handout: Riemann sum Definition of a definite integral Properties of the definite integral.
1 Chapter 5 Nonlinear Programming Chemical Engineering Department National Tsing-Hua University Prof. Shi-Shang Jang May, 2003.
Today Wrap up of probability Vectors, Matrices. Calculus
©2003/04 Alessandro Bogliolo Background Information theory Probability theory Algorithms.
CS774. Markov Random Field : Theory and Application Lecture 08 Kyomin Jung KAIST Sep
軟體實作與計算實驗 1 Lecture 9 Classification Two mappings from position to color Linear combination of distances to centers RBF: Linear combination of exponential.
EM and expected complete log-likelihood Mixture of Experts
Probability Distributions - Discrete Random Variables Outcomes and Events.
1 HMM - Part 2 Review of the last lecture The EM algorithm Continuous density HMM.
Fin500J: Mathematical Foundations in Finance
Chapter 7 Optimization. Content Introduction One dimensional unconstrained Multidimensional unconstrained Example.
4.1 Probability Distributions. Do you remember? Relative Frequency Histogram.
The Mean of a Discrete RV The mean of a RV is the average value the RV takes over the long-run. –The mean of a RV is analogous to the mean of a large population.
CSC 205 Programming II Lecture 22 Carwash Simulation.
Computing Eigen Information for Small Matrices The eigen equation can be rearranged as follows: Ax = x  Ax = I n x  Ax - I n x = 0  (A - I n )x = 0.
軟體實作與計算實驗 1  Binary search  While loop  Root Finding Lecture 6II While Loop.
Continuous Random Variables Lecture 25 Section Mon, Feb 28, 2005.
An Index of Data Size to Extract Decomposable Structures in LAD Hirotaka Ono Mutsunori Yagiura Toshihide Ibaraki (Kyoto University)
Continuous Random Variables Lecture 24 Section Tue, Mar 7, 2006.
Chapter 4 Practice cont.. Practice with nested loops 1.What will be the output of the following program segment: 1.for (int i = 1; i
Computer Simulation Lab Electrical and Computer Engineering Department SUNY – New Paltz SUNY-New Paltz “Lecture 2”
HMM - Part 2 The EM algorithm Continuous density HMM.
CS Statistical Machine learning Lecture 24
6.094 Introduction to programming in MATLAB Danilo Šćepanović IAP 2008 Lecture 3 : Solving Equations and Curve Fitting.
Prototype Classification Methods Fu Chang Institute of Information Science Academia Sinica ext. 1819
Computation for Physics 計算物理概論 Introduction to NumPy and SciPy.
Continuous Random Variables Lecture 22 Section Mon, Feb 25, 2008.
An Index of Data Size to Extract Decomposable Structures in LAD Hirotaka Ono Mutsunori Yagiura Toshihide Ibaraki (Kyoto Univ.)
軟體實作與計算實驗 1  While-loop flow chart  Decimal to binary representations Lecture 6 While-Loop programming.
軟體實驗 Perfect Number Enumerating 虞台文. Perfect Numbers A perfect number is such that it is equal to the sum of its proper divisors, which are any divisors.
1 Probability and Statistical Inference (9th Edition) Chapter 5 (Part 2/2) Distributions of Functions of Random Variables November 25, 2015.
Integer Programming, Branch & Bound Method
Real # System VariablesFunctions One Variable Linear Equations Inequalities & Absolute Value.
軟體實驗:實作以二分法開根號 虞台文. The Lab Problem Write a function to compute by bisection the square root of a positive integer n given by the caller. The function’s.
Continuous Random Variables Lecture 24 Section Tue, Oct 18, 2005.
軟體實作與計算實驗 1  While loop  Positive integer square root  Decimal to binary transition Lecture 6 While Loop.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 2 - Chapter 7 Optimization.
Module 9.4 Random Numbers from Various Distributions -MC requires the use of unbiased random numbers.
Chapter 5 Integrals 5.2 The Definite Integral
University of Colorado Boulder APPM 4380 October 10th, 2016
Probability Theory and Parameter Estimation I
Chapter 3 Arrays and Vectors
Markov Chains Mixing Times Lecture 5
A system of nonlinear equations
3.1 Expectation Expectation Example
Integer Linear Programming
Operational Research (OR)
Continuous Random Variables
Continuous Random Variables
Lecture 20 Linear Program Duality
Biointelligence Laboratory, Seoul National University
Part 4 - Chapter 13.
Day 5  Happy Friday!!.
Random Variables A random variable is a rule that assigns exactly one value to each point in a sample space for an experiment. A random variable can be.
CS723 - Probability and Stochastic Processes
Continuous Random Variables
Presentation transcript:

軟體實作與計算實驗 1  Roots of nonlinear functions  Nested FOR loops Lecture 5II

軟體實作與計算實驗 2 Nonlinear system

軟體實作與計算實驗 3 A set of nonlinear functions

軟體實作與計算實驗 4 function F = myfun(x) F(1) = x(1).^2 + x(2)^2-4; F(2) = x(1) - x(2); return Function evaluation

軟體實作與計算實驗 5 x=linspace(-2,2); plot(x,x); hold on; plot(x,sqrt(4-x.^2)) plot(x,-sqrt(4-x.^2))

軟體實作與計算實驗 6 Least square of nonlinear functions

軟體實作與計算實驗 7 x0= ones(1,2)*2; x = Find a zero y=myfun(x); sum(y.^2) CHECKING

軟體實作與計算實驗 8 Multiple roots x0= ones(1,2)*2; x = v=[v;x]; plot(x(1),x(2),'o'); v=[] for i=1:n demo_lsq.m

軟體實作與計算實驗 9

10 function F = myfun2(x) F(1) = 2*x(1).^2 + x(2)^2-24; F(2) = x(1).^2 - x(2).^2+12; return Function evaluation

軟體實作與計算實驗 11 x0= ones(1,2)*2; x = Find a zero y=myfun2(x); sum(y.^2) CHECKING

軟體實作與計算實驗 12 Multiple roots x0= ones(1,2)*2; x = v=[v;x]; plot(x(1),x(2),'o'); v=[] for i=1:n

軟體實作與計算實驗 13 x=linspace(-5,5); plot(x,sqrt(24-2*x.^2),'r');hold on; plot(x,-sqrt(24-2*x.^2),'r') plot(x,sqrt(12+x.^2),'b') plot(x,-sqrt(12+x.^2),'b')

軟體實作與計算實驗 14 Demo_lsq_2c source code

軟體實作與計算實驗 15

軟體實作與計算實驗 16 function F = myfun3(x) F(1) = x(1).^2 -2* x(2)^2-2; F(2) = x(1).*x(2) -2; return Function evaluation

軟體實作與計算實驗 17 x=linspace(-3,3); x=x(find(abs(x) > 0.1)); plot(x,sqrt((x.^2-2)/2),'r');hold on; plot(x,-sqrt((x.^2-2)/),'r') x=linspace(0.5,3); plot(x,2./x,'b'); x=linspace(-0.5,-3); plot(x,2./x,'b')

軟體實作與計算實驗 18 x0= ones(1,2)*2; x = Find a zero y=myfun3(x); sum(y.^2) CHECKING

軟體實作與計算實驗 19 Multiple roots x0= ones(1,2)*2; x = v=[v;x]; plot(x(1),x(2),'o'); v=[] for i=1:n

軟體實作與計算實驗 20 demo_lsq_hyperbola.txt two_hyperbola.txt

軟體實作與計算實驗 21 Matrix Multiplication C=A*B C(i,j)=A(i,:) *B(:,j) for all i,j

軟體實作與計算實驗 22 Nested FOR Loops C(i,j)=A(i,:) *B(:,j) [n,d1]=size(A);[d2,m]=size(B) for i=1:n for j=1:m

軟體實作與計算實驗 23 [n,d1]=size(A);[d2,m]=size(B); for i=1:n for j=1:m C(i,j)=A(i, :) *B(:,j); end

軟體實作與計算實驗 24 Constrained optimization Inequality constraint Nonlinear equality

軟體實作與計算實驗 25 Constrained optimization

軟體實作與計算實驗 26 Constraints Lower bound and upper bound Equality constraint Inequality constraint

軟體實作與計算實驗 27 Constraints Lower bound Upper bound Inequality constraints

軟體實作與計算實驗 28 Demo_conop2 function demo_conop2() lb =[-2 0]; ub =[10,10]; Aeq=[-1 1];beq=[0]; A=[];b=[]; x = 1],A,b,Aeq,beq,lb,ub) x(1).^2+x(2).^2 return function y = fun(x) y = (x(1).^2+x(2).^2-13).^2; return demo_conop2.m

軟體實作與計算實驗 29 function y = fun(x) y = (x(1).^2+x(2).^2-13).^2; return Objective function

軟體實作與計算實驗 30 Calling fmincon x = 1],A,b,Aeq,beq,lb,ub) objective function initial guess linear equality inequality Lower and upper bound

軟體實作與計算實驗 31 Random variable Sample space S={A,T,C,G} X is a discrete random variable with sample space S.

軟體實作與計算實驗 32 Generative model papa ptpt pcpc pgpg A TCG Flip-flop gatcacaggt

軟體實作與計算實驗 33 Partition 0 1 Knots partition [0,1] into four intervals respectively with lengths,

軟體實作與計算實驗 34 r=rand; Tag= (r c(1))+3*(r c(2))+4*(r c(3)) switch Tag case 1 s=[s 'A']; case 2 s=[s 'T']; case 3 s=[s 'C']; case 4 s=[s 'G']; end

軟體實作與計算實驗 35 Sequence generation Emulation of a generative model for creation of an atcg sequence

軟體實作與計算實驗 36 FOR Loops r=rand; switch r … end input p,m n=length(p) p_sum=0;s=[]; for i=1:n for j=1:m p_sum=p_sum+p(i); c(i)=p_sum;

軟體實作與計算實驗 37 Mixture model papa ptpt pcpc pgpg A TCG Flip-flop papa ptpt pcpc pgpg A TCG

軟體實作與計算實驗 38 Mixture model According to probabilities, and each time one of two joined models is selected to generate a character Created characters are collected to form an atcg sequence

軟體實作與計算實驗 39 Hidden Markov model 12 papa ptpt pcpc pgpg A TCG papa ptpt pcpc pgpg A TCG

軟體實作與計算實驗 40 Transition probability