24小时热门版块排行榜    

CyRhmU.jpeg
查看: 1312  |  回复: 11

nqf1987

新虫 (初入文坛)

[求助] 初学matlab 求解方程 大家帮帮忙啊。。。

求解 方程 0.022*ρ^2*(sin(θ))^2+x*cos(θ)-25.63=0   
其中θ=0*pi/180:1*pi/180:90*pi/180   
求出各个θ所对应的ρ值。
大家帮帮忙啦。。非常感谢。。。
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖置顶 ( 共有2个 )

dingd

铁杆木虫 (职业作家)

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
nqf1987: 金币+20, ★★★★★最佳答案 2012-03-28 15:36:39
nqf1987: 回帖置顶 2012-03-28 15:38:22
xzhdty: 金币+2, 欢迎常来 2012-03-28 19:32:40
用1stOpt求解:
CODE:
LoopConstant b=[0*pi/180:1*pi/180:90*pi/180];
PlotLoopData b[x],p;
ParameterDomain = [0,];
Function 0.022*p^2*(sin(b))^2+p*cos(b)-25.63=0;

循环常数 b        p
0        25.63
0.0174532925199433        25.6295018661051
0.0349065850398866        25.6280127761908
0.0523598775598299        25.6255486229214
0.0698131700797732        25.6221357527257
0.0872664625997165        25.6178107565949
0.10471975511966        25.6126201827428
0.122173047639603        25.606620176457
0.139626340159546        25.5998760537113
0.15707963267949        25.5924618161425
0.174532925199433        25.5844596158156
0.191986217719376        25.5759591787806
0.20943951023932        25.5670571967639
0.226892802759263        25.5578566964412
0.244346095279206        25.5484663956185
0.261799387799149        25.5390000553237
0.279252680319093        25.5295758363094
0.296705972839036        25.5203156678193
0.314159265358979        25.5113446357032
0.331612557878923        25.502790396119
0.349065850398866        25.4947826201588
0.366519142918809        25.4874524738165
0.383972435438753        25.4809321367966
0.401425727958696        25.4753543627818
0.418879020478639        25.4708520829346
0.436332312998583        25.4675580536368
0.453785605518526        25.4656045487722
0.471238898038469        25.465123096236
0.488692190558413        25.4662442578285
0.506145483078356        25.4690974512392
0.523598775598299        25.47381081247
0.541052068118242        25.480511096763
0.558505360638186        25.4893236158928
0.575958653158129        25.5003722095451
0.593411945678072        25.513779248425
0.610865238198016        25.5296656667175
0.628318530717959        25.5481510215412
0.645771823237902        25.5693535770983
0.663225115757846        25.593390411317
0.680678408277789        25.6203775428959
0.698131700797732        25.6504300768
0.715584993317676        25.6836623664044
0.733038285837619        25.7201881906438
0.750491578357562        25.7601209446892
0.767944870877506        25.8035738428435
0.785398163397449        25.8506601325112
0.802851455917392        25.9014933182683
0.820304748437336        25.9561873952148
0.837758040957279        26.0148570909522
0.855211333477222        26.0776181156793
0.872664625997166        26.144587420044
0.890117918517109        26.2158834605277
0.907571211037052        26.2916264722716
0.925024503556996        26.3719387493826
0.942477796076939        26.456944932876
0.959931088596882        26.546772306529
0.977384381116825        26.6415511010328
0.994837673636769        26.7414148069388
1.01229096615671        26.8465004969999
1.02974425867666        26.9569491586134
1.0471975511966        27.0729060371753
1.06465084371654        27.1945209912581
1.08210413623649        27.3219488606291
1.09955742875643        27.4553498482322
1.11701072127637        27.594889917367
1.13446401379632        27.7407412054089
1.15191730631626        27.8930824555365
1.1693705988362        28.0520994680541
1.18682389135615        28.2179855730331
1.20427718387609        28.3909421261319
1.22173047639603        28.5711790296149
1.23918376891598        28.7589152807434
1.25663706143592        28.9543795498974
1.27409035395586        29.1578107909759
1.29154364647581        29.3694588868302
1.30899693899575        29.589585332717
1.32645023151569        29.8184639610052
1.34390352403564        30.0563817106436
1.36135681655558        30.3036394451968
1.37881010907552        30.5605528235889
1.39626340159547        30.8274532280518
1.41371669411541        31.1046887541798
1.43116998663535        31.3926252684319
1.4486232791553        31.691647538906
1.46607657167524        32.0021604457538
1.48352986419518        32.3245902781956
1.50098315671513        32.6593861257564
1.51843644923507        33.0070213720728
1.53588974175501        33.3679953004398
1.55334303427496        33.7428348211578
1.5707963267949        34.1320963317521
5楼2012-03-28 14:56:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

