필터 지우기
필터 지우기

Modifying A Variable in an ODEFUN/Boundary Value Problem

조회 수: 2 (최근 30일)
Tony Stianchie
Tony Stianchie 2023년 5월 8일
댓글: Tony Stianchie 2023년 5월 8일
I am trying to modify with each step across my odefun the values of k, mu, and c.
I'd like for these variables for change with each step based on the value calculated for Sxint(4,j)
clc
clear all
close all
function yprime = odefun(eta,y)
yprime = zeros(5,1);
global m etainf Pr mu k c
%% Plotting Velocity and Temperature
etainf = 20; % Find Convergence for both Temp and Velocity
Pr = 0.7; % Enter Pr
for m = [0]
solinit = bvpinit(linspace(0,etainf,100),[0 0 0 1 0]);
sol = bvp4c(@odefun, @odefun_bc,solinit);
xint = linspace(0,etainf,100);
Sxint = deval(sol,xint);
for j = 1:etainf
mu = (Sxint(4,j))^0.7;
c = (Sxint(4,j))^0.19;
k = (Sxint(4,j))^0.85;
figure(1)
hold on
title('Velocity vs Eta, Pr = 0.1')
xlabel('Eta')
ylabel('Velocity')
plot(xint,Sxint(2,:)); % plots f' (velocity)
figure(2)
hold on
title('Temperature vs Eta, Pr = 0.1')
xlabel('Eta')
ylabel('Temperature')
plot(xint,Sxint(4,:)); % plots q (temp profile)
end
end
  댓글 수: 2
Torsten
Torsten 2023년 5월 8일
편집: Torsten 2023년 5월 8일
I'm totally lost on what you are trying to do with this code - especially what the "yprime" are you have to supply in function "odefun".
Tony Stianchie
Tony Stianchie 2023년 5월 8일
Sorry - I was vague in my question. I solved my problem, but appreciate the quick response.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by