Sir,
I have a function like;
teta=((2/Bi)*Xb)+(1-3*(1-Xb)^n+2*(1-Xb))+((6/Da)*(1-(1-Xb)^m));
Where
teta=0:0.2:5;
n=2/3;
m=1/3;
Bi=constant's(inf, 100, 10, 1, 0.1)
Da=constant(100, 10, 1, 0.1)
I want to plot(teta,Xb)

댓글 수: 8

Walter Roberson
Walter Roberson 2014년 3월 14일
Your Bi and Da appear to be vectors of values, and those vectors appear to be different lengths. How are you planning to deal with the vectors? Are you wanting to create length(Bi) * length(Da) different plots, selecting one value from each of two vectors?
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014년 3월 14일
What's Xb? Have you tried to plot what you equated? If yes what errors you received?
CHANDRA SHEKHAR BESTA
CHANDRA SHEKHAR BESTA 2014년 3월 14일
yes sir,
I want to create length(Bi) * length(Da) different plots, selecting one value from each of two vectors
CHANDRA SHEKHAR BESTA
CHANDRA SHEKHAR BESTA 2014년 3월 14일
Already i know teta values from 0:0.2:5, by solving equation; i want to find Xb.
After finding the Xb, I want to plot(teta,Xb)
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014년 3월 14일
So the question is how to find Xb? :(
Wait a second, you're confusing me! You already have teta values! not by solving this equation, you actually want to find Xb from this equation you wrote!
You have math prblem not a MATLAB problem!
CHANDRA SHEKHAR BESTA
CHANDRA SHEKHAR BESTA 2014년 3월 14일
Yes, I have already teta values.
I want to find Xb,
then plot(teta,Xb)
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014년 3월 14일
Ok, sounds better now
I'll post you an answer in some minutes ;)
CHANDRA SHEKHAR BESTA
CHANDRA SHEKHAR BESTA 2014년 3월 14일
Thank you i am waiting for your post.

댓글을 달려면 로그인하십시오.

답변 (2개)

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014년 3월 14일

0 개 추천

We have to solve your equation so that we get Xb values for known values of teta
So let's do it as such
teta=0:0.2:5;
n=2/3;
m=1/3;
Bi=(inf, 100, 10, 1, 0.1)
Da=(100, 10, 1, 0.1)
Bi=100;
Da=100;
for i= 1:length(teta)
fxb=@(Xb) teta(i)-((2/Bi)*Xb)+(1-3*(1-Xb)^n+2*(1-Xb))+((6/Da)*(1-(1-Xb)^m))
valXb(i)=fzero(fxb,0); %this gives you Xb for (Bi=100,Da=100,teta=0:.25:5)
end
plot(teta,valXb)
title(['teta VS Xb for Bi=',num2str(Bi),'Da=',num2str(Da)])
Please work out he rest on your own, for different values of Bi and Da, either use for loop or matrix multiplication.
Hope that helped. code is not tested let me know if it had errors, sorry fo that
Good Luck!
Walter Roberson
Walter Roberson 2014년 3월 14일

0 개 추천

There are up to three real-valued solutions for each teta. For some Bi, Da combinations, there are no real-valued solutions. For other combinations, there are three real-valued solutions until teta passes a threshold, after which there is only one real-valued solution.
The algebraic solution for Xb in terms of teta is pretty messy.

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

태그

질문:

2014년 3월 14일

답변:

2014년 3월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by