★ ★ ★
nqf1987: 回帖置顶 2012-03-29 17:09:48
余泽成: 金币+3, 谢谢参与应助! 2012-03-30 14:18:13
>> syms p x
>> pp=solve('0.022*p^2*(sin(x))^2+p*cos(x)-25.63=0 ','p')

pp =

-(0.00000000000000000000000000000025*(90909090909090909090909090909091.0*cos(x) - 90909090909090909090909090909091.0*(cos(x)^2 + 2.25544*sin(x)^2)^(1/2)))/sin(x)^2
-(0.00000000000000000000000000000025*(90909090909090909090909090909091.0*cos(x) + 90909090909090909090909090909091.0*(cos(x)^2 + 2.25544*sin(x)^2)^(1/2)))/sin(x)^2

>> x=0*pi/180:1*pi/180:90*pi/180;
>> p1=@(x)eval(pp(1))

p1 =

    @(x)eval(pp(1))

>> pp1=feval(p1,x)

pp1 =

  Columns 1 through 5

       NaN   25.6295   25.6280   25.6255   25.6221

  Columns 6 through 10

   25.6178   25.6126   25.6066   25.5999   25.5925

  Columns 11 through 15

   25.5845   25.5760   25.5671   25.5579   25.5485

  Columns 16 through 20

   25.5390   25.5296   25.5203   25.5113   25.5028

  Columns 21 through 25

   25.4948   25.4875   25.4809   25.4754   25.4709

  Columns 26 through 30

   25.4676   25.4656   25.4651   25.4662   25.4691

  Columns 31 through 35

   25.4738   25.4805   25.4893   25.5004   25.5138

  Columns 36 through 40

   25.5297   25.5482   25.5694   25.5934   25.6204

  Columns 41 through 45

   25.6504   25.6837   25.7202   25.7601   25.8036

  Columns 46 through 50

   25.8507   25.9015   25.9562   26.0149   26.0776

  Columns 51 through 55

   26.1446   26.2159   26.2916   26.3719   26.4569

  Columns 56 through 60

   26.5468   26.6416   26.7414   26.8465   26.9569

  Columns 61 through 65

   27.0729   27.1945   27.3219   27.4553   27.5949

  Columns 66 through 70

   27.7407   27.8931   28.0521   28.2180   28.3909

  Columns 71 through 75

   28.5712   28.7589   28.9544   29.1578   29.3695

  Columns 76 through 80

   29.5896   29.8185   30.0564   30.3036   30.5606

  Columns 81 through 85

   30.8275   31.1047   31.3926   31.6916   32.0022

  Columns 86 through 90

   32.3246   32.6594   33.0070   33.3680   33.7428

  Column 91

   34.1321

>> p2=@(x)eval(pp(2))

p2 =

    @(x)eval(pp(2))

>> pp2=feval(p2,x)

pp2 =

  1.0e+005 *

  Columns 1 through 5

      -Inf   -1.4924   -0.3732   -0.1660   -0.0934

  Columns 6 through 10

   -0.0599   -0.0416   -0.0306   -0.0235   -0.0186

  Columns 11 through 15

   -0.0151   -0.0125   -0.0105   -0.0090   -0.0078

  Columns 16 through 20

   -0.0068   -0.0060   -0.0053   -0.0048   -0.0043

  Columns 21 through 25

   -0.0039   -0.0036   -0.0033   -0.0030   -0.0028

  Columns 26 through 30

   -0.0026   -0.0024   -0.0022   -0.0021   -0.0019

  Columns 31 through 35

   -0.0018   -0.0017   -0.0016   -0.0015   -0.0015

  Columns 36 through 40

   -0.0014   -0.0013   -0.0013   -0.0012   -0.0011

  Columns 41 through 45

   -0.0011   -0.0011   -0.0010   -0.0010   -0.0009

  Columns 46 through 50

   -0.0009   -0.0009   -0.0008   -0.0008   -0.0008

  Columns 51 through 55

   -0.0008   -0.0007   -0.0007   -0.0007   -0.0007

  Columns 56 through 60

   -0.0007   -0.0006   -0.0006   -0.0006   -0.0006

  Columns 61 through 65

   -0.0006   -0.0006   -0.0005   -0.0005   -0.0005

  Columns 66 through 70

   -0.0005   -0.0005   -0.0005   -0.0005   -0.0005

  Columns 71 through 75

   -0.0005   -0.0005   -0.0004   -0.0004   -0.0004

  Columns 76 through 80

   -0.0004   -0.0004   -0.0004   -0.0004   -0.0004

  Columns 81 through 85

   -0.0004   -0.0004   -0.0004   -0.0004   -0.0004

  Columns 86 through 90

   -0.0004   -0.0004   -0.0004   -0.0003   -0.0003

  Column 91

   -0.0003

