hyfm.net
当前位置:首页 >> mAtlAB求常数A,B,C,使得∫(sin(x^2)%A%Bx%Cx^2)^2 最小。积分区间是(... >>

mAtlAB求常数A,B,C,使得∫(sin(x^2)%A%Bx%Cx^2)^2 最小。积分区间是(...

使用matlab的极小值函数fminsearch()即可,参考代码及结果:>> f = @(a) quad(@(x)(sin(x.^2)-a(1)-a(2)*x-a(3)*x.^2).^2,0,pi/2);>> fminsearch(f,[0,0,0])ans = -0.2139 1.3433 -0.3817表明A=-0.2139,B= 1.3433,C= -0.3817时满足要求

>>syms a b c d>>result=int('a*x+sin(b*x)','x','c','d')%从c积分到dresult =-1/2*(-a*d^2*b+2*cos(b*d)+a*c^2*b-2*cos(b*c))/b>> int('a*x+sin(b*x)','x','d','c')ans =1/2*(-a*d^2*b+2*cos(b*d)+a*c^2*b-2*cos(b*c))/b

使用matlab的极小值函数fminsearch()即可,参考代码及结果:>> f = @(a) quad(@(x)(sin(x.^2)-a(1)-a(2)*x-a(3)*x.^2).^2,0,pi/2);>> fminsearch(f,[0,0,0])ans = -0.2139 1.3433 -0.3817表明A=-0.2139,B= 1.3433,C= -0.3817时满足要求

>> a=1;>> b=4;>> x=(a^2+b^2)^1/2x = 8.5000>> syms t>> y=abs(1+4*t)log10(3)+sin(2*x+5)/log(a^2+b^2)(exp(1)^-x=2*x^3)^1/2

syms x a b%%%%把字母定义成字符 int(log(a^2*(sin(x))^2*(cos(x))^2),x,0,pi/2) %%%%求定积分,int(积分函数,积分变量,积分下线,积分上线)

在主窗口中输入:edit回车后,在edit中直接输入:p1=3.169; p2=3.2042; p3=3.5601;a=p1^(-2);b=p2^(-2);c=p3^(-2);B=-(sin(x))^2*(cos(y))^2*(b+c)-(sin(x))^2*(sin(y))^2(a+c)-(cosx)^2(a+

clear;clc;f=@(x,a,b)(sin(x)-a-b.*x).^2;g=@(p)quadl(@(x)f(x,p(1),p(2)),0,pi);fminunc(g,[1 1])

试试:clear all;clc;syms xf1=sin(sqrt(x)+1)/sqrt(x);f2=x*atan(x);J1=int(f1,x);J2=int(f2,x);

syms x y; %定义两个符号变量 a=int(int(x^y,x,0,1),y,1,2) %积分 b=simple(a) %化简 c=vpa(b,4) %得到4位近似解,也可以任意N位解

相关文档
网站首页 | 网站地图
All rights reserved Powered by www.hyfm.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com