2026年4月9日 星期四

EX#7 Mathematical Optimization

 課堂練習 

Deadline:  Next Saturday at 23:59 (one more week)

Send all the share links to  me chang212@gmail.com by email with subject EX#7 [your id, your name]

Optimization in Hyperspace — Homework Assignments

md version

Based on the "Optimization in Hyperspace" artifact — which visualizes how algorithms like Gradient Descent, Nelder-Mead, A* Search, Simulated Annealing, and Global Optimization navigate a 3D fitness landscape full of local peaks and valleys — here are 3 homework assignments at different levels:


Homework Assignment 1 — Conceptual Understanding

Title: Reading the Fitness Landscape

Objective: Connect visual intuition to algorithmic concepts.

Instructions: Using the "Optimization in Hyperspace" visualizer, observe how each of the five algorithms (Gradient Descent, Nelder-Mead, A* Search, Simulated Annealing, and Global Optimization) moves across the 3D fitness landscape. Then write a 1–2 page reflection answering the following:

  1. Describe the fitness landscape in your own words. What do the peaks represent? What do the valleys represent? In a real optimization problem, what might each correspond to?
  2. Which algorithms appear to get "stuck" at a local optimum (a smaller peak that is not the tallest)? Explain why this happens based on how those algorithms work.
  3. Which algorithms eventually find the global optimum (the tallest peak)? What property of those algorithms allows them to escape local optima?
  4. Define the exploration vs. exploitation trade-off in optimization. For each algorithm in the visualizer, classify it as leaning toward exploration, exploitation, or a balance of both — and justify your answer in one sentence each.

Deliverable: Written reflection (300–500 words), submitted as a PDF.


Homework Assignment 2 — Mathematical Analysis

Title: Gradient Descent in Your Own Hands

Objective: Implement and analyze gradient descent on a multimodal function.

Instructions: Consider the 2D function:

f(x,y)=sin(x)cos(y)+0.1(x2+y2)f(x, y) 

This function has multiple local maxima and minima, similar to the landscape in the visualizer.

  1. Plot the function surface over the domain x[5,5]x \in [-5, 5] y[5,5]y \in [-5, 5]  using Python (matplotlib) or any tool of your choice.
  2. Implement gradient descent (minimization) from scratch using the update rule:
xt+1=xtαf(xt,yt)

Test at least three different starting points and three different learning rates (α=0.01,0.1,0.5\alpha = 0.01, 0.1, 0.5 ).

  1. Record for each run: the starting point, the final converged point, the function value at convergence, and whether it found a global or local minimum.
  2. Answer: How does the choice of starting point affect which minimum is found? Relate this back to what you observed in the 3D visualizer — why is gradient descent susceptible to the landscape's topology?

Deliverable: Code + a short written report (1 page) comparing your runs and drawing conclusions.





Homework Assignment 3 — Comparative Algorithm Design

Title: When Does Simulated Annealing Beat Gradient Descent?

Objective: Empirically compare a local vs. global optimization strategy.

Instructions: Using Python (or pseudocode + written analysis), design an experiment that compares Gradient Descent and Simulated Annealing on a fitness landscape of your choice (you may use the function from HW2 or define your own multimodal function with at least 3 local optima).

  1. Implement both algorithms. For Simulated Annealing, use an exponential cooling schedule:
T(t)=T0γtT(t) = T_0 \cdot \gamma^t

where T0T_0  is the initial temperature and γ(0,1)\gamma \in (0,1)  is the cooling rate.

  1. Run each algorithm 50 times from random starting points uniformly sampled from the domain. Record what fraction of runs find the global optimum for each algorithm.
  2. Vary the SA temperature schedule — test at least two values each for T0T_0  (high vs. low initial temperature) and γ\gamma  (fast vs. slow cooling). How does the temperature schedule affect the balance between exploration and exploitation? Which setting performs best?
  3. Create a summary table and at least one plot (e.g., success rate vs. cooling rate) comparing the algorithms.
  4. Conclude: In what problem scenarios would you recommend Simulated Annealing over Gradient Descent? Are there situations where the reverse is true? Use your results as evidence.