>>
The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
8楼2012-03-29 16:16:23
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

dingd

铁杆木虫 (职业作家)

【答案】应助回帖


感谢参与,应助指数 +1
余泽成: 金币+1, 谢谢参与应助! 2012-03-30 14:18:21
应该有些范围限制吧?否则三角函数会导致非一一对应现象。
2楼2012-03-28 13:58:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nqf1987

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by dingd at 2012-03-28 13:58:44:
应该有些范围限制吧?否则三角函数会导致非一一对应现象。

非常谢谢你  不知道 限制ρ>0  行不行    给你不给出限制每个θ应该对应两个ρ  
还有就是 我第一次发帖 粗心的呢 0.022*ρ^2*(sin(θ))^2+ρ  *cos(θ)-25.63=0   这个公式才是对的 。。。。
3楼2012-03-28 14:13:57
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nqf1987

新虫 (初入文坛)

求解 方程 0.022*ρ^2*(sin(θ))^2+ρ *cos(θ)-25.63=0   
              θ=0*pi/180:1*pi/180:90*pi/180   
            求出各个θ所对应的ρ值。ρ>0

第一次的方程出了点小错误。。。这个是对的。。。。
4楼2012-03-28 14:16:56
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nqf1987

新虫 (初入文坛)

引用回帖:
5楼: Originally posted by dingd at 2012-03-28 14:56:35:
用1stOpt求解:

LoopConstant b=;
PlotLoopData b,p;
ParameterDomain = ;
Function 0.022*p^2*(sin(b))^2+p*cos(b)-25.63=0;



循环常数 b        p
0        25.63
0.0174532925199433        25.6295018661051
0.0349 ...

我输入 LoopConstant b=[0*pi/180:1*pi/180:90*pi/180];
PlotLoopData b[x],p;
ParameterDomain = [0,];
Function 0.022*p^2*(sin(b))^2+p*cos(b)-25.63=0;
得到  Undefined function 'LoopConstant' for input arguments of type 'char'.

我是新手 不明白呢  还要麻烦你啦 拜托 嘿嘿。。。
6楼2012-03-28 15:38:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nqf1987

新虫 (初入文坛)

有没有人会用matlab解这个方程啊  感激不尽啊。。。。
7楼2012-03-29 08:27:02
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nqf1987

新虫 (初入文坛)

引用回帖:
8楼: Originally posted by dbb627 at 2012-03-29 16:16:23:
>> syms p x
>> pp=solve('0.022*p^2*(sin(x))^2+p*cos(x)-25.63=0 ','p')

pp =

-(0.00000000000000000000000000000025*(90909090909090909090909090909091.0*cos(x) - 909090909090909090 ...

你真是个大好人 一连琢磨了几天 没弄出来  非常感谢。。。。
9楼2012-03-29 17:12:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

nqf1987

新虫 (初入文坛)

引用回帖:
8楼: Originally posted by dbb627 at 2012-03-29 16:16:23:
>> syms p x
>> pp=solve('0.022*p^2*(sin(x))^2+p*cos(x)-25.63=0 ','p')

pp =

-(0.00000000000000000000000000000025*(90909090909090909090909090909091.0*cos(x) - 909090909090909090 ...

今天非常感谢你能给我解答  还有个问题  就是我想把pp1导出到excel的一列中 我输入什么代码啊?
10楼2012-03-29 19:16:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 nqf1987 的主题更新
信息提示
请填处理意见