How can I derive solution in matrix form?

i want to get solutions with varying x from 0.201 to 0.210
the problem i have is like the below
x=0.201:0.001:0.210;
eqn=x^2*y^4+~~~~~~
and i want to get solutions of y in matrix form
and plot it with x
plot(x,y)
How can i get this solution in matrix form?

답변 (2개)

Mischa Kim
Mischa Kim 2015년 3월 26일

0 개 추천

Hello Junsoo, what relevance has eqn in computing y as a function of x?
In general, you need to use the dot notation when e.g. multiplying vectors. Try for example:
x = 0.201:0.001:0.210;
y = x.^2.*sqrt(3*x);
plot(x,y)

댓글 수: 4

Junsoo Lee
Junsoo Lee 2015년 3월 26일
Well my problem is The eqn is like this x*(y^4+y)=0
If x*(y^4+y)=0 is your equation, the solutions for y will be totally independent of the values of x, so it makes no sense to plot y against x.
Junsoo Lee
Junsoo Lee 2015년 3월 26일
Im sorry The eqn is x*(y^4+y)=constant
Junsoo Lee
Junsoo Lee 2015년 3월 27일
The code is like this
clear; clc;
upsilon=0.9;
h=5; r_1=0.2; T_inf=298; T_sur=308; q_r=136.66; sigma=5.67E-08;
T_s2=eye(1,10);
r_2=0.201:0.001:0.210;
sys=4*pi*(r_2).^2.*(upsilon*sigma*((T_s2).^4-(T_sur)^4)+h*(T_s2-T_inf))-q_r;
i want to solve the eqn for T_s2 and get it in the matrix form but i can't figure out how can i get the solution in matrix form.
James Tursa
James Tursa 2015년 3월 26일

0 개 추천

Use the dot versions of the operators to get element-wise operations. E.g.,
eqn=x.^2.*y.^4+~~~~~~ % <-- Note the use of .* and .^ instead of just * and ^

댓글 수: 4

Junsoo Lee
Junsoo Lee 2015년 3월 26일
Thanks for the answer but my problem is eqn is like this x*y^4+y^2=0
So now it sounds like your primary question is one of solving an equation for y in terms of x, and a secondary question is how to plot the solution for a range of x. Is this correct?
So far you have listed two different equations:
x*(y^4+y)=0
and
x*y^4+y^2=0
What is it exactly that you are trying to solve?
Junsoo Lee
Junsoo Lee 2015년 3월 26일
Im sorry The eqn is x*(y^4+y)=constant
Junsoo Lee
Junsoo Lee 2015년 3월 27일
The code is like this
clear; clc;
upsilon=0.9;
h=5; r_1=0.2; T_inf=298; T_sur=308; q_r=136.66; sigma=5.67E-08;
T_s2=eye(1,10);
r_2=0.201:0.001:0.210;
sys=4*pi*(r_2).^2.*(upsilon*sigma*((T_s2).^4-(T_sur)^4)+h*(T_s2-T_inf))-q_r;
i want to solve the eqn for T_s2 and get it in the matrix form but i can't figure out how can i get the solution in matrix form.

이 질문은 마감되었습니다.

질문:

2015년 3월 26일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by