發表文章

郭翊晨單一網頁javascrip圖動態呈現債卷價格與利率關係

債券價格與利率關係動態圖表 📉 債券價格 vs. 市場利率 核心概念: 債券價格與市場利率呈 反向變動 。當市場利率上升,折現率變大,固定票面利率的舊債券吸引力下降,價格隨之下跌。 調整市場利率 (Current Rate): 5.0% 債券剩餘年期 (Years to Maturity): 10 年

郭翊晨Python執行IRR

圖片
遷入郭翊晨解說影片 嵌入WIKIPEDIA二分法 pmt = [0,0,0,0] #郭翊晨程式設計586設定串列list pmt[0]=float(input('躉繳金額: ')) for nper in range(1,4): pmt[nper] = float(input('第'+str(nper)+'期回收: ')) def npv(rate): y = - pmt[0] for j in range(1,4): y = y + pmt[j]/(1+rate)**j return y a, b, gap, f = 0.0, 1.0, 9.0, 9.0 maxerror = 0.000001 loopNumber = 1 while (gap > maxerror and abs(f) > maxerror and loopNumber maxerror and gap > maxerror): if ( f>0 ): a = c else: b = c gap = b-a; print('報酬率: ', c) print('淨現值: ', f) print('迴圈次數: ', loopNumber)

郭翊晨二分法求內部報酬率

head/head, body/body畫蛇添足,可拿掉,因為部落格架構已經下這些命令 躉繳 第1期 第2期 第3期 注意,包含首期躉繳的現金流量都大於0。 輸出: 報酬率: 淨現值: 迴圈次數: 郭翊晨學習程式設計程式碼如下

郭翊晨python繪製三角函數與powerpoint製作影片

from tkinter import * #或者import tkinter as tk import math tk = Tk() #建構視窗名為tk tk.geometry('1200x400')#視窗 寬1200像素 tk.title("劉任昌python tkinter三角函數") canvas = Canvas(tk, width=1200, height=400, bg='black') canvas.grid(row=0,column=0,padx=5,pady=5,columnspan=3) delay=10 # milliseconds, 1/1000秒 x1,y1,z1=0,200,10#python特徵,多變數=對等值 h=190 #上下範圍,相當於數學1到-1 L1=canvas.create_line(0,200,1200,200,fill='white',width=5) def LH(): global x1, y1, z1#global全球,local當地 x2 = x1 + 1 #換到下個+1 y2=200 - h*math.sin(0.02*x2) z2=200 - h*math.cos(0.02*x2) L1=canvas.create_line(x1,y1,x2,y2,fill='pink',width=10) L2=canvas.create_line(x1,z1,x2,z2,fill='green',width=10) if (x2

Javascript函數sin,cos與canvas.font

圖片
Javascript在網頁就可以執行不需要開啟Spyder sin執行 cos執行 橫軸

Javascript函數sin,cos與canvas.font

Javascript在網頁就可以執行不需要開啟Spyder sin執行 cos執行 橫軸