Deliverable: Code + a 1–2 page written analysis with your table and plot included.





These three assignments build progressively — from conceptual understanding, to mathematical implementation, to comparative experimental design — directly grounded in what the "Optimization in Hyperspace" visualizer demonstrates. 

HW#7 Analog IC Design

 

課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject HW#6 [your id, your name]

任選1題



1  (a) A BJT Differential Pair IC Die  (share) is incorrectly designed. Fix the die. 

(b) Make a schematic

(c) Do parameter optimization via SA (simulated annealing)

(d) Placement & Routing for the die

For example you may use Quadratic Placement  & ILP+PathFinder+A* Routing














2. Design 2-stage diff pair (share from very simple diff pair)

(a)  Make a schematic,  

(b) Draw a  silicon die, considering Miller Compensation

(c) Do P&R (Placement & Routing) for the IC
See example of  P&R+opt compo

2026年4月6日 星期一

HW#6 PLL

 本次習題基本說明

進階說明


 1. (a) Build a 9.0 GHz 65 nm Fractional-N PLL Synthesizer with NM Optimization 


(b)  Cross check your PLL  by MNA

Hint: What is NM method? NM Algo


2.

(a) Build Apple C1 ADPLL — 7.0 GHz (spec) with A* optimization, TSMC N7

Apple C1 ADPLL — 7.0 GHz  





EX#6 A* Scheduling

本次習題基本說明

進階說明


     Handouts


Comparison of LLMs
Claude Opus 4.6 optimal (visualizing how AI thinks)
Gemini 3.0 Pro 推理,optimal
ChatGPT 5, end results 流程圖  feasible, not optimal,

課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject EX#6 [your id, your name]



 1. 搶救感恩節晚餐大作戰講義 題目 使用AI推理或用程式計算出最佳計畫, 然後將求解過程視覺化


推理視覺化(動畫)

style 1


style 2



A* 搜尋樹狀圖(動畫)

style 1


style 2



2. 搶救感恩節晚餐大作戰講義 題目 使用AI推理或用程式計算出最佳計畫, 然後將得出結果視覺化



狀態圖(State Diagram) 









state diagram with aligned timeline





看板圖 (Kanban)


 (interactive timeline)




流程圖(Flow chart)




timed flowchart with interactive timeline (share)




2026年3月27日 星期五

HW#5 LNA Optimization and PLL Design

1, 2 任選一題

3,4 任選一題


1. Make a GD/(A*)+MNA Optimizer on a Apple C1 LNA Die

Hint: artifactshare


DE+MNA Optimizer on Die artifact


2. To achieve the 15-20 dB gain target and improve the LNA performance to match the schematic specs, use Differential Evolution Optimization to optimize the LNA performance.
Must verify your results to meet spec and parameters have to be realistic.

