跪求数学大神程伟

跪求数学大神!!!_数学吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:435,037贴子:
跪求数学大神!!!收藏
本人高一萌妹纸一名~0.0其他科目还可以,唯有数学是我心中深刻的痛啊!!!跪求数学大神,帮忙辅导数学【首先说明我比较笨,问的问题有时会比较白痴】跪求啊!!大神,你在哪!!!还求学习方法0.0各种求!
登录百度帐号推荐应用跪求数学大神,欧拉法求二元二阶非线性微分... | 问答 | 问答 | 果壳网 科技有意思
跪求数学大神,欧拉法求二元二阶非线性微分方程组近似解。
做毕设遭遇节拍器同步问题,
+ 加入我的果篮
其实,不用欧拉法就可以看出,这个方程的解是……LZ你是不是要检查一下方程或者是初始条件……不管怎么样,把python代码贴出来吧:# ============
# Updated 5_23
# ============
import math
import numpy as np
import matplotlib.pyplot as plt
def forward_Euler(BETA, DELTA, THETA_0, MU, theta_1_0, theta_2_0,
epsilon=0.01, total_time=100):
Runs a forward Euler simulation of the ODE with parameters BETA, DELTA,
THETA_0 and MU.
Returns 3 one-dimensional arrays: theta_1, theta_2 and time
epsilon: time interval between two consecutive steps
total_time: the duration of the simulation
def calc_theta_double_prime(theta_1, theta_2,
theta_1_prime, theta_2_prime):
I separated the formula into four parts (P, A, B, C) to
avoid typing too long an equation.
P = -1.0/(1 + BETA*math.cos(theta_1)**2)
A_1 = (1 + DELTA)*math.sin(theta_1)
A_2 = (1 + DELTA)*math.sin(theta_2)
B_1 = (MU/THETA_0**2)*(theta_1**2 - THETA_0**2)*theta_1_prime
B_2 = (MU/THETA_0**2)*(theta_2**2 - THETA_0**2)*theta_2_prime
C_1 = BETA*(math.cos(theta_1)*math.sin(theta_1)*theta_1_prime**2 +
math.cos(theta_1)*math.sin(theta_2)*theta_2_prime**2)
C_2 = BETA*(math.cos(theta_2)*math.sin(theta_1)*theta_1_prime**2 +
math.cos(theta_2)*math.sin(theta_2)*theta_2_prime**2)
theta_1_double_prime = P*(A_1 + B_1 + C_1)
theta_2_double_prime = P*(A_2 + B_2 + C_2)
return theta_1_double_prime, theta_2_double_prime
# Initialize data structure with given initial conditions
total_steps = int(total_time / epsilon)
time = np.arange(0, epsilon*(total_steps + 1), epsilon)
theta_1 = np.zeros(total_steps + 1)
theta_2 = np.zeros(total_steps + 1)
theta_1[0] = theta_1_0
theta_2[0] = theta_2_0
theta_1_prime = np.zeros(total_steps + 1)
theta_2_prime = np.zeros(total_steps + 1)
# Carry out the simulation, using forward Euler method
for step in xrange(total_steps):
theta_1_double_prime, theta_2_double_prime = \
calc_theta_double_prime(theta_1[step], theta_2[step],
theta_1_prime[step], theta_2_prime[step])
theta_1[step + 1] = theta_1[step] + theta_1_prime[step]*epsilon
theta_2[step + 1] = theta_2[step] + theta_2_prime[step]*epsilon
theta_1_prime[step + 1] = theta_1_prime[step] + \
theta_1_double_prime*epsilon
theta_2_prime[step + 1] = theta_2_prime[step] + \
theta_2_double_prime*epsilon
return theta_1, theta_2, time
def plot_Euler(BETA, DELTA, THETA_0, MU, theta_1_0, theta_2_0):
'''Plot the results'''
theta_1, theta_2, time = forward_Euler(BETA, DELTA, THETA_0, MU,
theta_1_0, theta_2_0)
plt.plot(time, theta_1, '-r', label=r'$\theta_1$')
plt.plot(time, theta_2, '--g', label=r'$\theta_1$')
plt.xlabel(r'time(second)')
plt.ylabel(r'$\theta$(rad)')
plt.title('BETA = {:.3f}, DELTA = {:.3f}, MU = {:.3f}, THETA_0 = {:.3f}\n'
'Initial condition: theta_1 = {:.3f}, theta_2 = {:.3f}'.format(BETA,
DELTA, MU, THETA_0, theta_1_0, theta_2_0))
plt.legend()
def all_random_plot(seed=None):
BETA, DELTA, THETA_0, MU & initial theta_1, theta_2_0 chosen randomly
import random
if seed is not None:
random.seed(seed)
plot_Euler(random.random(), random.random(), random.random(),
random.random(), random.uniform(-math.pi/4, math.pi/4),
random.uniform(-math.pi/4, math.pi/4))
if __name__ == '__main__':
for i in range(10):
plt.figure(i)
all_random_plot()
plt.show()
plt.close()matlab 的函数名和numpy/matplotlib基本还是对应的(虽然语法差异还是有一点的),我大致跟你讲讲应该能听得懂:几个def都是函数定义。第一个forward_Euler是数值模拟核心,其实就是建立了theta_1, theta_2, time这三个数组,然后按照欧拉法(其实欧拉法有很多种,中文里好像就是指的最简单的Foward Euler)公式逐个递推(辅助函数calc_theta_double_prime其实就是Z''的显式表达)。plot_Euler接收forward_Euler计算而得的数组进行作图all_random_plot随机地为参数和初始条件赋值(各参数都是(0, 1),初值是(-pi/4, pi/4)贴一些实验结果的图:觉得LZ应该是关心正弦稳态解吧……确实大部分都达到了稳态,不过的确有一小部分很混乱。这个……由于参数实在太多了,建议LZ还是自己动手,丰衣足食吧。
后回答问题,你也可以用以下帐号直接登录
(C)2017果壳网&&&&京ICP证100430号&&&&京网文[-239号&&&&新出发京零字东150005号&&&&
违法和不良信息举报邮箱:&&&&举报电话:跪求数学大神解题,算出图中X的角!求详细步骤
14-08-22 &
数理 情感 IT 互联网
这个题要做辅助线,先证明等腰三角形CAB上各点的隐含关系,不太容易做出来。下面网上高手的解题方法,请参考: 来源:http://zhidao.baidu.com/link?url=PXf57O93vWo_-6vut6WyRREm4WWoceDqk781CgAdvnEK6s7ND8gp-rgeK7HWfYSkyS2wlJO-rMvYAmNBWewrmK
请登录后再发表评论!(嗨,我是青仔)
(free&easy)
第三方登录:

我要回帖

更多关于 数学大神 的文章

 

随机推荐