How to solve a function with one independent variables with different values so that i can make a plot?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, first of all, thanks for help me.
I want to solve an equation: theta= 1- exp(b^2)*erfc(b) solving for b, where theta= (T_surf-Tini)/(T_fluid-Tini). The T_surf is the independent variables with 10 different variable. I want to solve the equation and the output result for b should be in matrix form, so that i can plot "b" against "T_surf".
Further, b=(h*sqrt(a*t))/k solving for h, where t is the changing variables which are corresponding to T_surf mentioned above; that this T_surf1 is corresponding to t_1, T_surf2 is corresponding t_2, and etc.
So at the end, I would be able to plot "t vs. h".
But i do not know where my code went wrong, could you help me with this issue?? Thanks!!
PS: he attached picture is my code.
1 Kommentar
Richard Marveldoss
am 5 Jul. 2017
According to the code attached solving for b using beta=solve(eqn,b) doesn't give a solution. Is this something that is intentional for your problem. The below code doesn't produce a solution for beta.
Tsurf=[190;129;110]
s=length(Tsurf);
Tini=200*ones(1,s)
Tfluid=40*ones(1,s);
k=3;a=2;
t=[3,6,9];
theta=[(Tsurf-Tini)/(Tfluid-Tini)]
Thetat=theta';
syms b;
eqn= 1-exp(b^2)*erfc(b)==theta;
beta=solve(eqn,b)
Antworten (1)
Walter Roberson
am 5 Jul. 2017
You have
theta=[(Tsurf-Tini)/(Tfluid-Tini)]
which is an array matrix-divided by an array, which is like (Tsurf-Tini) * pinv(Tfluid-Tini) . Are you sure that is what you want and not
theta = (Tsurf-Tini) ./ (Tfluid-Tini)
?
Either way your theta is going to be a vector of length 3. You then have
eqn= 1-exp(b^2)*erfc(b)==theta
which says that one fixed b has exactly the same relationship to three different numeric values. The only way that can happen is if the three different numeric values are identical.
Your Tsurf is 3 x 1. Your Tini is is 1 x 3. Tsurf - Tini, 3 x 1 minus 1 x 3, would be a prohibited operation in all versions prior to R2016b; starting in R2016b it gives a 3 x 3 result, equivalent to bsxfun(@minus, Tsurf, Tini) . Are you sure you want that?
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!