Hint: (DE+MNA Optimizer on Die artifact



3. (a) Build a 9.0 GHz 65 nm Fractional-N PLL Synthesizer with NM Optimization 


Hint: What is NM method? NM Algo


4.

(a) Build Apple C1 ADPLL — 7.0 GHz (spec) with A* optimization, TSMC N7

Apple C1 ADPLL — 7.0 GHz  





EX#5

   Handouts


Comparison of LLMs
Claude Opus 4.6 optimal (visualizing how AI thinks)
Gemini 3.0 Pro 推理,optimal
ChatGPT 5, end results 流程圖  feasible, not optimal,

  課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject EX#5 [your id, your name]

1,2 任選1

3,4 任選1


1. 
Design a Two-Stage BJT Amplifier according to goals specified using A* (Parameters to optimize RE1, RC1. RE2. RC2) 




2. Optimize LM3886 class AB audio amplifier IC using A* (Parameters to optimize: resistors except the load) 



the architecture inside the LM3886 and TDA7293
optimizer A* (share)


3. 搶救感恩節晚餐大作戰講義 題目 使用AI推理或用程式計算出最佳計畫, 然後將求解過程視覺化


推理視覺化(動畫)

style 1


style 2



A* 搜尋樹狀圖(動畫)

style 1


style 2



4. 搶救感恩節晚餐大作戰講義 題目 使用AI推理或用程式計算出最佳計畫, 然後將得出結果視覺化



狀態圖(State Diagram) 









state diagram with aligned timeline





看板圖 (Kanban)


 (interactive timeline)




流程圖(Flow chart)




timed flowchart with interactive timeline (share)




2026年3月17日 星期二

HW#4 RF IC Design

  

建議工具

使用 Claude Sonnet 4.6 推理模式(手動切換,免費用戶額定時間內只能使用三次)

使用 ChatGPT 5 推理模式(自動切換)

使用 Gemini 3.0 Pro 免費額度最高 1M tokens (永遠推理模式)

使用 Grok 4 推理模式(自動切換)



How to publish a Claude artifact

How to share a ChatGPT link

How to share a Grok link

How to share Gemini Link


Content share 作業繳交格式

  • share only link, pure text, markdown (md)
  • no attachments accepted, no html, screen dump, or png
  • non-compliant homework will be rejected and returned to you


課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject HW#4  [your id, your name]


3/10 只要做第一題(內有5小題)


Study Apple C1 Architecture

1. (a) On Claude, Run NGSpice for the LNA using given parameters. If the results do not match, explain why.

(b) Run an MNA simulation (Modified Nodal Analysis, as used in Cadence Spectre engine)

 

Optimized parameters (share)


MNA simulation


(c)  Perform DRC (Design Rule Check) for the  3.5 GHz LNA. If it is not entirely design rule compliant, redesign to make the layout more DRC driven.







(DRC, share) (DRC-driven, artifact)




2. (a) Run the Simplified LNA optimizer on Die, 3.5 GHz LNA TSMC N7. Use MNA (Modified Nodal Analysis, as used in Cadence Spectre engine)  to optimize again. Must verify your results to meet spec and parameters have to be realistic.

Hint: (GD/(A*)+MNA Optimizer on Die artifactshare)


DE+MNA Optimizer on Die artifact


(b) To achieve the 15-20 dB gain target and improve the LNA performance to match the schematic specs, use Differential Evolution Optimization to optimize the LNA performance.
Must verify your results to meet spec and parameters have to be realistic.

Hint: (DE+MNA Optimizer on Die artifact


3. (a) Build a 9.0 GHz Fractional-N PLL Synthesizer: 9.0 GHz PLL with A* Optimization, (share) 65 nm
(b) Build a 9.0 GHz Fractional-N PLL Synthesizer with NM Optimization

(c) Build Apple C1 ADPLL — 7.0 GHz (spec) with A* optimization, TSMC N7

Apple C1 ADPLL — 7.0 GHz  


(d) Build Apple C1 ADPLL with NM Optimization

Hint: What is NM method? NM Algo

2026年3月12日 星期四

EX#4 Search and Visualizaiion

  Handouts

Chain of Thought with Example, Make your AI powerful

Constraints,  Visualization on energy landscape

Search Algorithms: A*, BFS, Dijkstra

River Puzzles  (Pz 2Pz 20) by Chain of Thought vs. Search Algortihms

BFS/A* Scalability: 8 vs. 20 persons

  課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject EX#4  [your id, your name]

1.   

Solve Pz 2  by A*/BFS

Animate search tree with synced progression (A*/BFS side-by-side)

 2. 

Solve Pz 20 by  A*/BFS 

Animate search tree with synced progression (A*/BFS side-by-side)


3.  Solve Dog Ball Retrieval by A*/BFS 

Animate search tree with synced progression (A*/BFS side-by-side)


2026年3月10日 星期二

EX#3

 

  課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject HW#3  [your id, your name]


1.   

Solve Pz 2 using chain of thought (CoT) reasoning with each step whether correct or incorrect, showing backtracking. 

Animate the CoT process in the above synced with river crossing scenarios.  

Animate search tree with synced progression (A*/BFS side-by-side)

 2. 

Solve Pz 20 using chain of thought (CoT) reasoning with each step whether correct or incorrect, showing backtracking. 

Animate the CoT process in the above synced with river crossing scenarios.  

Animate search tree with synced progression (A*/BFS side-by-side)

2026年3月6日 星期五

HW#3

 

建議工具

使用 Claude Sonnet 4.6 推理模式(手動切換,免費用戶額定時間內只能使用三次)

使用 ChatGPT 5 推理模式(自動切換)

使用 Gemini 3.0 Pro 免費額度最高 1M tokens (永遠推理模式)

使用 Grok 4 推理模式(自動切換)



How to publish a Claude artifact

How to share a ChatGPT link

How to share a Grok link

How to share Gemini Link


Content share 作業繳交格式

  • share only link, pure text, markdown (md)
  • no attachments accepted, no html, screen dump, or png
  • non-compliant homework will be rejected and returned to you


課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject HW#3  [your id, your name]


1. (a) Run NGSpice for the LNA using given parameters. If the results do not match, explain why.

(b) Run an MNA simulation (Modified Nodal Analysis, as used in Cadence Spectre engine)

 

Optimized parameters (share)


MNA simulation

2. Perform DRC (Design Rule Check) for the  3.5 GHz LNA. If it is not entirely design rule compliant, redesign to make the layout more DRC driven.







(DRC, share) (DRC-driven, share)




3. (a) Run the Simplified LNA optimizer on Die, 3.5 GHz LNA TSMC N7. Use MNA (Modified Nodal Analysis, as used in Cadence Spectre engine)  to optimize again. 

Hint: (GD/(A*)+MNA Optimizer on Die artifactshare)


DE+MNA Optimizer on Die artifact


(b) To achieve the 15-20 dB gain target and improve the LNA performance to match the schematic specs, use Differential Evolution Optimization to optimize the LNA performance.

Hint: (DE+MNA Optimizer on Die artifact

2026年3月1日 星期日

HW#2

 Send all the share links to  me chang212@gmail.com by email with subject HW#2  [your id, your name]


1.   

Solve Pz 2 using chain of thought (CoT) reasoning with each step whether correct or incorrect, showing backtracking. 

Animate the CoT process in the above synced with river crossing scenarios.  

Animate search tree with synced progression (A*/BFS side-by-side)

 2. 

Solve Pz 20 using chain of thought (CoT) reasoning with each step whether correct or incorrect, showing backtracking. 

Animate the CoT process in the above synced with river crossing scenarios.  

Animate search tree with synced progression (A*/BFS side-by-side)

2026年2月25日 星期三

EX#2

   AI for solving amplifier electronics (課堂講義)


 建議工具

使用 Claude Sonnet 4.6

使用 ChatGPT 5

使用 Gemini 3 Pro 免費額度最高 1M tokens

使用 Grok 4


Content share

  • share only link, pure text, markdown (md)
  • no attachments accepted, no html, screen dump, or png
  • non-compliant homework will be rejected and returned to you


 課堂練習 

Deadline: This Saturday at 23:59

Send all the share links to  me chang212@gmail.com by email with subject EX#2  [your id, your name]

How to publish a Claude artifact

How to share a ChatGPT link

How to share a Grok link

How to share Gemini Link


任選做二題


1. Make the Bode plot of Circuit in Example 1, as below You must verify the results for correctness.

The results must be scientifically accurate.



Topology B in Schematic


2.  Lab Activity: Amplifier Gain & Frequency Response Using AI-Assisted Analysis 







3. With the following circuit and its Bode plot


textbook approximations








Think about the prompt used to generate the Bode plot. Why there is level off at high frequencies?


4. Comparing LLMs: Claude 4.6, Gemini 3.0 Pro, ChatGPT 5.0 (三選二) for the following task.

Animate in 3d (in three.js) Yagi-Uda Antenna, AI pipe inspector, or things you choose. (擇一)

The animation must be scientifically accurate


Hints

  • Reasoning/Think/Extended Thinking Mode of the AI platform you use may be required for all the problems here

不是主修電子工程的同學,可以練習以下問題




share Claude

 




Claude man in the loop
Gemini 2.5 Pro got it right twice in a row